From 7b88ec9e93018e17a84c5d8cd96060122e5bad83 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Tue, 5 Dec 2017 21:07:49 +0100 Subject: [PATCH] Device-Status: provide pseudo-levels or reservoir. --- .../androidaps/plugins/PumpCombo/ComboPlugin.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index d5256be7c1..951421dca0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -1042,8 +1042,11 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf try { JSONObject pumpJson = new JSONObject(); pumpJson.put("clock", DateUtil.toISOString(pump.lastSuccessfulCmdTime)); - // TODO can we upload empty/low/normal or is a int expected? If so, use fake numbers like 0/50/200 -// pumpJson.put("reservoir", pump.reservoirState); + + int level = 250; + if (pump.state.insulinState == PumpState.LOW) level = 50; + if (pump.state.insulinState == PumpState.EMPTY) level = 0; + pumpJson.put("reservoir", level); JSONObject statusJson = new JSONObject(); statusJson.put("status", getStateSummary());