Update basal schedule in PodState after setting basal schedule
This commit is contained in:
parent
adb26b3ccf
commit
1f5c8aca21
1 changed files with 4 additions and 1 deletions
|
@ -227,6 +227,7 @@ public class OmnipodManager {
|
||||||
try {
|
try {
|
||||||
executeAndVerify(() -> communicationService.executeAction(new SetBasalScheduleAction(podStateManager, schedule,
|
executeAndVerify(() -> communicationService.executeAction(new SetBasalScheduleAction(podStateManager, schedule,
|
||||||
false, podStateManager.getScheduleOffset(), acknowledgementBeep)));
|
false, podStateManager.getScheduleOffset(), acknowledgementBeep)));
|
||||||
|
podStateManager.setBasalSchedule(schedule);
|
||||||
} catch (OmnipodException ex) {
|
} catch (OmnipodException ex) {
|
||||||
if (ex.isCertainFailure()) {
|
if (ex.isCertainFailure()) {
|
||||||
if (!wasSuspended) {
|
if (!wasSuspended) {
|
||||||
|
@ -236,7 +237,9 @@ public class OmnipodManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
// verifyDeliveryStatus will throw an exception if verification fails
|
// verifyDeliveryStatus will throw an exception if verification fails
|
||||||
if (!verifyDeliveryStatus(DeliveryStatus.NORMAL, ex)) {
|
if (verifyDeliveryStatus(DeliveryStatus.NORMAL, ex)) {
|
||||||
|
podStateManager.setBasalSchedule(schedule);
|
||||||
|
} else {
|
||||||
if (!wasSuspended) {
|
if (!wasSuspended) {
|
||||||
throw new CommandFailedAfterChangingDeliveryStatusException("Suspending delivery succeeded but setting the new basal schedule did not", ex);
|
throw new CommandFailedAfterChangingDeliveryStatusException("Suspending delivery succeeded but setting the new basal schedule did not", ex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue