More WIP on Omnipod Dash Pod activation
This commit is contained in:
parent
6d4521ca6b
commit
ebdc2aebe0
1 changed files with 21 additions and 26 deletions
|
@ -105,10 +105,8 @@ class OmnipodDashManagerImpl @Inject constructor(
|
|||
}
|
||||
|
||||
private val observeVerifyCannulaInsertion: Observable<PodEvent>
|
||||
get() = Observable.defer {
|
||||
observeSendGetPodStatusCommand()
|
||||
.ignoreElements() //
|
||||
.andThen(
|
||||
get() = Observable.concat(
|
||||
observeSendGetPodStatusCommand(),
|
||||
Observable.defer {
|
||||
if (podStateManager.podStatus == PodStatus.RUNNING_ABOVE_MIN_VOLUME) {
|
||||
Observable.empty()
|
||||
|
@ -117,7 +115,6 @@ class OmnipodDashManagerImpl @Inject constructor(
|
|||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private fun observeSendProgramAlertsCommand(
|
||||
alertConfigurations: List<AlertConfiguration>,
|
||||
|
@ -153,10 +150,8 @@ class OmnipodDashManagerImpl @Inject constructor(
|
|||
}
|
||||
|
||||
private val observeVerifyPrime: Observable<PodEvent>
|
||||
get() = Observable.defer {
|
||||
observeSendGetPodStatusCommand()
|
||||
.ignoreElements() //
|
||||
.andThen(
|
||||
get() = Observable.concat(
|
||||
observeSendGetPodStatusCommand(ResponseType.StatusResponseType.DEFAULT_STATUS_RESPONSE),
|
||||
Observable.defer {
|
||||
if (podStateManager.podStatus == PodStatus.CLUTCH_DRIVE_ENGAGED) {
|
||||
Observable.empty()
|
||||
|
@ -165,7 +160,6 @@ class OmnipodDashManagerImpl @Inject constructor(
|
|||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
private val observeSendSetUniqueIdCommand: Observable<PodEvent>
|
||||
get() = Observable.defer {
|
||||
|
@ -196,6 +190,7 @@ class OmnipodDashManagerImpl @Inject constructor(
|
|||
return Observable.concat(
|
||||
observePodReadyForActivationPart1,
|
||||
observePairNewPod,
|
||||
observeConnectToPod, // FIXME needed after disconnect; observePairNewPod does not connect in that case.
|
||||
observeActivationPart1Commands(lowReservoirAlertTrigger)
|
||||
).doOnComplete(ActivationProgressUpdater(ActivationProgress.PHASE_1_COMPLETED))
|
||||
// TODO these would be common for any observable returned in a public function in this class
|
||||
|
|
Loading…
Add table
Reference in a new issue