@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.
- package/dist/device/bot.d.ts +1 -3
- 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 -3
- 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 -3
- 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/contact.d.ts +1 -3
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +4 -6
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts +1 -0
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +12 -16
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts +1 -3
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +4 -6
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts +1 -3
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +4 -6
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts +1 -3
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +4 -6
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts +1 -3
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +4 -6
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts +1 -0
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +12 -16
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts +1 -3
- 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/striplight.d.ts +1 -3
- package/dist/device/striplight.d.ts.map +1 -1
- package/dist/device/striplight.js +12 -12
- package/dist/device/striplight.js.map +1 -1
- package/package.json +1 -1
- package/src/device/bot.ts +4 -6
- package/src/device/ceilinglight.ts +4 -6
- package/src/device/colorbulb.ts +4 -6
- package/src/device/contact.ts +4 -6
- package/src/device/curtain.ts +12 -14
- package/src/device/humidifier.ts +4 -6
- package/src/device/lock.ts +4 -6
- package/src/device/meter.ts +4 -6
- package/src/device/meterplus.ts +4 -6
- package/src/device/motion.ts +12 -14
- package/src/device/plug.ts +4 -6
- package/src/device/striplight.ts +8 -10
package/src/device/plug.ts
CHANGED
|
@@ -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(
|
|
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(
|
|
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(
|
|
462
|
-
|
|
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();
|
package/src/device/striplight.ts
CHANGED
|
@@ -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
|
|
218
|
+
} else if (this.BLE) {
|
|
219
219
|
await this.BLEparseStatus();
|
|
220
|
-
} else
|
|
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
|
|
285
|
+
} else if (this.BLE) {
|
|
286
286
|
await this.BLERefreshStatus();
|
|
287
|
-
} else
|
|
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(
|
|
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(
|
|
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(
|
|
834
|
-
|
|
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();
|