@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.
Files changed (41) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/config.schema.json +37 -1
  3. package/dist/device/blindtilt.d.ts.map +1 -1
  4. package/dist/device/blindtilt.js +13 -0
  5. package/dist/device/blindtilt.js.map +1 -1
  6. package/dist/device/bot.d.ts +2 -0
  7. package/dist/device/bot.d.ts.map +1 -1
  8. package/dist/device/bot.js +52 -39
  9. package/dist/device/bot.js.map +1 -1
  10. package/dist/device/curtain.d.ts +2 -2
  11. package/dist/device/curtain.d.ts.map +1 -1
  12. package/dist/device/curtain.js +17 -4
  13. package/dist/device/curtain.js.map +1 -1
  14. package/dist/device/iosensor.d.ts.map +1 -1
  15. package/dist/device/iosensor.js +13 -0
  16. package/dist/device/iosensor.js.map +1 -1
  17. package/dist/device/lock.d.ts.map +1 -1
  18. package/dist/device/lock.js +2 -1
  19. package/dist/device/lock.js.map +1 -1
  20. package/dist/device/meter.d.ts.map +1 -1
  21. package/dist/device/meter.js +13 -0
  22. package/dist/device/meter.js.map +1 -1
  23. package/dist/device/meterplus.d.ts.map +1 -1
  24. package/dist/device/meterplus.js +13 -0
  25. package/dist/device/meterplus.js.map +1 -1
  26. package/dist/device/motion.js +6 -5
  27. package/dist/device/motion.js.map +1 -1
  28. package/dist/irdevice/other.d.ts +24 -2
  29. package/dist/irdevice/other.d.ts.map +1 -1
  30. package/dist/irdevice/other.js +572 -38
  31. package/dist/irdevice/other.js.map +1 -1
  32. package/package.json +6 -6
  33. package/src/device/blindtilt.ts +13 -0
  34. package/src/device/bot.ts +53 -39
  35. package/src/device/curtain.ts +19 -6
  36. package/src/device/iosensor.ts +13 -0
  37. package/src/device/lock.ts +2 -1
  38. package/src/device/meter.ts +13 -0
  39. package/src/device/meterplus.ts +13 -0
  40. package/src/device/motion.ts +7 -7
  41. package/src/irdevice/other.ts +605 -39
@@ -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
  }
@@ -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
- if (this.OpenAPI_BatteryLevel === undefined) {
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.debugLog(
228
- `${this.device.deviceType}: ${this.accessory.displayName} BatteryLevel: ${this.BatteryLevel},` + ` StatusLowBattery: ${this.StatusLowBattery}`,
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);