@switchbot/homebridge-switchbot 2.2.0-beta.6 → 2.2.0-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/dist/device/bot.js +3 -3
  3. package/dist/device/bot.js.map +1 -1
  4. package/dist/device/ceilinglight.js +3 -3
  5. package/dist/device/ceilinglight.js.map +1 -1
  6. package/dist/device/colorbulb.js +3 -3
  7. package/dist/device/colorbulb.js.map +1 -1
  8. package/dist/device/contact.js +1 -1
  9. package/dist/device/contact.js.map +1 -1
  10. package/dist/device/curtain.js +3 -3
  11. package/dist/device/curtain.js.map +1 -1
  12. package/dist/device/humidifier.js +3 -3
  13. package/dist/device/humidifier.js.map +1 -1
  14. package/dist/device/lock.js +3 -3
  15. package/dist/device/lock.js.map +1 -1
  16. package/dist/device/meter.js +3 -3
  17. package/dist/device/meter.js.map +1 -1
  18. package/dist/device/meterplus.js +3 -3
  19. package/dist/device/meterplus.js.map +1 -1
  20. package/dist/device/motion.js +2 -2
  21. package/dist/device/motion.js.map +1 -1
  22. package/dist/device/plug.js +3 -3
  23. package/dist/device/plug.js.map +1 -1
  24. package/dist/device/striplight.js +3 -3
  25. package/dist/device/striplight.js.map +1 -1
  26. package/dist/platform.d.ts.map +1 -1
  27. package/dist/platform.js +1 -1
  28. package/dist/platform.js.map +1 -1
  29. package/package.json +2 -2
  30. package/src/device/bot.ts +3 -3
  31. package/src/device/ceilinglight.ts +3 -3
  32. package/src/device/colorbulb.ts +3 -3
  33. package/src/device/contact.ts +1 -1
  34. package/src/device/curtain.ts +3 -3
  35. package/src/device/humidifier.ts +3 -3
  36. package/src/device/lock.ts +3 -3
  37. package/src/device/meter.ts +3 -3
  38. package/src/device/meterplus.ts +3 -3
  39. package/src/device/motion.ts +2 -2
  40. package/src/device/plug.ts +3 -3
  41. package/src/device/striplight.ts +3 -3
  42. package/src/platform.ts +1 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Homebridge SwitchBot",
3
3
  "name": "@switchbot/homebridge-switchbot",
4
- "version": "2.2.0-beta.6",
4
+ "version": "2.2.0-beta.8",
5
5
  "description": "The [Homebridge](https://homebridge.io) SwitchBot plugin allows you to access your [SwitchBot](https://www.switch-bot.com) device(s) from HomeKit.",
6
6
  "author": "SwitchBot <support@wondertechlabs.com> (https://github.com/SwitchBot)",
7
7
  "license": "ISC",
@@ -80,6 +80,6 @@
80
80
  },
81
81
  "optionalDependencies": {
82
82
  "@abandonware/noble": "^1.9.2-15",
83
- "node-switchbot": "^1.6.0-beta.12"
83
+ "node-switchbot": "^1.6.0"
84
84
  }
85
85
  }
package/src/device/bot.ts CHANGED
@@ -455,7 +455,7 @@ export class Bot {
455
455
  model: 'H',
456
456
  id: this.device.bleMac,
457
457
  })
