mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-29 05:16:51 +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.level = b;
|
||||||
batteryInfo.state = BatteryState.BATTERY_NORMAL;
|
batteryInfo.state = BatteryState.BATTERY_NORMAL;
|
||||||
}
|
}
|
||||||
|
if (json.has("chg") && json.getInt("chg") == 1) {
|
||||||
|
batteryInfo.state = BatteryState.BATTERY_CHARGING;
|
||||||
|
}
|
||||||
if (json.has("volt"))
|
if (json.has("volt"))
|
||||||
batteryInfo.voltage = (float) json.getDouble("volt");
|
batteryInfo.voltage = (float) json.getDouble("volt");
|
||||||
handleGBDeviceEvent(batteryInfo);
|
handleGBDeviceEvent(batteryInfo);
|
||||||
|
Loading…
Reference in New Issue
Block a user