mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-25 11:26:47 +01:00
Bangle.js: handle battery charging status
This commit is contained in:
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);
|
||||
|
Loading…
Reference in New Issue
Block a user