Xiaomi: Parse more fields in freestyle activity parser for v8/9/10

Specifically: workout type, configured time/calories goal, workout load and vitality gain.
This commit is contained in:
Sebastian Dröge 2024-12-13 13:52:30 +02:00 committed by José Rebelo
parent 600629e7ed
commit e249236873

View File

@ -289,16 +289,23 @@ public class WorkoutSummaryParser extends XiaomiActivityParser implements Activi
builder.addInt(HR_ZONE_WARM_UP, UNIT_SECONDS); builder.addInt(HR_ZONE_WARM_UP, UNIT_SECONDS);
if (version == 5) { if (version == 5) {
builder.addUnknown(10); builder.addUnknown(10);
builder.addShort(XIAOMI_WORKOUT_TYPE, UNIT_NONE); builder.addShort(XIAOMI_WORKOUT_TYPE, XIAOMI_WORKOUT_TYPE);
builder.addUnknown(2); builder.addUnknown(2);
builder.addUnknown(2); // configuredTimeGoal, UNIT_SECONDS builder.addUnknown(2); // configuredTimeGoal, UNIT_SECONDS
builder.addUnknown(2); builder.addUnknown(2);
builder.addUnknown(2); // configuredCaloriesGoal, UNIT_KCAL builder.addUnknown(2); // configuredCaloriesGoal, UNIT_KCAL
} else { } else {
builder.addUnknown(2); builder.addUnknown(2);
builder.addUnknown(4); builder.addUnknown(4); // activeSeconds again?, UNIT_SECONDS
builder.addFloat(TRAINING_EFFECT_ANAEROBIC, UNIT_NONE); builder.addFloat(TRAINING_EFFECT_ANAEROBIC, UNIT_NONE);
builder.addUnknown(3); builder.addUnknown(1);
builder.addShort(XIAOMI_WORKOUT_TYPE, XIAOMI_WORKOUT_TYPE);
builder.addUnknown(2);
builder.addInt("configuredTimeGoal", UNIT_SECONDS);
builder.addShort("configuredCaloriesGoal", UNIT_KCAL);
builder.addShort(WORKOUT_LOAD, UNIT_NONE);
builder.addUnknown(1);
builder.addByte("vitality_gain", UNIT_NONE);
} }
return builder.build(); return builder.build();
} }