From cbd6fe2145da13b421f8e88b66fe3e4d9a6c4d95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Sat, 5 Oct 2024 17:32:24 +0100 Subject: [PATCH] Huawei: Use watch distance and calories Thanks to Martin.JM for the patch --- .../gadgetbridge/daogen/GBDaoGenerator.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java b/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java index 8360400ce..d09b20f1d 100644 --- a/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java +++ b/GBDaoGenerator/src/nodomain/freeyourgadget/gadgetbridge/daogen/GBDaoGenerator.java @@ -1272,8 +1272,18 @@ public class GBDaoGenerator { activitySample.addIntProperty(SAMPLE_RAW_KIND).notNull().codeBeforeGetterAndSetter(OVERRIDE); activitySample.addIntProperty(SAMPLE_RAW_INTENSITY).notNull().codeBeforeGetterAndSetter(OVERRIDE); activitySample.addIntProperty(SAMPLE_STEPS).notNull().codeBeforeGetterAndSetter(OVERRIDE); - activitySample.addIntProperty("calories").notNull(); - activitySample.addIntProperty("distance").notNull(); + activitySample.addIntProperty("calories").notNull().codeBeforeGetter( + "@Override\n" + + " public int getActiveCalories() {\n" + + " return getCalories();\n" + + " }\n" + ); + activitySample.addIntProperty("distance").notNull().codeBeforeGetter( + "@Override\n" + + " public int getDistanceCm() {\n" + + " return getDistance() * 100;\n" + + " }\n" + ); activitySample.addIntProperty("spo").notNull(); activitySample.addIntProperty("heartRate").notNull(); return activitySample;