Set pump driver to busy and set state to suspended when Pod has a fault event
This commit is contained in:
parent
1ba9244ecd
commit
84ce2d1790
|
@ -407,7 +407,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump
|
|||
|
||||
if (isServiceSet()) {
|
||||
|
||||
if (isBusy || !podStateManager.isSetupCompleted())
|
||||
if (isBusy || !podStateManager.isSetupCompleted() || podStateManager.hasFaultEvent())
|
||||
return true;
|
||||
|
||||
if (busyTimestamps.size() > 0) {
|
||||
|
|
|
@ -105,15 +105,16 @@ public class AapsPodStateManager extends PodStateManager {
|
|||
Double lastBolusAmount = getLastBolusAmount();
|
||||
|
||||
// Update other info: last bolus, units remaining, suspended
|
||||
boolean suspended = isSuspended() || !isSetupCompleted() || hasFaultEvent();
|
||||
if (Objects.equals(lastBolusStartTime, omnipodPumpStatus.lastBolusTime) //
|
||||
|| !Objects.equals(lastBolusAmount, omnipodPumpStatus.lastBolusAmount) //
|
||||
|| !isReservoirStatusUpToDate(omnipodPumpStatus, getReservoirLevel())
|
||||
|| isSuspended() != PumpStatusType.Suspended.equals(omnipodPumpStatus.pumpStatusType)) {
|
||||
|| suspended != PumpStatusType.Suspended.equals(omnipodPumpStatus.pumpStatusType)) {
|
||||
omnipodPumpStatus.lastBolusTime = lastBolusStartTime;
|
||||
omnipodPumpStatus.lastBolusAmount = lastBolusAmount;
|
||||
omnipodPumpStatus.reservoirRemainingUnits = getReservoirLevel() == null ? 75.0 : getReservoirLevel();
|
||||
boolean sendRefreshOverviewEvent = isSuspended() != PumpStatusType.Suspended.equals(omnipodPumpStatus.pumpStatusType);
|
||||
omnipodPumpStatus.pumpStatusType = isSuspended() ? PumpStatusType.Suspended : PumpStatusType.Running;
|
||||
boolean sendRefreshOverviewEvent = suspended != PumpStatusType.Suspended.equals(omnipodPumpStatus.pumpStatusType);
|
||||
omnipodPumpStatus.pumpStatusType = suspended ? PumpStatusType.Suspended : PumpStatusType.Running;
|
||||
|
||||
if (sendRefreshOverviewEvent) {
|
||||
sendEvent(new EventRefreshOverview("Omnipod Pump", false));
|
||||
|
|
Loading…
Reference in a new issue