@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.
- package/dist/device/blindtilt.d.ts +1 -1
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +4 -6
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +4 -6
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +4 -6
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +4 -6
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/curtain.d.ts +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +4 -8
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/motion.d.ts +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +4 -6
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +4 -6
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +4 -6
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/device/striplight.d.ts +1 -1
- package/dist/device/striplight.d.ts.map +1 -1
- package/dist/device/striplight.js +4 -6
- package/dist/device/striplight.js.map +1 -1
- package/homebridge-ui/public/index.html +1 -1
- package/package.json +1 -1
- package/src/device/blindtilt.ts +4 -6
- package/src/device/bot.ts +4 -6
- package/src/device/ceilinglight.ts +4 -6
- package/src/device/colorbulb.ts +4 -6
- package/src/device/curtain.ts +4 -9
- package/src/device/motion.ts +4 -6
- package/src/device/plug.ts +4 -6
- package/src/device/robotvacuumcleaner.ts +4 -6
- package/src/device/striplight.ts +4 -6
package/src/device/curtain.ts
CHANGED
|
@@ -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:
|
|
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
|
-
|
|
617
|
-
let maxRetry: number;
|
|
613
|
+
maxRetry(): number {
|
|
618
614
|
if (this.device.maxRetry) {
|
|
619
|
-
|
|
615
|
+
return this.device.maxRetry;
|
|
620
616
|
} else {
|
|
621
|
-
|
|
617
|
+
return 5;
|
|
622
618
|
}
|
|
623
|
-
return maxRetry;
|
|
624
619
|
}
|
|
625
620
|
|
|
626
621
|
async openAPIpushChanges(): Promise<void> {
|
package/src/device/motion.ts
CHANGED
|
@@ -265,7 +265,7 @@ export class Motion {
|
|
|
265
265
|
})
|
|
266
266
|
.then(async () => {
|
|
267
267
|
return await this.retry({
|
|
268
|
-
max:
|
|
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
|
-
|
|
471
|
-
let maxRetry: number;
|
|
470
|
+
maxRetry(): number {
|
|
472
471
|
if (this.device.maxRetry) {
|
|
473
|
-
|
|
472
|
+
return this.device.maxRetry;
|
|
474
473
|
} else {
|
|
475
|
-
|
|
474
|
+
return 5;
|
|
476
475
|
}
|
|
477
|
-
return maxRetry;
|
|
478
476
|
}
|
|
479
477
|
|
|
480
478
|
minLux(): number {
|
package/src/device/plug.ts
CHANGED
|
@@ -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:
|
|
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
|
-
|
|
537
|
-
let maxRetry: number;
|
|
536
|
+
maxRetry(): number {
|
|
538
537
|
if (this.device.maxRetry) {
|
|
539
|
-
|
|
538
|
+
return this.device.maxRetry;
|
|
540
539
|
} else {
|
|
541
|
-
|
|
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:
|
|
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
|
-
|
|
661
|
-
let maxRetry: number;
|
|
660
|
+
maxRetry(): number {
|
|
662
661
|
if (this.device.maxRetry) {
|
|
663
|
-
|
|
662
|
+
return this.device.maxRetry;
|
|
664
663
|
} else {
|
|
665
|
-
|
|
664
|
+
return 5;
|
|
666
665
|
}
|
|
667
|
-
return maxRetry;
|
|
668
666
|
}
|
|
669
667
|
|
|
670
668
|
model(device: device & devicesConfig): string {
|
package/src/device/striplight.ts
CHANGED
|
@@ -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:
|
|
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
|
-
|
|
902
|
-
let maxRetry: number;
|
|
901
|
+
maxRetry(): number {
|
|
903
902
|
if (this.device.maxRetry) {
|
|
904
|
-
|
|
903
|
+
return this.device.maxRetry;
|
|
905
904
|
} else {
|
|
906
|
-
|
|
905
|
+
return 5;
|
|
907
906
|
}
|
|
908
|
-
return maxRetry;
|
|
909
907
|
}
|
|
910
908
|
|
|
911
909
|
minStep(device: device & devicesConfig): number {
|