@switchbot/homebridge-switchbot 1.5.1-beta.5 → 1.6.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 +15 -2
- package/dist/devices/bots.d.ts +2 -0
- package/dist/devices/bots.d.ts.map +1 -1
- package/dist/devices/bots.js +28 -9
- package/dist/devices/bots.js.map +1 -1
- package/dist/devices/colorbulb.d.ts +3 -1
- package/dist/devices/colorbulb.d.ts.map +1 -1
- package/dist/devices/colorbulb.js +31 -8
- package/dist/devices/colorbulb.js.map +1 -1
- package/dist/devices/motion.d.ts.map +1 -1
- package/dist/devices/motion.js +20 -4
- package/dist/devices/motion.js.map +1 -1
- package/dist/platform.d.ts.map +1 -1
- package/dist/platform.js +0 -5
- package/dist/platform.js.map +1 -1
- package/package.json +71 -69
- package/src/devices/bots.ts +30 -9
- package/src/devices/colorbulb.ts +36 -9
- package/src/devices/motion.ts +19 -4
- package/src/platform.ts +0 -5
package/src/devices/motion.ts
CHANGED
|
@@ -194,10 +194,25 @@ export class Motion {
|
|
|
194
194
|
}
|
|
195
195
|
|
|
196
196
|
private async openAPIparseStatus() {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
try {
|
|
198
|
+
if (this.platform.config.credentials?.openToken) {
|
|
199
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} OpenAPI parseStatus`);
|
|
200
|
+
if (typeof this.deviceStatus.body.moveDetected === 'boolean') {
|
|
201
|
+
this.MotionDetected = this.deviceStatus.body.moveDetected;
|
|
202
|
+
}
|
|
203
|
+
this.debugLog(`Motion Sensor: ${this.accessory.displayName} MotionDetected: ${this.MotionDetected}`);
|
|
204
|
+
}
|
|
205
|
+
} catch (e: any) {
|
|
206
|
+
this.errorLog(`Motion Sensor: ${this.accessory.displayName} failed parseStatus with OpenAPI Connection`);
|
|
207
|
+
if (this.deviceLogging === 'debug') {
|
|
208
|
+
this.errorLog(`Motion Sensor: ${this.accessory.displayName} failed parseStatus with OpenAPI Connection,`
|
|
209
|
+
+ ` Error Message: ${JSON.stringify(e.message)}`);
|
|
210
|
+
}
|
|
211
|
+
if (this.platform.debugMode) {
|
|
212
|
+
this.errorLog(`Motion Sensor: ${this.accessory.displayName} failed parseStatus with OpenAPI Connection,`
|
|
213
|
+
+ ` Error: ${JSON.stringify(e)}`);
|
|
214
|
+
}
|
|
215
|
+
this.apiError(e);
|
|
201
216
|
}
|
|
202
217
|
}
|
|
203
218
|
|
package/src/platform.ts
CHANGED
|
@@ -144,11 +144,6 @@ export class SwitchBotPlatform implements DynamicPlatformPlugin {
|
|
|
144
144
|
if (!deviceConfig.configDeviceType && deviceConfig.ble) {
|
|
145
145
|
throw new Error('The devices config section is missing the *Device Type* in the config, Check Your Conifg.');
|
|
146
146
|
}
|
|
147
|
-
if (deviceConfig.bot) {
|
|
148
|
-
if (!deviceConfig.bot?.mode) {
|
|
149
|
-
this.errorLog('You must set your Bot to Press or Switch Mode');
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
147
|
}
|
|
153
148
|
}
|
|
154
149
|
}
|