458
- .then(() => {
458
+ .then(async () => {
459
459
  // Set an event hander
460
460
  switchbot.onadvertisement = async (ad: ad) => {
461
461
  this.address = ad.address;
@@ -478,8 +478,8 @@ export class Bot {
478
478
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
479
479
  }
480
480
  };
481
- // Wait 2 seconds
482
- return switchbot.wait(this.scanDuration * 1000);
481
+ // Wait
482
+ return await switchbot.wait(this.scanDuration * 1000);
483
483
  })
484
484
  .then(async () => {
485
485
  // Stop to monitor
@@ -333,7 +333,7 @@ export class CeilingLight {
333
333
  model: 'u',
334
334
  id: this.device.bleMac,
335
335
  })
336
- .then(() => {
336
+ .then(async () => {
337
337
  // Set an event hander
338
338
  switchbot.onadvertisement = (ad: any) => {
339
339
  this.address = ad.address;
@@ -363,8 +363,8 @@ export class CeilingLight {
363
363
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
364
364
  }
365
365
  };
366
- // Wait 2 seconds
367
- return switchbot.wait(this.scanDuration * 1000);
366
+ // Wait
367
+ return await switchbot.wait(this.scanDuration * 1000);
368
368
  })
369
369
  .then(async () => {
370
370
  // Stop to monitor
@@ -362,7 +362,7 @@ export class ColorBulb {
362
362
  model: 'u',
363
363
  id: this.device.bleMac,
364
364
  })
365
- .then(() => {
365
+ .then(async () => {
366
366
  // Set an event hander
367
367
  switchbot.onadvertisement = async (ad: any) => {
368
368
  this.address = ad.address;
@@ -398,8 +398,8 @@ export class ColorBulb {
398
398
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
399
399
  }
400
400
  };
401
- // Wait 2 seconds
402
- return switchbot.wait(this.scanDuration * 1000);
401
+ // Wait
402
+ return await switchbot.wait(this.scanDuration * 1000);
403
403
  })
404
404
  .then(async () => {
405
405
  // Stop to monitor
@@ -329,7 +329,7 @@ export class Contact {
329
329
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
330
330
  }
331
331
  };
332
- // Wait 2 seconds
332
+ // Wait
333
333
  return await switchbot.wait(this.scanDuration * 1000);
334
334
  })
335
335
  .then(async () => {
@@ -420,7 +420,7 @@ export class Curtain {
420
420
  model: 'c',
421
421
  id: this.device.bleMac,
422
422
  })
423
- .then(() => {
423
+ .then(async () => {
424
424
  // Set an event hander
425
425
  switchbot.onadvertisement = async (ad: any) => {
426
426
  this.address = ad.address;
@@ -447,8 +447,8 @@ export class Curtain {
447
447
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
448
448
  }
449
449
  };
450
- // Wait 2 seconds
451
- return switchbot.wait(this.scanDuration * 1000);
450
+ // Wait
451
+ return await switchbot.wait(this.scanDuration * 1000);
452
452
  })
453
453
  .then(async () => {
454
454
  // Stop to monitor
@@ -312,7 +312,7 @@ export class Humidifier {
312
312
  model: 'e',
313
313
  id: this.device.bleMac,
314
314
  })
315
- .then(() => {
315
+ .then(async () => {
316
316
  // Set an event hander
317
317
  switchbot.onadvertisement = async (ad: ad) => {
318
318
  this.address = ad.address;
@@ -337,8 +337,8 @@ export class Humidifier {
337
337
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
338
338
  }
339
339
  };
340
- // Wait 2 seconds
341
- return switchbot.wait(this.scanDuration * 1000);
340
+ // Wait
341
+ return await switchbot.wait(this.scanDuration * 1000);
342
342
  })
343
343
  .then(async () => {
344
344
  // Stop to monitor
@@ -229,7 +229,7 @@ export class Lock {
229
229
  model: 'o',
230
230
  id: this.device.bleMac,
231
231
  })
232
- .then(() => {
232
+ .then(async () => {
233
233
  // Set an event hander
234
234
  switchbot.onadvertisement = async (ad: any) => {
235
235
  this.address = ad.address;
@@ -251,8 +251,8 @@ export class Lock {
251
251
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
252
252
  }
253
253
  };
254
- // Wait 2 seconds
255
- return switchbot.wait(this.scanDuration * 1000);
254
+ // Wait
255
+ return await switchbot.wait(this.scanDuration * 1000);
256
256
  })
257
257
  .then(async () => {
258
258
  // Stop to monitor
@@ -266,7 +266,7 @@ export class Meter {
266
266
  model: 'T',
267
267
  id: this.device.bleMac,
268
268
  })
269
- .then(() => {
269
+ .then(async () => {
270
270
  // Set an event hander
271
271
  switchbot.onadvertisement = async (ad: ad) => {
272
272
  this.address = ad.address;
@@ -297,8 +297,8 @@ export class Meter {
297
297
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
298
298
  }
299
299
  };
300
- // Wait 10 seconds
301
- return switchbot.wait(this.scanDuration * 1000);
300
+ // Wait
301
+ return await switchbot.wait(this.scanDuration * 1000);
302
302
  })
303
303
  .then(async () => {
304
304
  // Stop to monitor
@@ -266,7 +266,7 @@ export class MeterPlus {
266
266
  model: 'i',
267
267
  id: this.device.bleMac,
268
268
  })
269
- .then(() => {
269
+ .then(async () => {
270
270
  // Set an event hander
271
271
  switchbot.onadvertisement = async (ad: ad) => {
272
272
  this.address = ad.address;
@@ -297,8 +297,8 @@ export class MeterPlus {
297
297
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
298
298
  }
299
299
  };
300
- // Wait 10 seconds
301
- return switchbot.wait(this.scanDuration * 1000);
300
+ // Wait
301
+ return await switchbot.wait(this.scanDuration * 1000);
302
302
  })
303
303
  .then(async () => {
304
304
  // Stop to monitor
@@ -283,8 +283,8 @@ export class Motion {
283
283
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
284
284
  }
285
285
  };
286
- // Wait 10 seconds
287
- return await switchbot.wait(this.scanDuration * 2000);
286
+ // Wait
287
+ return await switchbot.wait(this.scanDuration * 1000);
288
288
  })
289
289
  .then(async () => {
290
290
  // Stop to monitor
@@ -197,7 +197,7 @@ export class Plug {
197
197
  model: this.BLEmodel(),
198
198
  id: this.device.bleMac,
199
199
  })
200
- .then(() => {
200
+ .then(async () => {
201
201
  // Set an event hander
202
202
  switchbot.onadvertisement = async (ad: any) => {
203
203
  this.address = ad.address;
@@ -227,8 +227,8 @@ export class Plug {
227
227
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
228
228
  }
229
229
  };
230
- // Wait 2 seconds
231
- return switchbot.wait(this.scanDuration * 1000);
230
+ // Wait
231
+ return await switchbot.wait(this.scanDuration * 1000);
232
232
  })
233
233
  .then(async () => {
234
234
  // Stop to monitor
@@ -309,7 +309,7 @@ export class StripLight {
309
309
  model: 'r',
310
310
  id: this.device.bleMac,
311
311
  })
312
- .then(() => {
312
+ .then(async () => {
313
313
  // Set an event hander
314
314
  switchbot.onadvertisement = async (ad: any) => {
315
315
  this.address = ad.address;
@@ -340,8 +340,8 @@ export class StripLight {
340
340
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
341
341
  }
342
342
  };
343
- // Wait 2 seconds
344
- return switchbot.wait(this.scanDuration * 1000);
343
+ // Wait
344
+ return await switchbot.wait(this.scanDuration * 1000);
345
345
  })
346
346
  .then(async () => {
347
347
  // Stop to monitor
package/src/platform.ts CHANGED
@@ -1837,8 +1837,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
1837
1837
  device.external = true;
1838
1838
  this.debugWarnLog(`${accessory.displayName} External TV Accessory Mode`);
1839
1839
  this.externalAccessory(accessory);
1840
- }
1841
- if (device.external) {
1840
+ } else if (device.external) {
1842
1841
  this.debugWarnLog(`${accessory.displayName} External Accessory Mode`);
1843
1842
  this.externalAccessory(accessory);
1844
1843
  } else {