@switchbot/homebridge-switchbot 3.1.1-beta.10 → 3.1.1-beta.12
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/CHANGELOG.md +1 -1
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +2 -1
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +2 -1
- package/dist/device/bot.js.map +1 -1
- package/dist/device/ceilinglight.d.ts.map +1 -1
- package/dist/device/ceilinglight.js +2 -1
- package/dist/device/ceilinglight.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +2 -1
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +2 -1
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +3 -2
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +2 -1
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +2 -1
- package/dist/device/iosensor.js.map +1 -1
- package/dist/device/lightstrip.d.ts.map +1 -1
- package/dist/device/lightstrip.js +2 -1
- package/dist/device/lightstrip.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +2 -1
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +2 -1
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +2 -1
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +2 -1
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +2 -1
- package/dist/device/plug.js.map +1 -1
- package/dist/device/robotvacuumcleaner.d.ts.map +1 -1
- package/dist/device/robotvacuumcleaner.js +2 -1
- package/dist/device/robotvacuumcleaner.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +10 -12
- package/dist/platform.js.map +1 -1
- package/package.json +5 -5
- package/src/device/blindtilt.ts +2 -1
- package/src/device/bot.ts +2 -1
- package/src/device/ceilinglight.ts +2 -1
- package/src/device/colorbulb.ts +2 -1
- package/src/device/contact.ts +2 -1
- package/src/device/curtain.ts +3 -2
- package/src/device/humidifier.ts +2 -1
- package/src/device/iosensor.ts +2 -1
- package/src/device/lightstrip.ts +2 -1
- package/src/device/lock.ts +2 -1
- package/src/device/meter.ts +2 -1
- package/src/device/meterplus.ts +2 -1
- package/src/device/motion.ts +2 -1
- package/src/device/plug.ts +2 -1
- package/src/device/robotvacuumcleaner.ts +2 -1
- package/src/platform.ts +11 -11
package/src/device/iosensor.ts
CHANGED
|
@@ -559,7 +559,8 @@ export class IOSensor {
|
|
|
559
559
|
}
|
|
560
560
|
|
|
561
561
|
async BLERefreshConnection(switchbot: any): Promise<void> {
|
|
562
|
-
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot
|
|
562
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot:`
|
|
563
|
+
+ ` ${JSON.stringify(switchbot)}`);
|
|
563
564
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
564
565
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
|
|
565
566
|
await this.openAPIRefreshStatus();
|
package/src/device/lightstrip.ts
CHANGED
|
@@ -943,7 +943,8 @@ export class StripLight {
|
|
|
943
943
|
}
|
|
944
944
|
|
|
945
945
|
async BLERefreshConnection(switchbot: any): Promise<void> {
|
|
946
|
-
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot
|
|
946
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot:`
|
|
947
|
+
+ ` ${JSON.stringify(switchbot)}`);
|
|
947
948
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
948
949
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
|
|
949
950
|
await this.openAPIRefreshStatus();
|
package/src/device/lock.ts
CHANGED
|
@@ -678,7 +678,8 @@ export class Lock {
|
|
|
678
678
|
}
|
|
679
679
|
|
|
680
680
|
async BLERefreshConnection(switchbot: any): Promise<void> {
|
|
681
|
-
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot
|
|
681
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot:`
|
|
682
|
+
+ ` ${JSON.stringify(switchbot)}`);
|
|
682
683
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
683
684
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
|
|
684
685
|
await this.openAPIRefreshStatus();
|
package/src/device/meter.ts
CHANGED
|
@@ -552,7 +552,8 @@ export class Meter {
|
|
|
552
552
|
}
|
|
553
553
|
|
|
554
554
|
async BLERefreshConnection(switchbot: any): Promise<void> {
|
|
555
|
-
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot
|
|
555
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot:`
|
|
556
|
+
+ ` ${JSON.stringify(switchbot)}`);
|
|
556
557
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
557
558
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
|
|
558
559
|
await this.openAPIRefreshStatus();
|
package/src/device/meterplus.ts
CHANGED
|
@@ -557,7 +557,8 @@ export class MeterPlus {
|
|
|
557
557
|
}
|
|
558
558
|
|
|
559
559
|
async BLERefreshConnection(switchbot: any): Promise<void> {
|
|
560
|
-
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot
|
|
560
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot:`
|
|
561
|
+
+ ` ${JSON.stringify(switchbot)}`);
|
|
561
562
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
562
563
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
|
|
563
564
|
await this.openAPIRefreshStatus();
|
package/src/device/motion.ts
CHANGED
|
@@ -462,7 +462,8 @@ export class Motion {
|
|
|
462
462
|
}
|
|
463
463
|
|
|
464
464
|
async BLERefreshConnection(switchbot: any): Promise<void> {
|
|
465
|
-
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot
|
|
465
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot:`
|
|
466
|
+
+ ` ${JSON.stringify(switchbot)}`);
|
|
466
467
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
467
468
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
|
|
468
469
|
await this.openAPIRefreshStatus();
|
package/src/device/plug.ts
CHANGED
|
@@ -497,7 +497,8 @@ export class Plug {
|
|
|
497
497
|
}
|
|
498
498
|
|
|
499
499
|
async BLERefreshConnection(switchbot: any): Promise<void> {
|
|
500
|
-
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot
|
|
500
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot:`
|
|
501
|
+
+ ` ${JSON.stringify(switchbot)}`);
|
|
501
502
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
502
503
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
|
|
503
504
|
await this.openAPIRefreshStatus();
|
|
@@ -659,7 +659,8 @@ export class RobotVacuumCleaner {
|
|
|
659
659
|
}
|
|
660
660
|
|
|
661
661
|
async BLERefreshConnection(switchbot: any): Promise<void> {
|
|
662
|
-
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot
|
|
662
|
+
this.errorLog(`${this.device.deviceType}: ${this.accessory.displayName} wasn't able to establish BLE Connection, node-switchbot:`
|
|
663
|
+
+ ` ${JSON.stringify(switchbot)}`);
|
|
663
664
|
if (this.platform.config.credentials?.token && this.device.connectionType === 'BLE/OpenAPI') {
|
|
664
665
|
this.warnLog(`${this.device.deviceType}: ${this.accessory.displayName} Using OpenAPI Connection to Refresh Status`);
|
|
665
666
|
await this.openAPIRefreshStatus();
|
package/src/platform.ts
CHANGED
|
@@ -39,6 +39,9 @@ import asyncmqtt from 'async-mqtt';
|
|
|
39
39
|
import crypto, { randomUUID } from 'crypto';
|
|
40
40
|
import { readFileSync, writeFileSync } from 'fs';
|
|
41
41
|
import hbLib from 'homebridge-lib';
|
|
42
|
+
import { SwitchBot } from 'node-switchbot';
|
|
43
|
+
/*import { SwitchBot } from '/Users/Shared/GitHub/OpenWonderLabs/node-switchbot/dist/switchbot.js';*/
|
|
44
|
+
|
|
42
45
|
|
|
43
46
|
|
|
44
47
|
/**
|
|
@@ -2520,17 +2523,14 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
2520
2523
|
|
|
2521
2524
|
// BLE Connection
|
|
2522
2525
|
async connectBLE() {
|
|
2523
|
-
let
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
this.errorLog(`Was 'node-switchbot' found: ${Switchbot}`);
|
|
2532
|
-
}
|
|
2533
|
-
return Switchbot;
|
|
2526
|
+
let switchbot: any;
|
|
2527
|
+
//try {
|
|
2528
|
+
queueScheduler.schedule(() => (switchbot = new SwitchBot()));
|
|
2529
|
+
/*} catch (e: any) {
|
|
2530
|
+
switchbot = false;
|
|
2531
|
+
this.errorLog(`Was 'node-switchbot' found: ${switchbot}, Error: ${e}`);
|
|
2532
|
+
}*/
|
|
2533
|
+
return switchbot;
|
|
2534
2534
|
}
|
|
2535
2535
|
|
|
2536
2536
|
logType() {
|