From 11fa4d842c73292ef13e78d4ea2a5c24409362da Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Fri, 16 Jul 2021 22:14:29 +0200 Subject: [PATCH] improve isConnecting --- .../pump/omnipod/dash/OmnipodDashPumpPlugin.kt | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 13461b794f..d90c04b8f7 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -181,7 +181,6 @@ class OmnipodDashPumpPlugin @Inject constructor( } override fun isInitialized(): Boolean { - // TODO return true } @@ -201,17 +200,15 @@ class OmnipodDashPumpPlugin @Inject constructor( } override fun isConnecting(): Boolean { - // TODO - return stopConnecting != null + return stopConnecting != null && podStateManager.bluetoothConnectionState == OmnipodDashPodStateManager.BluetoothConnectionState.CONNECTING } override fun isHandshakeInProgress(): Boolean { - // TODO - return false + return stopConnecting != null } override fun finishHandshaking() { - // TODO + } override fun connect(reason: String) { @@ -337,8 +334,8 @@ class OmnipodDashPumpPlugin @Inject constructor( podStateManager.createActiveCommand(historyId, basalProgram = basalProgram) }, command = omnipodManager.setBasalProgram(basalProgram, hasBasalBeepEnabled()).ignoreElements(), - post = failWhenUnconfirmed(deliverySuspended), // mark as failed even if it worked OK and try again vs. mark ok and - // deny later + post = failWhenUnconfirmed(deliverySuspended), + // mark as failed even if it worked OK and try again vs. mark ok and deny later ).toPumpEnactResult() }