Only update pumpState cache if menu could be read.
This commit is contained in:
parent
86eb33403d
commit
3cccf287da
1 changed files with 5 additions and 1 deletions
|
@ -315,12 +315,16 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
if (result.reservoirLevel != PumpState.UNKNOWN) {
|
if (result.reservoirLevel != PumpState.UNKNOWN) {
|
||||||
pump.reservoirLevel = result.reservoirLevel;
|
pump.reservoirLevel = result.reservoirLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.lastBolus != null) {
|
if (result.lastBolus != null) {
|
||||||
pump.lastBolus = result.lastBolus;
|
pump.lastBolus = result.lastBolus;
|
||||||
} else if (result.history != null && !result.history.bolusHistory.isEmpty()) {
|
} else if (result.history != null && !result.history.bolusHistory.isEmpty()) {
|
||||||
pump.lastBolus = result.history.bolusHistory.get(0);
|
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());
|
MainApp.bus().post(new EventComboPumpUpdateGUI());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue