We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 296dd3d commit f9900b4Copy full SHA for f9900b4
lib/switchbot-device.js
@@ -443,6 +443,9 @@ class SwitchbotDevice {
443
444
this._connect()
445
.then(() => {
446
+ if (!this._chars) {
447
+ return reject("No characteristics available.");
448
+ }
449
return this._write(this._chars.write, req_buf);
450
})
451
lib/switchbot.js
@@ -132,7 +132,9 @@ class Switchbot {
132
for (let addr in peripherals) {
133
device_list.push(peripherals[addr]);
134
}
135
- resolve(device_list);
+ if (device_list.length) {
136
+ resolve(device_list);
137
138
};
139
140
// Set a handler for the 'discover' event
0 commit comments