@switchbot/homebridge-switchbot 2.5.3-beta.15 → 2.5.3-beta.17

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 (47) hide show
  1. package/dist/device/blindtilt.d.ts +1 -1
  2. package/dist/device/blindtilt.d.ts.map +1 -1
  3. package/dist/device/blindtilt.js +4 -6
  4. package/dist/device/blindtilt.js.map +1 -1
  5. package/dist/device/bot.d.ts +1 -1
  6. package/dist/device/bot.d.ts.map +1 -1
  7. package/dist/device/bot.js +4 -6
  8. package/dist/device/bot.js.map +1 -1
  9. package/dist/device/ceilinglight.d.ts +1 -1
  10. package/dist/device/ceilinglight.d.ts.map +1 -1
  11. package/dist/device/ceilinglight.js +4 -6
  12. package/dist/device/ceilinglight.js.map +1 -1
  13. package/dist/device/colorbulb.d.ts +1 -1
  14. package/dist/device/colorbulb.d.ts.map +1 -1
  15. package/dist/device/colorbulb.js +4 -6
  16. package/dist/device/colorbulb.js.map +1 -1
  17. package/dist/device/curtain.d.ts +1 -1
  18. package/dist/device/curtain.d.ts.map +1 -1
  19. package/dist/device/curtain.js +4 -8
  20. package/dist/device/curtain.js.map +1 -1
  21. package/dist/device/motion.d.ts +1 -1
  22. package/dist/device/motion.d.ts.map +1 -1
  23. package/dist/device/motion.js +4 -6
  24. package/dist/device/motion.js.map +1 -1
  25. package/dist/device/plug.d.ts +1 -1
  26. package/dist/device/plug.d.ts.map +1 -1
  27. package/dist/device/plug.js +4 -6
  28. package/dist/device/plug.js.map +1 -1
  29. package/dist/device/robotvacuumcleaner.d.ts +1 -1
  30. package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
  31. package/dist/device/robotvacuumcleaner.js +4 -6
  32. package/dist/device/robotvacuumcleaner.js.map +1 -1
  33. package/dist/device/striplight.d.ts +1 -1
  34. package/dist/device/striplight.d.ts.map +1 -1
  35. package/dist/device/striplight.js +4 -6
  36. package/dist/device/striplight.js.map +1 -1
  37. package/homebridge-ui/public/index.html +1 -1
  38. package/package.json +1 -1
  39. package/src/device/blindtilt.ts +4 -6
  40. package/src/device/bot.ts +4 -6
  41. package/src/device/ceilinglight.ts +4 -6
  42. package/src/device/colorbulb.ts +4 -6
  43. package/src/device/curtain.ts +4 -9
  44. package/src/device/motion.ts +4 -6
  45. package/src/device/plug.ts +4 -6
  46. package/src/device/robotvacuumcleaner.ts +4 -6
  47. package/src/device/striplight.ts +4 -6
@@ -248,9 +248,6 @@ export class Curtain {
248
248
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentPosition ${this.CurrentPosition}`);
249
249
  if (this.setNewTarget) {
250
250
  this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} Checking Status ...`);
