Bangle.js: handle battery charging status

This commit is contained in:
Richard de Boer
2022-03-06 00:24:57 +01:00
committed by Gitea
parent f61008c9ae
commit cec28d2442
@@ -194,6 +194,9 @@ public class BangleJSDeviceSupport extends AbstractBTLEDeviceSupport {
batteryInfo.level = b;
batteryInfo.state = BatteryState.BATTERY_NORMAL;
}
if (json.has("chg") && json.getInt("chg") == 1) {
batteryInfo.state = BatteryState.BATTERY_CHARGING;
}
if (json.has("volt"))
batteryInfo.voltage = (float) json.getDouble("volt");
handleGBDeviceEvent(batteryInfo);