From 3cccf287da36b541cbdc61947f4b785a9cc16f65 Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Mon, 20 Nov 2017 21:36:25 +0100 Subject: [PATCH] Only update pumpState cache if menu could be read. --- .../androidaps/plugins/PumpCombo/ComboPlugin.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 0bf7d7450e..06d5c7afe4 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 @@ -315,12 +315,16 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf if (result.reservoirLevel != PumpState.UNKNOWN) { pump.reservoirLevel = result.reservoirLevel; } + if (result.lastBolus != null) { pump.lastBolus = result.lastBolus; } else if (result.history != null && !result.history.bolusHistory.isEmpty()) { pump.lastBolus = result.history.bolusHistory.get(0); } - pump.state = result.state; + + if (result.state.menu != null) { + pump.state = result.state; + } MainApp.bus().post(new EventComboPumpUpdateGUI()); }