251
- }
252
-
253
- if (this.setNewTarget && this.inMotion) {
254
251
  await this.setMinMax();
255
252
  if (Number(this.TargetPosition) > this.CurrentPosition) {
256
253
  this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Closing, CurrentPosition: ${this.CurrentPosition}`);
@@ -570,7 +567,7 @@ export class Curtain {
570
567
  this.debugLog(`${this.accessory.displayName} Mode: ${this.Mode}`);
571
568
  if (switchbot !== false) {
572
569
  await this.retry({
573
- max: await this.maxRetry(),
570
+ max: this.maxRetry(),
574
571
  fn: () => {
575
572
  return switchbot
576
573
  .discover({ model: 'c', quick: true, id: this.device.bleMac })
@@ -613,14 +610,12 @@ export class Curtain {
613
610
  });
614
611
  }
615
612
 
616
- async maxRetry(): Promise<number> {
617
- let maxRetry: number;
613
+ maxRetry(): number {
618
614
  if (this.device.maxRetry) {
619
- maxRetry = this.device.maxRetry;
615
+ return this.device.maxRetry;
620
616
  } else {
621
- maxRetry = 5;
617
+ return 5;
622
618
  }
623
- return maxRetry;
624
619
  }
625
620
 
626
621
  async openAPIpushChanges(): Promise<void> {
@@ -265,7 +265,7 @@ export class Motion {
265
265
  })
266
266
  .then(async () => {
267
267
  return await this.retry({
268
- max: await this.maxRetry(),
268
+ max: this.maxRetry(),
269
269
  fn: async () => {
270
270
  // Set an event hander
271
271
  this.scanning = true;
@@ -467,14 +467,12 @@ export class Motion {
467
467
  });
468
468
  }
469
469
 
470
- async maxRetry(): Promise<number> {
471
- let maxRetry: number;
470
+ maxRetry(): number {
472
471
  if (this.device.maxRetry) {
473
- maxRetry = this.device.maxRetry;
472
+ return this.device.maxRetry;
474
473
  } else {
475
- maxRetry = 5;
474
+ return 5;
476
475
  }
477
- return maxRetry;
478
476
  }
479
477
 
480
478
  minLux(): number {
@@ -351,7 +351,7 @@ export class Plug {
351
351
  .then(async (device_list: any) => {
352
352
  this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} On: ${this.On}`);
353
353
  return await this.retry({
354
- max: await this.maxRetry(),
354
+ max: this.maxRetry(),
355
355
  fn: async () => {
356
356
  if (this.On) {
357
357
  return await device_list[0].turnOn({ id: this.device.bleMac });
@@ -533,14 +533,12 @@ export class Plug {
533
533
  });
534
534
  }
535
535
 
536
- async maxRetry(): Promise<number> {
537
- let maxRetry: number;
536
+ maxRetry(): number {
538
537
  if (this.device.maxRetry) {
539
- maxRetry = this.device.maxRetry;
538
+ return this.device.maxRetry;
540
539
  } else {
541
- maxRetry = 5;
540
+ return 5;
542
541
  }
543
- return maxRetry;
544
542
  }
545
543
 
546
544
  model(device: device & devicesConfig): string {
@@ -362,7 +362,7 @@ export class RobotVacuumCleaner {
362
362
  .then(async (device_list: any) => {
363
363
  this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} On: ${this.On}`);
364
364
  return await this.retry({
365
- max: await this.maxRetry(),
365
+ max: this.maxRetry(),
366
366
  fn: async () => {
367
367
  if (this.On) {
368
368
  return await device_list[0].turnOn({ id: this.device.bleMac });
@@ -657,14 +657,12 @@ export class RobotVacuumCleaner {
657
657
  });
658
658
  }
659
659
 
660
- async maxRetry(): Promise<number> {
661
- let maxRetry: number;
660
+ maxRetry(): number {
662
661
  if (this.device.maxRetry) {
663
- maxRetry = this.device.maxRetry;
662
+ return this.device.maxRetry;
664
663
  } else {
665
- maxRetry = 5;
664
+ return 5;
666
665
  }
667
- return maxRetry;
668
666
  }
669
667
 
670
668
  model(device: device & devicesConfig): string {
@@ -467,7 +467,7 @@ export class StripLight {
467
467
  .then(async (device_list: any) => {
468
468
  this.infoLog(`${this.device.deviceType}: ${this.accessory.displayName} On: ${this.On}`);
469
469
  return await this.retry({
470
- max: await this.maxRetry(),
470
+ max: this.maxRetry(),
471
471
  fn: async () => {
472
472
  if (this.On) {
473
473
  return await device_list[0].turnOn({ id: this.device.bleMac });
@@ -898,14 +898,12 @@ export class StripLight {
898
898
  });
899
899
  }
900
900
 
901
- async maxRetry(): Promise<number> {
902
- let maxRetry: number;
901
+ maxRetry(): number {
903
902
  if (this.device.maxRetry) {
904
- maxRetry = this.device.maxRetry;
903
+ return this.device.maxRetry;
905
904
  } else {
906
- maxRetry = 5;
905
+ return 5;
907
906
  }
908
- return maxRetry;
909
907
  }
910
908
 
911
909
  minStep(device: device & devicesConfig): number {