Huawei: Add calories support

These devices provide calories instead of kcal, which are rounded
per-sample, resulting in a slight difference from what is shown on the
device itself.
This commit is contained in:
Martin.JM
2024-12-15 21:08:49 +01:00
parent b31832a72e
commit d807909b25
3 changed files with 11 additions and 1 deletions
@@ -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(