function getOxygenSaturationData() {
if (
Toybox has :SensorHistory &&
Toybox.SensorHistory has :getOxygenSaturationHistory
) {
var iterator = Toybox.SensorHistory.getOxygenSaturationHistory({
:period => 10,
});
var sample;
for (var i = 0; i < 10; i++) {
sample = iterator.next();
if (sample != null && sample.data != null) {
return sample.data.format("%2.1f");
}
}
} else {
return "N";
}
return "-";
}
Sometimes the data will be outdated. e.g.
System widget tells 93
This function is 95.
What is the problem? Any idea is welcome