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