@switchbot/homebridge-switchbot 2.2.2-beta.17 → 2.2.2-beta.19

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 (61) hide show
  1. package/dist/device/bot.d.ts +1 -3
  2. package/dist/device/bot.d.ts.map +1 -1
  3. package/dist/device/bot.js +4 -6
  4. package/dist/device/bot.js.map +1 -1
  5. package/dist/device/ceilinglight.d.ts +1 -3
  6. package/dist/device/ceilinglight.d.ts.map +1 -1
  7. package/dist/device/ceilinglight.js +4 -6
  8. package/dist/device/ceilinglight.js.map +1 -1
  9. package/dist/device/colorbulb.d.ts +1 -3
  10. package/dist/device/colorbulb.d.ts.map +1 -1
  11. package/dist/device/colorbulb.js +4 -6
  12. package/dist/device/colorbulb.js.map +1 -1
  13. package/dist/device/contact.d.ts +1 -3
  14. package/dist/device/contact.d.ts.map +1 -1
  15. package/dist/device/contact.js +4 -6
  16. package/dist/device/contact.js.map +1 -1
  17. package/dist/device/curtain.d.ts +1 -0
  18. package/dist/device/curtain.d.ts.map +1 -1
  19. package/dist/device/curtain.js +12 -16
  20. package/dist/device/curtain.js.map +1 -1
  21. package/dist/device/humidifier.d.ts +1 -3
  22. package/dist/device/humidifier.d.ts.map +1 -1
  23. package/dist/device/humidifier.js +4 -6
  24. package/dist/device/humidifier.js.map +1 -1
  25. package/dist/device/lock.d.ts +1 -3
  26. package/dist/device/lock.d.ts.map +1 -1
  27. package/dist/device/lock.js +4 -6
  28. package/dist/device/lock.js.map +1 -1
  29. package/dist/device/meter.d.ts +1 -3
  30. package/dist/device/meter.d.ts.map +1 -1
  31. package/dist/device/meter.js +4 -6
  32. package/dist/device/meter.js.map +1 -1
  33. package/dist/device/meterplus.d.ts +1 -3
  34. package/dist/device/meterplus.d.ts.map +1 -1
  35. package/dist/device/meterplus.js +4 -6
  36. package/dist/device/meterplus.js.map +1 -1
  37. package/dist/device/motion.d.ts +1 -0
  38. package/dist/device/motion.d.ts.map +1 -1
  39. package/dist/device/motion.js +12 -16
  40. package/dist/device/motion.js.map +1 -1
  41. package/dist/device/plug.d.ts +1 -3
  42. package/dist/device/plug.d.ts.map +1 -1
  43. package/dist/device/plug.js +4 -6
  44. package/dist/device/plug.js.map +1 -1
  45. package/dist/device/striplight.d.ts +1 -3
  46. package/dist/device/striplight.d.ts.map +1 -1
  47. package/dist/device/striplight.js +12 -12
  48. package/dist/device/striplight.js.map +1 -1
  49. package/package.json +1 -1
  50. package/src/device/bot.ts +4 -6
  51. package/src/device/ceilinglight.ts +4 -6
  52. package/src/device/colorbulb.ts +4 -6
  53. package/src/device/contact.ts +4 -6
  54. package/src/device/curtain.ts +12 -14
  55. package/src/device/humidifier.ts +4 -6
  56. package/src/device/lock.ts +4 -6
  57. package/src/device/meter.ts +4 -6
  58. package/src/device/meterplus.ts +4 -6
  59. package/src/device/motion.ts +12 -14
  60. package/src/device/plug.ts +4 -6
  61. package/src/device/striplight.ts +8 -10
@@ -221,7 +221,7 @@ export class Plug {
221
221
  if (this.serviceData) {
222
222
  this.connected = true;
223
223
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
224
- await this.stopScanning({ switchbot: { switchbot } });
224
+ await this.stopScanning(switchbot);
225
225
  } else {
226
226
  this.connected = false;
227
227
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
@@ -232,7 +232,7 @@ export class Plug {
232
232
  })
233
233
  .then(async () => {
234
234
  // Stop to monitor
235
- await this.stopScanning({ switchbot: { switchbot } });
235
+ await this.stopScanning(switchbot);
236
236
  })
237
237
  .catch(async (e: any) => {
238
238
  this.apiError(e);
@@ -458,10 +458,8 @@ export class Plug {
458
458
  }
459
459
  }
460
460
 
461
- async stopScanning({ switchbot }: { switchbot: any; }): Promise<void> {
462
- if (switchbot) {
463
- await switchbot.stopScan();
464
- }
461
+ async stopScanning(switchbot: any) {
462
+ await switchbot.stopScan();
465
463
  if (this.connected) {
466
464
  await this.BLEparseStatus();
467
465
  await this.updateHomeKitCharacteristics();
@@ -215,9 +215,9 @@ export class StripLight {
215
215
  async parseStatus(): Promise<void> {
216
216
  if (!this.device.enableCloudService && this.OpenAPI) {
217
217
  this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} parseStatus enableCloudService: ${this.device.enableCloudService}`);
218
- } else/*if (this.BLE) {
218
+ } else if (this.BLE) {
219
219
  await this.BLEparseStatus();
220
- } else*/ if (this.OpenAPI && this.platform.config.credentials?.token) {
220
+ } else if (this.OpenAPI && this.platform.config.credentials?.token) {
221
221
  await this.openAPIparseStatus();
222
222
  } else {
223
223
  await this.offlineOff();
@@ -282,9 +282,9 @@ export class StripLight {
282
282
  async refreshStatus(): Promise<void> {
283
283
  if (!this.device.enableCloudService && this.OpenAPI) {
284
284
  this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} refreshStatus enableCloudService: ${this.device.enableCloudService}`);
285
- } else/*if (this.BLE) {
285
+ } else if (this.BLE) {
286
286
  await this.BLERefreshStatus();
287
- } else*/ if (this.OpenAPI && this.platform.config.credentials?.token) {
287
+ } else if (this.OpenAPI && this.platform.config.credentials?.token) {
288
288
  await this.openAPIRefreshStatus();
289
289
  } else {
290
290
  await this.offlineOff();
@@ -335,7 +335,7 @@ export class StripLight {
335
335
  if (this.serviceData) {
336
336
  this.connected = true;
337
337
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
338
- await this.stopScanning({ switchbot: { switchbot } });
338
+ await this.stopScanning(switchbot);
339
339
  } else {
340
340
  this.connected = false;
341
341
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
@@ -346,7 +346,7 @@ export class StripLight {
346
346
  })
347
347
  .then(async () => {
348
348
  // Stop to monitor
349
- await this.stopScanning({ switchbot: { switchbot } });
349
+ await this.stopScanning(switchbot);
350
350
  })
351
351
  .catch(async (e: any) => {
352
352
  this.apiError(e);
@@ -830,10 +830,8 @@ export class StripLight {
830
830
  }
831
831
  }
832
832
 
833
- async stopScanning({ switchbot }: { switchbot: any; }): Promise<void> {
834
- if (switchbot) {
835
- await switchbot.stopScan();
836
- }
833
+ async stopScanning(switchbot: any) {
834
+ await switchbot.stopScan();
837
835
  if (this.connected) {
838
836
  await this.BLEparseStatus();
839
837
  await this.updateHomeKitCharacteristics();