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:
parent
cc8b54131d
commit
cd1f270ccf
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user