1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-29 13:26:50 +01:00

exclude not worn sleep times also from sleep sessions

This ensures that the sleep sessions times and the charts times are now
equal (correct behavior). At the same time this causes the sleep
sessions to be visually broken up into more small pieces and therefore
it now more highlights the issue of the band (mostly) wrongly marking
some samples as not worn.
This commit is contained in:
vanous 2021-09-17 17:58:40 +02:00
parent 92ce748202
commit 47b9e94858

View File

@ -45,6 +45,14 @@ public class SleepAnalysis {
sleepEnd = getDateFromSample(sample);
durationSinceLastSleep = 0;
} else {
//exclude "not worn" times from sleep sessions as this makes a discrepancy with the charts
if (lightSleepDuration + deepSleepDuration > MIN_SESSION_LENGTH)
result.add(new SleepSession(sleepStart, sleepEnd, lightSleepDuration, deepSleepDuration));
sleepStart = null;
sleepEnd = null;
lightSleepDuration = 0;
deepSleepDuration = 0;
}
if (previousSample != null) {