Only update pumpState cache if menu could be read.
This commit is contained in:
parent
86eb33403d
commit
3cccf287da
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue