1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-27 12:26:48 +01:00

Xiaomi-protobuf: Fix some workout type recognition

This commit is contained in:
José Rebelo 2024-10-16 23:40:13 +01:00
parent e436946bed
commit e6dc262a4d
2 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -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());