From a0d7c8b77b4a6488d40c32001923a126f21ed82f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Wed, 16 Oct 2024 22:54:40 +0100 Subject: [PATCH] Huawei: Fix battery notifications --- .../devices/huawei/requests/GetBatteryLevelRequest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/requests/GetBatteryLevelRequest.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/requests/GetBatteryLevelRequest.java index 1d4915e08..8136803e8 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/requests/GetBatteryLevelRequest.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huawei/requests/GetBatteryLevelRequest.java @@ -25,10 +25,10 @@ import java.util.List; import nodomain.freeyourgadget.gadgetbridge.GBApplication; import nodomain.freeyourgadget.gadgetbridge.R; -import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst; import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.HuaweiPacket; import nodomain.freeyourgadget.gadgetbridge.devices.huawei.packets.DeviceConfig; +import nodomain.freeyourgadget.gadgetbridge.model.BatteryState; import nodomain.freeyourgadget.gadgetbridge.service.devices.huawei.HuaweiSupportProvider; import nodomain.freeyourgadget.gadgetbridge.util.GB; @@ -61,6 +61,7 @@ public class GetBatteryLevelRequest extends Request { getDevice().setBatteryLevel(batteryLevel); GBDeviceEventBatteryInfo batteryInfo = new GBDeviceEventBatteryInfo(); + batteryInfo.state = BatteryState.BATTERY_NORMAL; batteryInfo.level = (int)batteryLevel & 0xff; this.supportProvider.evaluateGBDeviceEvent(batteryInfo);