mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-08-19 22:00:53 +02: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:
parent
92ce748202
commit
47b9e94858
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user