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 0be566f438..51c851085c 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 @@ -278,7 +278,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump private void doPodCheck() { if (System.currentTimeMillis() > this.nextPodCheck) { - if (!getPodPumpStatusObject().podAvailable) { + if (!getPodPumpStatusObject().podAvailable && getPodPumpStatusObject().podAvailibityChecked) { Notification notification = new Notification(Notification.OMNIPOD_POD_NOT_ATTACHED, MainApp.gs(R.string.omnipod_error_pod_not_attached), Notification.NORMAL); RxBus.INSTANCE.send(new EventNewNotification(notification)); } else { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/OmnipodPumpStatus.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/OmnipodPumpStatus.java index 8996795fa9..58a22ed04b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/OmnipodPumpStatus.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/OmnipodPumpStatus.java @@ -51,6 +51,7 @@ public class OmnipodPumpStatus extends PumpStatus { public String podNumber; public PodDeviceState podDeviceState = PodDeviceState.NeverContacted; public boolean podAvailable = false; + public boolean podAvailibityChecked = false; public boolean ackAlertsAvailable = false; public String ackAlertsText = null; @@ -225,6 +226,6 @@ public class OmnipodPumpStatus extends PumpStatus { ", tempBasalRemainMin=" + tempBasalRemainMin + ", tempBasalStart=" + tempBasalStart + ", pumpDescription=" + pumpDescription + - "} " ; + "} "; } } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java index 5fda6d8bd5..a3ddaff461 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/service/RileyLinkOmnipodService.java @@ -23,12 +23,12 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkService; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData; -import info.nightscout.androidaps.plugins.pump.omnipod.driver.comm.AapsOmnipodManager; import info.nightscout.androidaps.plugins.pump.omnipod.OmnipodPumpPlugin; import info.nightscout.androidaps.plugins.pump.omnipod.comm.OmnipodCommunicationService; import info.nightscout.androidaps.plugins.pump.omnipod.defs.OmnipodCommunicationManagerInterface; import info.nightscout.androidaps.plugins.pump.omnipod.defs.state.PodSessionState; import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus; +import info.nightscout.androidaps.plugins.pump.omnipod.driver.comm.AapsOmnipodManager; import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodConst; import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil; import info.nightscout.androidaps.utils.SP; @@ -114,7 +114,7 @@ public class RileyLinkOmnipodService extends RileyLinkService { } private void initializeErosOmnipodManager() { - if(AapsOmnipodManager.getInstance() == null) { + if (AapsOmnipodManager.getInstance() == null) { PodSessionState podState = null; if (SP.contains(OmnipodConst.Prefs.PodState)) { try { @@ -128,6 +128,7 @@ public class RileyLinkOmnipodService extends RileyLinkService { } OmnipodCommunicationService omnipodCommunicationService = new OmnipodCommunicationService(rfspy); omnipodCommunicationService.setPumpStatus(pumpStatus); + pumpStatus.podAvailibityChecked = true; omnipodCommunicationManager = new AapsOmnipodManager(omnipodCommunicationService, podState, pumpStatus); } else { @@ -143,11 +144,11 @@ public class RileyLinkOmnipodService extends RileyLinkService { @Override public RileyLinkCommunicationManager getDeviceCommunicationManager() { - if(omnipodCommunicationManager instanceof AapsOmnipodManager) { // Eros + if (omnipodCommunicationManager instanceof AapsOmnipodManager) { // Eros return ((AapsOmnipodManager) omnipodCommunicationManager).getCommunicationService(); } // FIXME is this correct for Dash? - return (RileyLinkCommunicationManager)omnipodCommunicationManager; + return (RileyLinkCommunicationManager) omnipodCommunicationManager; }