diff --git a/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandStartPump.kt b/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandStartPump.kt index da911775bf..a1f2ecaf46 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandStartPump.kt +++ b/app/src/main/java/info/nightscout/androidaps/queue/commands/CommandStartPump.kt @@ -2,7 +2,9 @@ package info.nightscout.androidaps.queue.commands import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePluginProvider +import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.pump.insight.LocalInsightPlugin +import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin import info.nightscout.androidaps.queue.Callback import javax.inject.Inject @@ -12,12 +14,19 @@ class CommandStartPump( ) : Command(injector, CommandType.START_PUMP, callback) { @Inject lateinit var activePlugin: ActivePluginProvider + @Inject lateinit var profileFunction: ProfileFunction override fun execute() { val pump = activePlugin.activePump if (pump is LocalInsightPlugin) { val result = pump.startPump() callback?.result(result)?.run() + } else if (pump is OmnipodPumpPlugin) { + // When using CommandQueue.setProfile, it refuses to set the profile is the same as the current profile + // However we need to set the current profile to resume delivery in case the Pod is suspended + if (profileFunction.getProfile() != null) { + pump.setNewBasalProfile(profileFunction.getProfile()) + } } } diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/Notification.java b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/Notification.java index b43b058277..52495a2d41 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/Notification.java +++ b/core/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/Notification.java @@ -72,6 +72,7 @@ public class Notification { public static final int OMNIPOD_POD_NOT_ATTACHED = 59; public static final int CARBS_REQUIRED = 60; public static final int IMPORTANCE_HIGH = 2; + public static final int OMNIPOD_POD_SUSPENDED = 61; public static final String CATEGORY_ALARM = "alarm";