From 02386ae9ca2578cf58584572d045408a89678aab Mon Sep 17 00:00:00 2001 From: Carlos Rafael Giani Date: Sat, 18 Feb 2023 20:12:50 +0100 Subject: [PATCH] combov2: Don't return true in isBusy() when in the Connecting driver state --- .../main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt index 321b3273b0..9e595f2d33 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt @@ -419,7 +419,9 @@ class ComboV2Plugin @Inject constructor ( override fun isBusy(): Boolean = when (driverStateFlow.value) { - DriverState.Connecting, + // DriverState.Connecting is _not_ listed here. Even though the pump + // is technically busy and unable to execute commands in that state, + // returning true then causes problems with AAPS' KeepAlive mechanism. DriverState.CheckingPump, is DriverState.ExecutingCommand -> true else -> false