Treat Pod Fault responses as successful communication

This commit is contained in:
Bart Sopers 2020-09-02 01:37:20 +02:00
parent 68ff228426
commit 9c29a0643e

View file

@ -158,7 +158,8 @@ public class OmnipodRileyLinkCommunicationManager extends RileyLinkCommunication
} else if (responseMessageBlock.getType() == MessageBlockType.POD_INFO_RESPONSE && ((PodInfoResponse) responseMessageBlock).getSubType() == PodInfoType.FAULT_EVENT) {
PodInfoFaultEvent faultEvent = (PodInfoFaultEvent) ((PodInfoResponse) responseMessageBlock).getPodInfo();
podStateManager.setFaultEvent(faultEvent);
podStateManager.setLastFailedCommunication(DateTime.now());
// Treat as successful communication as the user will get notified and can work with this response
podStateManager.setLastSuccessfulCommunication(DateTime.now());
throw new PodFaultException(faultEvent);
} else {
podStateManager.setLastFailedCommunication(DateTime.now());