mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-06-05 21:49:48 +02:00
Bangle.js: handle battery charging status
This commit is contained in:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user