@switchbot/homebridge-switchbot 1.11.1 → 1.12.2-beta.0
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 +21 -0
- package/config.schema.json +18 -3
- package/dist/device/bot.d.ts +8 -0
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +40 -21
- package/dist/device/bot.js.map +1 -1
- package/dist/device/colorbulb.d.ts.map +1 -1
- package/dist/device/colorbulb.js +8 -26
- package/dist/device/colorbulb.js.map +1 -1
- package/dist/device/contact.d.ts.map +1 -1
- package/dist/device/contact.js +4 -10
- package/dist/device/contact.js.map +1 -1
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +13 -28
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/humidifier.d.ts.map +1 -1
- package/dist/device/humidifier.js +9 -30
- package/dist/device/humidifier.js.map +1 -1
- package/dist/device/lock.d.ts.map +1 -1
- package/dist/device/lock.js +4 -10
- package/dist/device/lock.js.map +1 -1
- package/dist/device/meter.d.ts.map +1 -1
- package/dist/device/meter.js +4 -10
- package/dist/device/meter.js.map +1 -1
- package/dist/device/motion.d.ts.map +1 -1
- package/dist/device/motion.js +4 -10
- package/dist/device/motion.js.map +1 -1
- package/dist/device/plug.d.ts.map +1 -1
- package/dist/device/plug.js +4 -10
- package/dist/device/plug.js.map +1 -1
- package/dist/irdevice/airconditioner.d.ts.map +1 -1
- package/dist/irdevice/airconditioner.js +3 -6
- package/dist/irdevice/airconditioner.js.map +1 -1
- package/dist/irdevice/airpurifier.d.ts.map +1 -1
- package/dist/irdevice/airpurifier.js +3 -6
- package/dist/irdevice/airpurifier.js.map +1 -1
- package/dist/irdevice/camera.d.ts.map +1 -1
- package/dist/irdevice/camera.js +3 -6
- package/dist/irdevice/camera.js.map +1 -1
- package/dist/irdevice/fan.d.ts.map +1 -1
- package/dist/irdevice/fan.js +3 -6
- package/dist/irdevice/fan.js.map +1 -1
- package/dist/irdevice/light.d.ts.map +1 -1
- package/dist/irdevice/light.js +3 -6
- package/dist/irdevice/light.js.map +1 -1
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +4 -7
- package/dist/irdevice/other.js.map +1 -1
- package/dist/irdevice/tv.d.ts.map +1 -1
- package/dist/irdevice/tv.js +3 -6
- package/dist/irdevice/tv.js.map +1 -1
- package/dist/irdevice/vacuumcleaner.d.ts.map +1 -1
- package/dist/irdevice/vacuumcleaner.js +3 -6
- package/dist/irdevice/vacuumcleaner.js.map +1 -1
- package/dist/irdevice/waterheater.d.ts.map +1 -1
- package/dist/irdevice/waterheater.js +3 -6
- package/dist/irdevice/waterheater.js.map +1 -1
- package/dist/platform.js +6 -6
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +1 -0
- package/dist/settings.d.ts.map +1 -1
- package/dist/settings.js.map +1 -1
- package/package.json +76 -76
- package/src/device/bot.ts +40 -20
- package/src/device/colorbulb.ts +8 -36
- package/src/device/contact.ts +4 -12
- package/src/device/curtain.ts +13 -28
- package/src/device/humidifier.ts +9 -30
- package/src/device/lock.ts +4 -10
- package/src/device/meter.ts +4 -10
- package/src/device/motion.ts +4 -12
- package/src/device/plug.ts +4 -10
- package/src/irdevice/airconditioner.ts +3 -6
- package/src/irdevice/airpurifier.ts +3 -6
- package/src/irdevice/camera.ts +3 -6
- package/src/irdevice/fan.ts +3 -6
- package/src/irdevice/light.ts +3 -6
- package/src/irdevice/other.ts +4 -7
- package/src/irdevice/tv.ts +3 -8
- package/src/irdevice/vacuumcleaner.ts +3 -6
- package/src/irdevice/waterheater.ts +3 -6
- package/src/platform.ts +6 -6
- package/src/settings.ts +1 -0
package/src/platform.ts
CHANGED
|
@@ -61,7 +61,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
61
61
|
this.debugLog('Config OK');
|
|
62
62
|
} catch (e: any) {
|
|
63
63
|
this.errorLog(JSON.stringify(e.message));
|
|
64
|
-
if (this.platformLogging
|
|
64
|
+
if (this.platformLogging?.includes('debug')) {
|
|
65
65
|
this.errorLog(JSON.stringify(e));
|
|
66
66
|
}
|
|
67
67
|
return;
|
|
@@ -85,7 +85,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
85
85
|
this.discoverDevices();
|
|
86
86
|
} catch (e: any) {
|
|
87
87
|
this.errorLog('Failed to Discover Devices.', JSON.stringify(e.message));
|
|
88
|
-
if (this.platformLogging
|
|
88
|
+
if (this.platformLogging?.includes('debug')) {
|
|
89
89
|
this.errorLog(JSON.stringify(e));
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -117,7 +117,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
117
117
|
* It should be used to setup event handlers for characteristics and update respective values.
|
|
118
118
|
*/
|
|
119
119
|
configureAccessory(accessory: PlatformAccessory) {
|
|
120
|
-
this.
|
|
120
|
+
this.debugLog(`Loading accessory from cache: ${accessory.displayName}`);
|
|
121
121
|
|
|
122
122
|
// add the restored accessory to the accessories cache so we can track if it has already been registered
|
|
123
123
|
this.accessories.push(accessory);
|
|
@@ -140,7 +140,7 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
140
140
|
platformConfig['pushRate'] = this.config.options.pushRate;
|
|
141
141
|
}
|
|
142
142
|
if (Object.entries(platformConfig).length !== 0) {
|
|
143
|
-
this.
|
|
143
|
+
this.infoLog(`Platform Config: ${JSON.stringify(platformConfig)}`);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
if (this.config.options) {
|
|
@@ -1546,13 +1546,13 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
1546
1546
|
}
|
|
1547
1547
|
|
|
1548
1548
|
public deviceListInfo(devices: deviceResponses) {
|
|
1549
|
-
if (this.platformLogging
|
|
1549
|
+
if (this.platformLogging?.includes('debug')) {
|
|
1550
1550
|
this.warnLog(`deviceListInfoStatus: ${JSON.stringify(devices)}`);
|
|
1551
1551
|
}
|
|
1552
1552
|
}
|
|
1553
1553
|
|
|
1554
1554
|
public async deviceInfo(device: (irdevice & devicesConfig) | (device & devicesConfig)) {
|
|
1555
|
-
if (this.platformLogging
|
|
1555
|
+
if (this.platformLogging?.includes('debug')) {
|
|
1556
1556
|
this.warnLog(JSON.stringify(device));
|
|
1557
1557
|
this.deviceStatus = (await this.axios.get(`${DeviceURL}/${device.deviceId}/status`)).data;
|
|
1558
1558
|
if (this.deviceStatus.message === 'success') {
|