Fix prediction data sent to WearOS by properly reacalculating them into current app unit

This commit is contained in:
Dominik Dzienia 2020-06-17 15:53:46 +02:00
parent eabb75e20e
commit 7f62450d99

View file

@ -536,9 +536,10 @@ public class WatchUpdaterService extends WearableListenerService implements Goog
List<BgReading> predArray = finalLastRun.getConstraintsProcessed().getPredictions();
if (!predArray.isEmpty()) {
final String units = profileFunction.getUnits();
for (BgReading bg : predArray) {
if (bg.value < 40) continue;
predictions.add(predictionMap(bg.date, bg.value, bg.getPredectionColor()));
predictions.add(predictionMap(bg.date, bg.valueToUnits(units), bg.getPredectionColor()));
}
}
}