From 2b0e1aea75bfa24983aac8dd1ddf30c5073d01f9 Mon Sep 17 00:00:00 2001 From: jbr7rr <> Date: Wed, 19 Jul 2023 20:59:09 +0200 Subject: [PATCH] Don't check end for profiles that have no end (0L) --- .../info/nightscout/androidaps/receivers/KeepAliveWorker.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt index 29e9207399..39e461b388 100644 --- a/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/receivers/KeepAliveWorker.kt @@ -191,7 +191,10 @@ class KeepAliveWorker( } if (loop.isDisconnected) { // do nothing if pump is disconnected - } else if (runningProfile == null || ((!pump.isThisProfileSet(requestedProfile) || !requestedProfile.isEqual(runningProfile) || (runningProfile is ProfileSealed.EPS && runningProfile.value.originalEnd < dateUtil.now())) && !commandQueue.isRunning(Command.CommandType.BASAL_PROFILE))) { + } else if (runningProfile == null || ((!pump.isThisProfileSet(requestedProfile) || !requestedProfile.isEqual(runningProfile) + || (runningProfile is ProfileSealed.EPS && runningProfile.value.originalEnd < dateUtil.now() && runningProfile.value.originalDuration != 0L)) + && !commandQueue.isRunning(Command.CommandType.BASAL_PROFILE))) + { rxBus.send(EventProfileSwitchChanged()) } else if (isStatusOutdated && !pump.isBusy()) { lastReadStatus = now