From c50757a2d1b16d2d0b712b98a807efe9f417e2fb Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Thu, 24 Jun 2021 22:06:08 +0200 Subject: [PATCH] getPumpStatus only if requested by user while the pod is not activated --- .../plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt | 5 +++++ 1 file changed, 5 insertions(+) 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 cfd2b28061..38fb460368 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 @@ -130,6 +130,11 @@ class OmnipodDashPumpPlugin @Inject constructor( } override fun getPumpStatus(reason: String) { + if (reason != "REQUESTED BY USER" && !podStateManager.isActivationCompleted) { + // prevent races on BLE whent the pod is not activated + return + } + val throwable = getPodStatus().blockingGet() if (throwable != null) { aapsLogger.error(LTag.PUMP, "Error in getPumpStatus", throwable)