@switchbot/homebridge-switchbot 2.2.2-beta.15 → 2.2.2-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/bot.d.ts.map +1 -1
- package/dist/device/bot.js +3 -1
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +3 -1
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +3 -1
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +3 -1
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +0 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +16 -14
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +3 -1
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +3 -1
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +3 -1
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +3 -1
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +0 -3
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +16 -12
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +3 -1
- package/dist/device/plug.js.map +1 -1
- package/dist/device/striplight.d.ts.map +1 -1
- package/dist/device/striplight.js +3 -1
- package/dist/device/striplight.js.map +1 -1
- package/package.json +1 -1
- package/src/device/bot.ts +3 -1
- package/src/device/ceilinglight.ts +3 -1
- package/src/device/colorbulb.ts +3 -1
- package/src/device/contact.ts +3 -1
- package/src/device/curtain.ts +14 -14
- package/src/device/humidifier.ts +3 -1
- package/src/device/lock.ts +3 -1
- package/src/device/meter.ts +3 -1
- package/src/device/meterplus.ts +3 -1
- package/src/device/motion.ts +14 -12
- package/src/device/plug.ts +3 -1
- package/src/device/striplight.ts +3 -1
package/src/device/curtain.ts
CHANGED
|
@@ -441,7 +441,13 @@ export class Curtain {
|
|
|
441
441
|
if (this.serviceData) {
|
|
442
442
|
this.connected = true;
|
|
443
443
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
444
|
-
await
|
|
444
|
+
await switchbot.stopScan();
|
|
445
|
+
if (this.connected) {
|
|
446
|
+
await this.BLEparseStatus();
|
|
447
|
+
await this.updateHomeKitCharacteristics();
|
|
448
|
+
} else {
|
|
449
|
+
await this.BLERefreshConnection(switchbot);
|
|
450
|
+
}
|
|
445
451
|
} else {
|
|
446
452
|
this.connected = false;
|
|
447
453
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -452,7 +458,13 @@ export class Curtain {
|
|
|
452
458
|
})
|
|
453
459
|
.then(async () => {
|
|
454
460
|
// Stop to monitor
|
|
455
|
-
await
|
|
461
|
+
await switchbot.stopScan();
|
|
462
|
+
if (this.connected) {
|
|
463
|
+
await this.BLEparseStatus();
|
|
464
|
+
await this.updateHomeKitCharacteristics();
|
|
465
|
+
} else {
|
|
466
|
+
await this.BLERefreshConnection(switchbot);
|
|
467
|
+
}
|
|
456
468
|
})
|
|
457
469
|
.catch(async (e: any) => {
|
|
458
470
|
this.apiError(e);
|
|
@@ -806,18 +818,6 @@ export class Curtain {
|
|
|
806
818
|
}
|
|
807
819
|
}
|
|
808
820
|
|
|
809
|
-
async stopScanning(switchbot: any) {
|
|
810
|
-
if (switchbot) {
|
|
811
|
-
await switchbot.stopScan();
|
|
812
|
-
}
|
|
813
|
-
if (this.connected) {
|
|
814
|
-
await this.BLEparseStatus();
|
|
815
|
-
await this.updateHomeKitCharacteristics();
|
|
816
|
-
} else {
|
|
817
|
-
await this.BLERefreshConnection(switchbot);
|
|
818
|
-
}
|
|
819
|
-
}
|
|
820
|
-
|
|
821
821
|
async getCustomBLEAddress(switchbot: any) {
|
|
822
822
|
if (this.device.customBLEaddress && this.deviceLogging.includes('debug')) {
|
|
823
823
|
(async () => {
|
package/src/device/humidifier.ts
CHANGED
|
@@ -766,7 +766,9 @@ export class Humidifier {
|
|
|
766
766
|
}
|
|
767
767
|
|
|
768
768
|
async stopScanning({ switchbot }: { switchbot: any; }): Promise<void> {
|
|
769
|
-
|
|
769
|
+
if (switchbot) {
|
|
770
|
+
await switchbot.stopScan();
|
|
771
|
+
}
|
|
770
772
|
if (this.connected) {
|
|
771
773
|
await this.BLEparseStatus();
|
|
772
774
|
await this.updateHomeKitCharacteristics();
|
package/src/device/lock.ts
CHANGED
|
@@ -491,7 +491,9 @@ export class Lock {
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
async stopScanning({ switchbot }: { switchbot: any; }): Promise<void> {
|
|
494
|
-
|
|
494
|
+
if (switchbot) {
|
|
495
|
+
await switchbot.stopScan();
|
|
496
|
+
}
|
|
495
497
|
if (this.connected) {
|
|
496
498
|
await this.BLEparseStatus();
|
|
497
499
|
await this.updateHomeKitCharacteristics();
|
package/src/device/meter.ts
CHANGED
|
@@ -489,7 +489,9 @@ export class Meter {
|
|
|
489
489
|
}
|
|
490
490
|
|
|
491
491
|
async stopScanning({ switchbot }: { switchbot: any; }): Promise<void> {
|
|
492
|
-
|
|
492
|
+
if (switchbot) {
|
|
493
|
+
await switchbot.stopScan();
|
|
494
|
+
}
|
|
493
495
|
if (this.connected) {
|
|
494
496
|
await this.BLEparseStatus();
|
|
495
497
|
await this.updateHomeKitCharacteristics();
|
package/src/device/meterplus.ts
CHANGED
|
@@ -488,7 +488,9 @@ export class MeterPlus {
|
|
|
488
488
|
}
|
|
489
489
|
|
|
490
490
|
async stopScanning({ switchbot }: { switchbot: any; }): Promise<void> {
|
|
491
|
-
|
|
491
|
+
if (switchbot) {
|
|
492
|
+
await switchbot.stopScan();
|
|
493
|
+
}
|
|
492
494
|
if (this.connected) {
|
|
493
495
|
await this.BLEparseStatus();
|
|
494
496
|
await this.updateHomeKitCharacteristics();
|
package/src/device/motion.ts
CHANGED
|
@@ -277,7 +277,13 @@ export class Motion {
|
|
|
277
277
|
if (this.serviceData) {
|
|
278
278
|
this.connected = true;
|
|
279
279
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
280
|
-
await
|
|
280
|
+
await switchbot.stopScan();
|
|
281
|
+
if (this.connected) {
|
|
282
|
+
await this.BLEparseStatus();
|
|
283
|
+
await this.updateHomeKitCharacteristics();
|
|
284
|
+
} else {
|
|
285
|
+
await this.BLERefreshConnection(switchbot);
|
|
286
|
+
}
|
|
281
287
|
} else {
|
|
282
288
|
this.connected = false;
|
|
283
289
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} connected: ${this.connected}`);
|
|
@@ -288,7 +294,13 @@ export class Motion {
|
|
|
288
294
|
})
|
|
289
295
|
.then(async () => {
|
|
290
296
|
// Stop to monitor
|
|
291
|
-
await
|
|
297
|
+
await switchbot.stopScan();
|
|
298
|
+
if (this.connected) {
|
|
299
|
+
await this.BLEparseStatus();
|
|
300
|
+
await this.updateHomeKitCharacteristics();
|
|
301
|
+
} else {
|
|
302
|
+
await this.BLERefreshConnection(switchbot);
|
|
303
|
+
}
|
|
292
304
|
})
|
|
293
305
|
.catch(async (e: any) => {
|
|
294
306
|
this.apiError(e);
|
|
@@ -394,16 +406,6 @@ export class Motion {
|
|
|
394
406
|
}
|
|
395
407
|
}
|
|
396
408
|
|
|
397
|
-
async stopScanning({ switchbot }: { switchbot: any; }): Promise<void> {
|
|
398
|
-
await await switchbot.stopScan();
|
|
399
|
-
if (this.connected) {
|
|
400
|
-
await this.BLEparseStatus();
|
|
401
|
-
await this.updateHomeKitCharacteristics();
|
|
402
|
-
} else {
|
|
403
|
-
await this.BLERefreshConnection(switchbot);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
409
|
async getCustomBLEAddress(switchbot: any) {
|
|
408
410
|
if (this.device.customBLEaddress && this.deviceLogging.includes('debug')) {
|
|
409
411
|
(async () => {
|
package/src/device/plug.ts
CHANGED
|
@@ -459,7 +459,9 @@ export class Plug {
|
|
|
459
459
|
}
|
|
460
460
|
|
|
461
461
|
async stopScanning({ switchbot }: { switchbot: any; }): Promise<void> {
|
|
462
|
-
|
|
462
|
+
if (switchbot) {
|
|
463
|
+
await switchbot.stopScan();
|
|
464
|
+
}
|
|
463
465
|
if (this.connected) {
|
|
464
466
|
await this.BLEparseStatus();
|
|
465
467
|
await this.updateHomeKitCharacteristics();
|
package/src/device/striplight.ts
CHANGED
|
@@ -831,7 +831,9 @@ export class StripLight {
|
|
|
831
831
|
}
|
|
832
832
|
|
|
833
833
|
async stopScanning({ switchbot }: { switchbot: any; }): Promise<void> {
|
|
834
|
-
|
|
834
|
+
if (switchbot) {
|
|
835
|
+
await switchbot.stopScan();
|
|
836
|
+
}
|
|
835
837
|
if (this.connected) {
|
|
836
838
|
await this.BLEparseStatus();
|
|
837
839
|
await this.updateHomeKitCharacteristics();
|