getPumpStatus only if requested by user while the pod is not activated

This commit is contained in:
Andrei Vereha 2021-06-24 22:06:08 +02:00
parent 3c222f0500
commit c50757a2d1

View file

@ -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)