From e6dc262a4d64f0d408ba357c6b6929ee0f1a96b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Rebelo?= Date: Wed, 16 Oct 2024 23:40:13 +0100 Subject: [PATCH] Xiaomi-protobuf: Fix some workout type recognition --- .../freeyourgadget/gadgetbridge/model/ActivityKind.java | 2 ++ .../xiaomi/activity/impl/XiaomiSimpleActivityParser.java | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ActivityKind.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ActivityKind.java index 4909ee092..b964cec3d 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ActivityKind.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/model/ActivityKind.java @@ -293,6 +293,8 @@ public enum ActivityKind { BIATHLON(0x040000ee, R.string.activity_type_biathlon), BUNGEE_JUMPING(0x040000ef, R.string.activity_type_bungee_jumping), ORIENTEERING(0x040000f0, R.string.activity_type_orienteering), + TREKKING(0x040000f1, R.string.activity_type_trekking), + TRAIL_RUN(0x040000f2, R.string.activity_type_trail_run), ; private final int code; diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/XiaomiSimpleActivityParser.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/XiaomiSimpleActivityParser.java index b6b4a3f5f..b05be6468 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/XiaomiSimpleActivityParser.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/activity/impl/XiaomiSimpleActivityParser.java @@ -99,16 +99,15 @@ public class XiaomiSimpleActivityParser { summaryData.add(dataEntry.getKey(), swimStyleName); } else if (dataEntry.getKey().equals(XIAOMI_WORKOUT_TYPE)) { - // TODO use XiaomiWorkoutType switch (value.intValue()) { case 1: - summary.setActivityKind(ActivityKind.OUTDOOR_WALKING.getCode()); + summary.setActivityKind(ActivityKind.OUTDOOR_RUNNING.getCode()); break; case 2: - summary.setActivityKind(ActivityKind.WALKING.getCode()); + summary.setActivityKind(ActivityKind.OUTDOOR_WALKING.getCode()); break; case 6: - summary.setActivityKind(ActivityKind.CYCLING.getCode()); + summary.setActivityKind(ActivityKind.OUTDOOR_CYCLING.getCode()); break; default: summary.setActivityKind(ActivityKind.UNKNOWN.getCode());