diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java index a039185aa1..a3c6f8ced7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.java @@ -1479,8 +1479,14 @@ public class MedtronicPumpPlugin extends PumpPluginAbstract implements PumpInter LOG.info(getLogPrefix() + "Basal Profile was set: " + response); if (response) { + Notification notification = new Notification(Notification.PROFILE_SET_OK, MainApp.gs(R.string.profile_set_ok), Notification.INFO, 60); + RxBus.INSTANCE.send(new EventNewNotification(notification)); + return new PumpEnactResult().success(true).enacted(true); } else { + Notification notification = new Notification(Notification.FAILED_UDPATE_PROFILE, MainApp.gs(R.string.failedupdatebasalprofile), Notification.URGENT); + RxBus.INSTANCE.send(new EventNewNotification(notification)); + return new PumpEnactResult().success(response).enacted(response) // .comment(MainApp.gs(R.string.medtronic_cmd_basal_profile_could_not_be_set)); } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index 11b85f63e8..a6ace0c972 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -37,7 +37,9 @@ import info.nightscout.androidaps.plugins.bus.RxBus; import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction; import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType; +import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress; +import info.nightscout.androidaps.plugins.general.overview.notifications.Notification; import info.nightscout.androidaps.plugins.pump.common.PumpPluginAbstract; import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair; import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState; @@ -842,6 +844,12 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump if (result.success) { this.currentProfile = profile; + + Notification notification = new Notification(Notification.PROFILE_SET_OK, MainApp.gs(R.string.profile_set_ok), Notification.INFO, 60); + RxBus.INSTANCE.send(new EventNewNotification(notification)); + } else { + Notification notification = new Notification(Notification.FAILED_UDPATE_PROFILE, MainApp.gs(R.string.failedupdatebasalprofile), Notification.URGENT); + RxBus.INSTANCE.send(new EventNewNotification(notification)); } return result; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUIPostprocessor.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUIPostprocessor.java index 7b52920040..12c2e5d427 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUIPostprocessor.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/ui/OmnipodUIPostprocessor.java @@ -3,6 +3,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.driver.ui; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.util.Date; + +import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCustomActionType; @@ -32,6 +35,22 @@ public class OmnipodUIPostprocessor { switch (uiTask.commandType) { + case SetBolus: { + if (uiTask.returnData!=null) { + + PumpEnactResult result = uiTask.returnData; + + if (result.success) { + boolean isSmb = uiTask.getBooleanFromParameters(1); + + if (!isSmb) { + pumpStatus.lastBolusAmount = uiTask.getDoubleFromParameters(0); + pumpStatus.lastBolusTime = new Date(); + } + } + } + } break; + // case PairAndPrimePod: { // if (uiTask.returnData.success) { // omnipodPumpPlugin.setEnableCustomAction(OmnipodCustomActionType.PairAndPrime, false);