1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-06-06 13:17:59 +02:00

Xiaomi: Fix sleep samples when sleep stages are not found

We can at least show light sleep now.
This commit is contained in:
José Rebelo 2024-02-25 22:53:15 +00:00
parent dd952e335f
commit ab41adbc7f

View File

@ -220,6 +220,11 @@ public class SleepDetailsParser extends XiaomiActivityParser {
stagesParseFailed = true;
}
if (summaries.isEmpty()) {
// We did not manage to find sleep stage samples - ensure we at least persist the base one
summaries.add(sample);
}
// save all the samples that we got
try (DBHandler handler = GBApplication.acquireDB()) {
final DaoSession session = handler.getDaoSession();