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 (isServiceSet()) {
|
||||||
|
|
||||||
if (isBusy || !podStateManager.isSetupCompleted())
|
if (isBusy || !podStateManager.isSetupCompleted() || podStateManager.hasFaultEvent())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (busyTimestamps.size() > 0) {
|
if (busyTimestamps.size() > 0) {
|
||||||
|
|
|
@ -105,15 +105,16 @@ public class AapsPodStateManager extends PodStateManager {
|
||||||
Double lastBolusAmount = getLastBolusAmount();
|
Double lastBolusAmount = getLastBolusAmount();
|
||||||
|
|
||||||
// Update other info: last bolus, units remaining, suspended
|
// Update other info: last bolus, units remaining, suspended
|
||||||
|
boolean suspended = isSuspended() || !isSetupCompleted() || hasFaultEvent();
|
||||||
if (Objects.equals(lastBolusStartTime, omnipodPumpStatus.lastBolusTime) //
|
if (Objects.equals(lastBolusStartTime, omnipodPumpStatus.lastBolusTime) //
|
||||||
|| !Objects.equals(lastBolusAmount, omnipodPumpStatus.lastBolusAmount) //
|
|| !Objects.equals(lastBolusAmount, omnipodPumpStatus.lastBolusAmount) //
|
||||||
|| !isReservoirStatusUpToDate(omnipodPumpStatus, getReservoirLevel())
|
|| !isReservoirStatusUpToDate(omnipodPumpStatus, getReservoirLevel())
|
||||||
|| isSuspended() != PumpStatusType.Suspended.equals(omnipodPumpStatus.pumpStatusType)) {
|
|| suspended != PumpStatusType.Suspended.equals(omnipodPumpStatus.pumpStatusType)) {
|
||||||
omnipodPumpStatus.lastBolusTime = lastBolusStartTime;
|
omnipodPumpStatus.lastBolusTime = lastBolusStartTime;
|
||||||
omnipodPumpStatus.lastBolusAmount = lastBolusAmount;
|
omnipodPumpStatus.lastBolusAmount = lastBolusAmount;
|
||||||
omnipodPumpStatus.reservoirRemainingUnits = getReservoirLevel() == null ? 75.0 : getReservoirLevel();
|
omnipodPumpStatus.reservoirRemainingUnits = getReservoirLevel() == null ? 75.0 : getReservoirLevel();
|
||||||
boolean sendRefreshOverviewEvent = isSuspended() != PumpStatusType.Suspended.equals(omnipodPumpStatus.pumpStatusType);
|
boolean sendRefreshOverviewEvent = suspended != PumpStatusType.Suspended.equals(omnipodPumpStatus.pumpStatusType);
|
||||||
omnipodPumpStatus.pumpStatusType = isSuspended() ? PumpStatusType.Suspended : PumpStatusType.Running;
|
omnipodPumpStatus.pumpStatusType = suspended ? PumpStatusType.Suspended : PumpStatusType.Running;
|
||||||
|
|
||||||
if (sendRefreshOverviewEvent) {
|
if (sendRefreshOverviewEvent) {
|
||||||
sendEvent(new EventRefreshOverview("Omnipod Pump", false));
|
sendEvent(new EventRefreshOverview("Omnipod Pump", false));
|
||||||
|
|
Loading…
Reference in a new issue