From 18d15844590266669ff4682127016fbafa97eec9 Mon Sep 17 00:00:00 2001 From: Bart Sopers Date: Sat, 19 Dec 2020 21:09:11 +0100 Subject: [PATCH] Prepare for displaying '50+' as Omnipod reservoir level in NightScout --- .../plugins/pump/omnipod/OmnipodPumpPlugin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index fcaea154b0..13e4e874fc 100644 --- a/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/omnipod/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -747,14 +747,15 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface, pump.put("status", status); pump.put("extended", extended); - // If the reservoir level is over 50 units, we don't know the actual value, - // so only include the reservoir level if it's under 50 units double reservoirLevel = getReservoirLevel(); - if (reservoirLevel <= OmnipodConstants.MAX_RESERVOIR_READING) { + if (reservoirLevel > OmnipodConstants.MAX_RESERVOIR_READING) { + pump.put("reservoir_display_override", "50+"); + pump.put("reservoir", OmnipodConstants.MAX_RESERVOIR_READING); + } else { pump.put("reservoir", reservoirLevel); } - pump.put("clock", DateUtil.toISOString(new Date())); + pump.put("clock", DateUtil.toISOString(podStateManager.getTime().toDate())); } catch (JSONException e) { aapsLogger.error(LTag.PUMP, "Unhandled exception", e); }