fix .bolusDelivered in the deliverTreatment response

This commit is contained in:
Andrei Vereha 2021-11-09 23:27:42 +01:00
parent 247768c139
commit e7f93145a0

View file

@ -625,15 +625,20 @@ class OmnipodDashPumpPlugin @Inject constructor(
) )
} }
} }
}.toSingleDefault( }.toSingle {
PumpEnactResult(injector).success(true).enacted(true).bolusDelivered(deliveredBolusAmount) PumpEnactResult(injector).success(true).enacted(true).bolusDelivered(deliveredBolusAmount)
}.onErrorReturnItem(
// success if canceled
PumpEnactResult(injector).success(bolusCanceled).enacted(false)
) )
.onErrorReturnItem(
// success if canceled
PumpEnactResult(injector).success(bolusCanceled).enacted(false)
)
.blockingGet() .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 return ret
} finally { } finally {
bolusCanceled = false bolusCanceled = false