mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-25 08:05:55 +01:00
Huami: Display unknown raw activity kind in the activity summary
This commit is contained in:
parent
e86912e681
commit
b8b8b5f681
@ -64,12 +64,13 @@ public class HuamiActivitySummaryParser implements ActivitySummaryParser {
|
||||
short version = buffer.getShort(); // version
|
||||
LOG.debug("Got sport summary version " + version + " total bytes=" + buffer.capacity());
|
||||
int activityKind = ActivityKind.TYPE_UNKNOWN;
|
||||
int rawKind = BLETypeConversions.toUnsigned(buffer.getShort());
|
||||
try {
|
||||
int rawKind = BLETypeConversions.toUnsigned(buffer.getShort());
|
||||
HuamiSportsActivityType activityType = HuamiSportsActivityType.fromCode(rawKind);
|
||||
activityKind = activityType.toActivityKind();
|
||||
} catch (Exception ex) {
|
||||
LOG.error("Error mapping activity kind: " + ex.getMessage(), ex);
|
||||
addSummaryData("Raw Activity Kind", rawKind, UNIT_NONE);
|
||||
}
|
||||
summary.setActivityKind(activityKind);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user