Ignore Pod fault when cancelling delivery before deactivating pod
This commit is contained in:
parent
06e72b89a0
commit
1c8c49e61e
1 changed files with 7 additions and 2 deletions
|
@ -8,6 +8,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.Sta
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryType;
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.DeliveryType;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState;
|
import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState;
|
||||||
import info.nightscout.androidaps.plugins.pump.omnipod.exception.ActionInitializationException;
|
import info.nightscout.androidaps.plugins.pump.omnipod.exception.ActionInitializationException;
|
||||||
|
import info.nightscout.androidaps.plugins.pump.omnipod.exception.PodFaultException;
|
||||||
|
|
||||||
public class DeactivatePodAction implements OmnipodAction<StatusResponse> {
|
public class DeactivatePodAction implements OmnipodAction<StatusResponse> {
|
||||||
private final PodSessionState podState;
|
private final PodSessionState podState;
|
||||||
|
@ -24,8 +25,12 @@ public class DeactivatePodAction implements OmnipodAction<StatusResponse> {
|
||||||
@Override
|
@Override
|
||||||
public StatusResponse execute(OmnipodCommunicationService communicationService) {
|
public StatusResponse execute(OmnipodCommunicationService communicationService) {
|
||||||
if (!podState.isSuspended() && !podState.hasFaultEvent()) {
|
if (!podState.isSuspended() && !podState.hasFaultEvent()) {
|
||||||
communicationService.executeAction(new CancelDeliveryAction(podState,
|
try {
|
||||||
EnumSet.allOf(DeliveryType.class), acknowledgementBeep));
|
communicationService.executeAction(new CancelDeliveryAction(podState,
|
||||||
|
EnumSet.allOf(DeliveryType.class), acknowledgementBeep));
|
||||||
|
} catch(PodFaultException ex) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return communicationService.sendCommand(StatusResponse.class, podState, new DeactivatePodCommand(podState.getCurrentNonce()));
|
return communicationService.sendCommand(StatusResponse.class, podState, new DeactivatePodCommand(podState.getCurrentNonce()));
|
||||||
|
|
Loading…
Reference in a new issue