1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-09 03:37:03 +01:00

Xiaomi: add support for daily details version 4

This commit is contained in:
MrYoranimo 2024-09-15 13:13:32 +02:00
parent cc8b54131d
commit cd1f270ccf
2 changed files with 14 additions and 0 deletions

View File

@ -182,6 +182,9 @@ public class XiaomiSampleProvider extends AbstractSampleProvider<XiaomiActivityS
if (!stagesMap.isEmpty()) {
LOG.debug("Found {} sleep samples between {} and {}", stagesMap.size(), timestamp_from, timestamp_to);
// FIXME if no samples were retrieved from the database that were generated by other
// activity files, the stages will not get overlayed/inserted and the sleep charts
// will stay empty.
for (final XiaomiActivitySample sample : samples) {
final long ts = sample.getTimestamp() * 1000L;

View File

@ -57,6 +57,9 @@ public class DailyDetailsParser extends XiaomiActivityParser {
case 3:
headerSize = 5;
break;
case 4:
headerSize = 6;
break;
default:
LOG.warn("Unable to parse daily details version {}", fileId.getVersion());
return false;
@ -155,6 +158,14 @@ public class DailyDetailsParser extends XiaomiActivityParser {
}
}
if (version >= 4) {
// TODO: light value (short)
complexParser.nextGroup(16);
// TODO: body momentum (short)
complexParser.nextGroup(16);
}
samples.add(sample);
timestamp.add(Calendar.MINUTE, 1);