mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2026-07-31 07:44:24 +02:00
Xiaomi: Map sleep stage 5 (awake) to AWAKE_SLEEP
getActivityKindForSample was written before AWAKE_SLEEP existed in ActivityKind (April 2024 vs August 2024), so decoded stage 5 (awake during sleep) fell through to UNKNOWN. This caused the sleep overlay to skip awake periods, which may fragment sleep sessions in SleepAnalysis and result in missing or truncated Health Connect sleep records. See: https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/5920
This commit is contained in:
+2
-2
@@ -113,8 +113,8 @@ public class XiaomiSampleProvider extends AbstractSampleProvider<XiaomiActivityS
|
||||
case 2 -> ActivityKind.DEEP_SLEEP;
|
||||
case 3 -> ActivityKind.LIGHT_SLEEP;
|
||||
case 4 -> ActivityKind.REM_SLEEP;
|
||||
default -> // default to awake
|
||||
ActivityKind.UNKNOWN;
|
||||
case 5 -> ActivityKind.AWAKE_SLEEP;
|
||||
default -> ActivityKind.UNKNOWN;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user