Update fake reservoir numbers to trigger default NS warnings.

(cherry picked from commit 6e5f9fc)
This commit is contained in:
Johannes Mockenhaupt 2017-12-16 12:09:35 +01:00
parent 92d0630c55
commit fd71ab6b68
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -991,9 +991,9 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
JSONObject pumpJson = new JSONObject(); JSONObject pumpJson = new JSONObject();
pumpJson.put("clock", DateUtil.toISOString(pump.lastSuccessfulCmdTime)); pumpJson.put("clock", DateUtil.toISOString(pump.lastSuccessfulCmdTime));
int level = 250; int level = 150;
if (pump.state.insulinState == PumpState.LOW) level = 50; if (pump.state.insulinState == PumpState.LOW) level = 8;
if (pump.state.insulinState == PumpState.EMPTY) level = 0; else if (pump.state.insulinState == PumpState.EMPTY) level = 0;
pumpJson.put("reservoir", level); pumpJson.put("reservoir", level);
JSONObject statusJson = new JSONObject(); JSONObject statusJson = new JSONObject();
@ -1016,18 +1016,9 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
pumpJson.put("extended", extendedJson); pumpJson.put("extended", extendedJson);
JSONObject batteryJson = new JSONObject(); JSONObject batteryJson = new JSONObject();
int battery; int battery = 100;
switch (ps.batteryState) { if (ps.batteryState == PumpState.LOW) battery = 25;
case PumpState.EMPTY: else if (ps.batteryState == PumpState.EMPTY) battery = 0;
battery = 0;
break;
case PumpState.LOW:
battery = 25;
break;
default:
battery = 100;
break;
}
batteryJson.put("percent", battery); batteryJson.put("percent", battery);
pumpJson.put("battery", batteryJson); pumpJson.put("battery", batteryJson);