Match PDM beep type for cancel delivery, log status response after cancelling delivery
This commit is contained in:
parent
64310f4e28
commit
06e72b89a0
|
@ -241,7 +241,12 @@ public class OmnipodManager {
|
|||
logStartingCommandExecution("cancelDelivery [deliveryTypes=" + deliveryTypes + ", acknowledgementBeep=" + acknowledgementBeep + "]");
|
||||
|
||||
try {
|
||||
executeAndVerify(() -> communicationService.executeAction(new CancelDeliveryAction(podState, deliveryTypes, acknowledgementBeep)));
|
||||
executeAndVerify(() -> {
|
||||
StatusResponse statusResponse = communicationService.executeAction(new CancelDeliveryAction(podState, deliveryTypes, acknowledgementBeep));
|
||||
if (isLoggingEnabled()) {
|
||||
LOG.info("Status response after cancel delivery[types={}]: {}", deliveryTypes.toString(), statusResponse.toString());
|
||||
}
|
||||
});
|
||||
} finally {
|
||||
logCommandExecutionFinished("cancelDelivery");
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public class CancelDeliveryAction implements OmnipodAction<StatusResponse> {
|
|||
List<MessageBlock> messageBlocks = new ArrayList<>();
|
||||
|
||||
messageBlocks.add(new CancelDeliveryCommand(podState.getCurrentNonce(),
|
||||
acknowledgementBeep && deliveryTypes.size() == 1 ? BeepType.BIP_BIP : BeepType.NO_BEEP, deliveryTypes));
|
||||
acknowledgementBeep && deliveryTypes.size() == 1 ? BeepType.BEEEEEEP : BeepType.NO_BEEP, deliveryTypes));
|
||||
|
||||
if (acknowledgementBeep && deliveryTypes.size() > 1) {
|
||||
// Workaround for strange beep behaviour when cancelling multiple delivery types at the same time
|
||||
|
@ -49,7 +49,7 @@ public class CancelDeliveryAction implements OmnipodAction<StatusResponse> {
|
|||
// we should keep the beep config for delivery types that we're not cancelling.
|
||||
// We currently have no use case that though,
|
||||
// as we either cancel 1 type or all types,
|
||||
messageBlocks.add(new BeepConfigCommand(BeepConfigType.BIP_BIP));
|
||||
messageBlocks.add(new BeepConfigCommand(BeepConfigType.BEEEEEEP));
|
||||
}
|
||||
|
||||
return communicationService.exchangeMessages(StatusResponse.class, podState,
|
||||
|
|
Loading…
Reference in a new issue