@switchbot/homebridge-switchbot 2.8.2-beta.2 → 2.9.0-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 +19 -0
- package/config.schema.json +37 -1
- package/dist/device/blindtilt.d.ts.map +1 -1
- package/dist/device/blindtilt.js +13 -0
- package/dist/device/blindtilt.js.map +1 -1
- package/dist/device/bot.d.ts +2 -0
- package/dist/device/bot.d.ts.map +1 -1
- package/dist/device/bot.js +52 -39
- package/dist/device/bot.js.map +1 -1
- package/dist/device/curtain.d.ts +2 -2
- package/dist/device/curtain.d.ts.map +1 -1
- package/dist/device/curtain.js +17 -4
- package/dist/device/curtain.js.map +1 -1
- package/dist/device/iosensor.d.ts.map +1 -1
- package/dist/device/iosensor.js +13 -0
- package/dist/device/iosensor.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 +13 -0
- package/dist/device/meter.js.map +1 -1
- package/dist/device/meterplus.d.ts.map +1 -1
- package/dist/device/meterplus.js +13 -0
- package/dist/device/meterplus.js.map +1 -1
- package/dist/device/motion.js +6 -5
- package/dist/device/motion.js.map +1 -1
- package/dist/irdevice/other.d.ts +24 -2
- package/dist/irdevice/other.d.ts.map +1 -1
- package/dist/irdevice/other.js +572 -38
- package/dist/irdevice/other.js.map +1 -1
- package/package.json +6 -6
- package/src/device/blindtilt.ts +13 -0
- package/src/device/bot.ts +53 -39
- package/src/device/curtain.ts +19 -6
- package/src/device/iosensor.ts +13 -0
- package/src/device/lock.ts +2 -1
- package/src/device/meter.ts +13 -0
- package/src/device/meterplus.ts +13 -0
- package/src/device/motion.ts +7 -7
- package/src/irdevice/other.ts +605 -39
package/src/device/meterplus.ts
CHANGED
|
@@ -241,6 +241,19 @@ export class MeterPlus {
|
|
|
241
241
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} Temperature: ${this.CurrentTemperature}°c`);
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
+
// Battery
|
|
245
|
+
this.BatteryLevel = Number(this.OpenAPI_BatteryLevel);
|
|
246
|
+
if (this.BatteryLevel < 10) {
|
|
247
|
+
this.StatusLowBattery = this.platform.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW;
|
|
248
|
+
} else {
|
|
249
|
+
this.StatusLowBattery = this.platform.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
|
|
250
|
+
}
|
|
251
|
+
if (Number.isNaN(this.BatteryLevel)) {
|
|
252
|
+
this.BatteryLevel = 100;
|
|
253
|
+
}
|
|
254
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel},`
|
|
255
|
+
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
256
|
+
|
|
244
257
|
// FirmwareRevision
|
|
245
258
|
this.FirmwareRevision = JSON.stringify(this.OpenAPI_FirmwareRevision);
|
|
246
259
|
}
|
package/src/device/motion.ts
CHANGED
|
@@ -214,19 +214,19 @@ export class Motion {
|
|
|
214
214
|
}
|
|
215
215
|
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} CurrentAmbientLightLevel: ${this.CurrentAmbientLightLevel}`);
|
|
216
216
|
}
|
|
217
|
+
|
|
217
218
|
// Battery
|
|
218
|
-
|
|
219
|
-
this.OpenAPI_BatteryLevel = 100;
|
|
220
|
-
}
|
|
221
|
-
this.BatteryLevel = this.OpenAPI_BatteryLevel!;
|
|
219
|
+
this.BatteryLevel = Number(this.OpenAPI_BatteryLevel);
|
|
222
220
|
if (this.BatteryLevel < 10) {
|
|
223
221
|
this.StatusLowBattery = this.platform.Characteristic.StatusLowBattery.BATTERY_LEVEL_LOW;
|
|
224
222
|
} else {
|
|
225
223
|
this.StatusLowBattery = this.platform.Characteristic.StatusLowBattery.BATTERY_LEVEL_NORMAL;
|
|
226
224
|
}
|
|
227
|
-
this.
|
|
228
|
-
|
|
229
|
-
|
|
225
|
+
if (Number.isNaN(this.BatteryLevel)) {
|
|
226
|
+
this.BatteryLevel = 100;
|
|
227
|
+
}
|
|
228
|
+
this.debugLog(`${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel},`
|
|
229
|
+
+ ` StatusLowBattery: ${this.StatusLowBattery}`);
|
|
230
230
|
|
|
231
231
|
// FirmwareRevision
|
|
232
232
|
this.FirmwareRevision = JSON.stringify(this.OpenAPI_FirmwareRevision);
|