Merge pull request #1211 from avereha/avereha/fix-049

prevent 049 pod fault
This commit is contained in:
Milos Kozak 2022-01-22 11:10:09 +01:00 committed by GitHub
commit 21ae1f4fee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 7 deletions

View file

@ -546,12 +546,6 @@ class OmnipodDashPumpPlugin @Inject constructor(
try {
bolusDeliveryInProgress = true
aapsLogger.info(LTag.PUMP, "Delivering treatment: $detailedBolusInfo $bolusCanceled")
val beepsConfigurationKey = if (detailedBolusInfo.bolusType == DetailedBolusInfo.BolusType.SMB)
R.string.key_omnipod_common_smb_beeps_enabled
else
R.string.key_omnipod_common_bolus_beeps_enabled
val bolusBeeps = sp.getBoolean(beepsConfigurationKey, false)
R.string.key_omnipod_common_smb_beeps_enabled
if (detailedBolusInfo.carbs > 0 ||
detailedBolusInfo.insulin == 0.0
) {
@ -568,10 +562,24 @@ class OmnipodDashPumpPlugin @Inject constructor(
.success(false)
.enacted(false)
.bolusDelivered(0.0)
.comment("Not enough insulin in the reservoir")
.comment(rh.gs(R.string.omnipod_dash_not_enough_insulin))
}
if (podStateManager.deliveryStatus == DeliveryStatus.BOLUS_AND_BASAL_ACTIVE ||
podStateManager.deliveryStatus == DeliveryStatus.BOLUS_AND_TEMP_BASAL_ACTIVE) {
return PumpEnactResult(injector)
.success(false)
.enacted(false)
.bolusDelivered(0.0)
.comment(rh.gs(R.string.omnipod_dash_bolus_already_in_progress))
}
var deliveredBolusAmount = 0.0
val beepsConfigurationKey = if (detailedBolusInfo.bolusType == DetailedBolusInfo.BolusType.SMB)
R.string.key_omnipod_common_smb_beeps_enabled
else
R.string.key_omnipod_common_bolus_beeps_enabled
val bolusBeeps = sp.getBoolean(beepsConfigurationKey, false)
aapsLogger.info(
LTag.PUMP,
"deliverTreatment: requestedBolusAmount=$requestedBolusAmount"

View file

@ -49,4 +49,6 @@
<string name="dash_bolusdelivering">Delivering %1$.2f U</string>
<string name="omnipod_common_alert_delivery_suspended">Insulin delivery is suspended</string>
<string name="omnipod_dash_connection_lost">Lost connection to pod</string>
<string name="omnipod_dash_bolus_already_in_progress">Another bolus is being delivered</string>
<string name="omnipod_dash_not_enough_insulin">Not enough insulin left in the reservoir</string>
</resources>