1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 04:46:51 +01:00

Garmin: Allow HRV summary status to be null

We may have the averages, but not the status.
This commit is contained in:
José Rebelo 2024-08-02 22:51:00 +01:00
parent b33ab0b1c8
commit b616cc8ff1

View File

@ -190,10 +190,6 @@ public class FitImporter {
timesInZone.add((FitTimeInZone) record);
} else if (record instanceof FitHrvSummary) {
final FitHrvSummary hrvSummary = (FitHrvSummary) record;
final FieldDefinitionHrvStatus.HrvStatus status = hrvSummary.getStatus();
if (status == null) {
continue;
}
LOG.trace("HRV summary at {}: {}", ts, record);
final GarminHrvSummarySample sample = new GarminHrvSummarySample( );
sample.setTimestamp(ts * 1000L);
@ -203,7 +199,10 @@ public class FitImporter {
sample.setBaselineLowUpper(hrvSummary.getBaselineLowUpper());
sample.setBaselineBalancedLower(hrvSummary.getBaselineBalancedLower());
sample.setBaselineBalancedUpper(hrvSummary.getBaselineBalancedUpper());
sample.setStatusNum(status.getId());
final FieldDefinitionHrvStatus.HrvStatus status = hrvSummary.getStatus();
if (status != null) {
sample.setStatusNum(status.getId());
}
hrvSummarySamples.add(sample);
} else if (record instanceof FitHrvValue) {
final FitHrvValue hrvValue = (FitHrvValue) record;