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 421ffb0c7c..1e0bbc56e1 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 @@ -333,7 +333,7 @@ class OmnipodDashPumpPlugin @Inject constructor( return ret } - private fun observeNoActiveTempBasal(enforeNew: Boolean): Completable { + private fun observeNoActiveTempBasal(enforceNew: Boolean): Completable { return Completable.defer { when { podStateManager.deliveryStatus !in @@ -343,7 +343,7 @@ class OmnipodDashPumpPlugin @Inject constructor( Completable.complete() } - !enforeNew -> + !enforceNew -> Completable.error( IllegalStateException( "Temporary basal already active and enforeNew is not set." @@ -364,7 +364,7 @@ class OmnipodDashPumpPlugin @Inject constructor( private fun observeActiveTempBasal(): Completable { return Completable.defer { - if (pumpSync.expectedPumpState().temporaryBasal != null) + if (podStateManager.tempBasalActive) Completable.complete() else Completable.error(