diff --git a/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java b/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java index 66af8f3ae..18cb1641c 100644 --- a/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java +++ b/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java @@ -1363,7 +1363,7 @@ public class GBDaoGenerator { activitySample.addIntProperty("calories").notNull().codeBeforeGetter( "@Override\n" + " public int getActiveCalories() {\n" + - " return getCalories();\n" + + " return getCalories() == HuaweiActivitySample.NOT_MEASURED ? HuaweiActivitySample.NOT_MEASURED : Math.round(getCalories() / 1000f);\n" + " }\n" ); activitySample.addIntProperty("distance").notNull().codeBeforeGetter( diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiBRCoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiBRCoordinator.java index 6a49b498c..447e9a1b2 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiBRCoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiBRCoordinator.java @@ -163,6 +163,11 @@ public abstract class HuaweiBRCoordinator extends AbstractBLClassicDeviceCoordin return true; } + @Override + public boolean supportsActiveCalories() { + return true; + } + @Override public boolean supportsActivityTracking() { return true; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiLECoordinator.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiLECoordinator.java index a9b7ad201..13d06cc23 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiLECoordinator.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/devices/huawei/HuaweiLECoordinator.java @@ -172,6 +172,11 @@ public abstract class HuaweiLECoordinator extends AbstractBLEDeviceCoordinator i return true; } + @Override + public boolean supportsActiveCalories() { + return true; + } + @Override public boolean supportsActivityTracking() { return true;