diff --git a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt index fd853783a1..7a095ea7da 100644 --- a/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt +++ b/pump/combov2/src/main/kotlin/info/nightscout/pump/combov2/ComboV2Plugin.kt @@ -1102,7 +1102,17 @@ class ComboV2Plugin @Inject constructor ( reportFinishedBolus(R.string.combov2_bolus_delivery_failed, pumpEnactResult, succeeded = false) } finally { // The delivery was enacted if even a partial amount was infused. - pumpEnactResult.enacted = acquiredPump.lastBolusFlow.value?.let { it.bolusAmount > 0 } ?: false + acquiredPump.lastBolusFlow.value?.also { + pumpEnactResult.enacted = (it.bolusAmount > 0) + pumpEnactResult.bolusDelivered = it.bolusAmount.cctlBolusToIU() + } ?: run { + pumpEnactResult.enacted = false + pumpEnactResult.bolusDelivered = 0.0 + } + aapsLogger.debug( + LTag.PUMP, + "Pump enact result: success ${pumpEnactResult.success} enacted ${pumpEnactResult.enacted} bolusDelivered ${pumpEnactResult.bolusDelivered}" + ) bolusJob = null bolusProgressJob.cancelAndJoin() }