@switchbot/homebridge-switchbot 1.12.0 → 1.12.1
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 +7 -0
- package/config.schema.json +9 -3
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +8 -15
- 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 +7 -22
- 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 +5 -5
- package/dist/platform.js.map +1 -1
- package/package.json +4 -4
- package/src/device/bot.ts +8 -15
- package/src/device/colorbulb.ts +8 -36
- package/src/device/contact.ts +4 -12
- package/src/device/curtain.ts +7 -22
- 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 +5 -5
|
@@ -120,15 +120,12 @@ export class VacuumCleaner {
|
|
|
120
120
|
this.updateHomeKitCharacteristics();
|
|
121
121
|
} catch (e: any) {
|
|
122
122
|
this.errorLog(`Vacuum Cleaner: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection`);
|
|
123
|
-
if (this.deviceLogging
|
|
123
|
+
if (this.deviceLogging.includes('debug')) {
|
|
124
124
|
this.errorLog(
|
|
125
125
|
`Vacuum Cleaner: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,` +
|
|
126
126
|
` Error Message: ${JSON.stringify(e.message)}`,
|
|
127
127
|
);
|
|
128
128
|
}
|
|
129
|
-
if (this.platform.debugMode) {
|
|
130
|
-
this.errorLog(`Vacuum Cleaner: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,` + ` Error: ${JSON.stringify(e)}`);
|
|
131
|
-
}
|
|
132
129
|
this.apiError(e);
|
|
133
130
|
}
|
|
134
131
|
}
|
|
@@ -178,7 +175,7 @@ export class VacuumCleaner {
|
|
|
178
175
|
config['logging'] = device.logging;
|
|
179
176
|
}
|
|
180
177
|
if (Object.entries(config).length !== 0) {
|
|
181
|
-
this.
|
|
178
|
+
this.infoLog(`Vacuum Cleaner: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
182
179
|
}
|
|
183
180
|
}
|
|
184
181
|
|
|
@@ -230,6 +227,6 @@ export class VacuumCleaner {
|
|
|
230
227
|
}
|
|
231
228
|
|
|
232
229
|
enablingDeviceLogging(): boolean {
|
|
233
|
-
return this.deviceLogging
|
|
230
|
+
return this.deviceLogging.includes('debug') || this.deviceLogging === 'standard';
|
|
234
231
|
}
|
|
235
232
|
}
|
|
@@ -125,14 +125,11 @@ export class WaterHeater {
|
|
|
125
125
|
this.updateHomeKitCharacteristics();
|
|
126
126
|
} catch (e: any) {
|
|
127
127
|
this.errorLog(`Water Heater: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection`);
|
|
128
|
-
if (this.deviceLogging
|
|
128
|
+
if (this.deviceLogging.includes('debug')) {
|
|
129
129
|
this.errorLog(
|
|
130
130
|
`Water Heater: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,` + ` Error Message: ${JSON.stringify(e.message)}`,
|
|
131
131
|
);
|
|
132
132
|
}
|
|
133
|
-
if (this.platform.debugMode) {
|
|
134
|
-
this.errorLog(`Water Heater: ${this.accessory.displayName} failed pushChanges with OpenAPI Connection,` + ` Error: ${JSON.stringify(e)}`);
|
|
135
|
-
}
|
|
136
133
|
this.apiError(e);
|
|
137
134
|
}
|
|
138
135
|
}
|
|
@@ -182,7 +179,7 @@ export class WaterHeater {
|
|
|
182
179
|
config['logging'] = device.logging;
|
|
183
180
|
}
|
|
184
181
|
if (Object.entries(config).length !== 0) {
|
|
185
|
-
this.
|
|
182
|
+
this.infoLog(`Water Heater: ${this.accessory.displayName} Config: ${JSON.stringify(config)}`);
|
|
186
183
|
}
|
|
187
184
|
}
|
|
188
185
|
|
|
@@ -234,6 +231,6 @@ export class WaterHeater {
|
|
|
234
231
|
}
|
|
235
232
|
|
|
236
233
|
enablingDeviceLogging(): boolean {
|
|
237
|
-
return this.deviceLogging
|
|
234
|
+
return this.deviceLogging.includes('debug') || this.deviceLogging === 'standard';
|
|
238
235
|
}
|
|
239
236
|
}
|
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
|
}
|
|
@@ -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') {
|