Merge pull request #893 from 0pen-dash/avereha/fix-bolus

Avereha/fix bolus
This commit is contained in:
Milos Kozak 2021-11-09 23:43:41 +01:00 committed by GitHub
commit 43287f6dca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 37 deletions

View file

@ -625,15 +625,20 @@ class OmnipodDashPumpPlugin @Inject constructor(
)
}
}
}.toSingleDefault(
}.toSingle {
PumpEnactResult(injector).success(true).enacted(true).bolusDelivered(deliveredBolusAmount)
)
.onErrorReturnItem(
}.onErrorReturnItem(
// success if canceled
PumpEnactResult(injector).success(bolusCanceled).enacted(false)
)
.blockingGet()
aapsLogger.info(LTag.PUMP, "deliverTreatment result: $ret")
aapsLogger.info(
LTag.PUMP,
"deliverTreatment result: $ret. " +
"deliveredBolusAmount=$deliveredBolusAmount. " +
"ret bolus=${ret.bolusDelivered}" +
"bolusCanceled=$bolusCanceled"
)
return ret
} finally {
bolusCanceled = false