add checkPodKaput
This commit is contained in:
parent
aa719e0b9f
commit
b55dacd12c
3 changed files with 14 additions and 12 deletions
|
@ -132,8 +132,8 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
history.updateFromState(podStateManager),
|
history.updateFromState(podStateManager),
|
||||||
podStateManager.updateActiveCommand()
|
podStateManager.updateActiveCommand()
|
||||||
.map { handleCommandConfirmation(it) }
|
.map { handleCommandConfirmation(it) }
|
||||||
.map { checkPodKaput() }
|
|
||||||
.ignoreElement(),
|
.ignoreElement(),
|
||||||
|
checkPodKaput()
|
||||||
)
|
)
|
||||||
).blockingGet()
|
).blockingGet()
|
||||||
if (throwable != null) {
|
if (throwable != null) {
|
||||||
|
@ -143,12 +143,11 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun checkPodKaput() {
|
private fun checkPodKaput(): Completable = Completable.defer {
|
||||||
if (podStateManager.isPodKaput) {
|
|
||||||
val tbr = pumpSync.expectedPumpState().temporaryBasal
|
val tbr = pumpSync.expectedPumpState().temporaryBasal
|
||||||
if (tbr?.rate == 0.0) {
|
if (podStateManager.isPodKaput &&
|
||||||
return
|
(tbr == null || tbr.rate != 0.0)
|
||||||
}
|
) {
|
||||||
pumpSync.syncTemporaryBasalWithPumpId(
|
pumpSync.syncTemporaryBasalWithPumpId(
|
||||||
timestamp = System.currentTimeMillis(),
|
timestamp = System.currentTimeMillis(),
|
||||||
rate = 0.0,
|
rate = 0.0,
|
||||||
|
@ -160,6 +159,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
pumpSerial = serialNumber()
|
pumpSerial = serialNumber()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Completable.complete()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun setNewBasalProfile(profile: Profile): PumpEnactResult {
|
override fun setNewBasalProfile(profile: Profile): PumpEnactResult {
|
||||||
|
|
|
@ -296,10 +296,12 @@ class OmnipodDashOverviewFragment : DaggerFragment() {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
podStateManager.alarmType?.let {
|
podStateManager.alarmType?.let {
|
||||||
errors.add(resourceHelper.gs(
|
errors.add(
|
||||||
|
resourceHelper.gs(
|
||||||
R.string.omnipod_common_pod_status_pod_fault_description,
|
R.string.omnipod_common_pod_status_pod_fault_description,
|
||||||
it.value,
|
it.value,
|
||||||
it.toString())
|
it.toString()
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue