MDT: fix notificaion call

This commit is contained in:
Milos Kozak 2023-02-18 17:24:57 +01:00
parent 36bbb0754c
commit 009cec2eb1
2 changed files with 10 additions and 10 deletions

View file

@ -343,7 +343,7 @@ class MedtronicPumpPlugin @Inject constructor(
var resetTime = false
if (isPumpNotReachable) {
aapsLogger.error("Pump unreachable.")
medtronicUtil.sendNotification(MedtronicNotificationType.PumpUnreachable, rh, rxBus)
medtronicUtil.sendNotification(MedtronicNotificationType.PumpUnreachable, rh)
return
}
medtronicUtil.dismissNotification(MedtronicNotificationType.PumpUnreachable, rxBus)
@ -413,7 +413,7 @@ class MedtronicPumpPlugin @Inject constructor(
if (isRefresh) {
if (isPumpNotReachable) {
aapsLogger.error(logPrefix + "initializePump::Pump unreachable.")
medtronicUtil.sendNotification(MedtronicNotificationType.PumpUnreachable, rh, rxBus)
medtronicUtil.sendNotification(MedtronicNotificationType.PumpUnreachable, rh)
setRefreshButtonEnabled(true)
return true
}
@ -426,7 +426,7 @@ class MedtronicPumpPlugin @Inject constructor(
} else {
if (medtronicPumpStatus.medtronicDeviceType !== medtronicUtil.medtronicPumpModel) {
aapsLogger.warn(LTag.PUMP, logPrefix + "Configured pump is not the same as one detected.")
medtronicUtil.sendNotification(MedtronicNotificationType.PumpTypeNotSame, rh, rxBus)
medtronicUtil.sendNotification(MedtronicNotificationType.PumpTypeNotSame, rh)
}
}
pumpState = PumpDriverState.Connected
@ -578,7 +578,7 @@ class MedtronicPumpPlugin @Inject constructor(
} else {
if (clock.localDeviceTime.year > 2015) {
aapsLogger.error(String.format(Locale.ENGLISH, "MedtronicPumpPlugin::checkTimeAndOptionallySetTime - Time difference over 24h requested [diff=%d s]. Doing nothing.", timeDiff))
medtronicUtil.sendNotification(MedtronicNotificationType.TimeChangeOver24h, rh, rxBus)
medtronicUtil.sendNotification(MedtronicNotificationType.TimeChangeOver24h, rh)
}
}
} else {

View file

@ -115,7 +115,7 @@ class MedtronicUIPostprocessor @Inject constructor(
MedtronicCommandType.PumpModel -> {
if (medtronicPumpStatus.medtronicDeviceType !== medtronicUtil.medtronicPumpModel) {
aapsLogger.warn(LTag.PUMP, "Configured pump is different then pump detected !")
medtronicUtil.sendNotification(MedtronicNotificationType.PumpTypeNotSame, rh, rxBus)
medtronicUtil.sendNotification(MedtronicNotificationType.PumpTypeNotSame, rh)
}
}
@ -156,12 +156,12 @@ class MedtronicUIPostprocessor @Inject constructor(
checkValue = settings["PCFG_BASAL_PROFILES_ENABLED"]!!
if ("Yes" != checkValue.value) {
aapsLogger.error(LTag.PUMP, "Basal profiles are not enabled on pump.")
medtronicUtil.sendNotification(MedtronicNotificationType.PumpBasalProfilesNotEnabled, rh, rxBus)
medtronicUtil.sendNotification(MedtronicNotificationType.PumpBasalProfilesNotEnabled, rh)
} else {
checkValue = settings["PCFG_ACTIVE_BASAL_PROFILE"]!!
if ("STD" != checkValue.value) {
aapsLogger.error("Basal profile set on pump is incorrect (must be STD).")
medtronicUtil.sendNotification(MedtronicNotificationType.PumpIncorrectBasalProfileSelected, rh, rxBus)
medtronicUtil.sendNotification(MedtronicNotificationType.PumpIncorrectBasalProfileSelected, rh)
}
}
}
@ -170,7 +170,7 @@ class MedtronicUIPostprocessor @Inject constructor(
if (settings.containsKey("PCFG_TEMP_BASAL_TYPE")) {
if ("Units" != settings["PCFG_TEMP_BASAL_TYPE"]!!.value) {
aapsLogger.error("Wrong TBR type set on pump (must be Absolute).")
medtronicUtil.sendNotification(MedtronicNotificationType.PumpWrongTBRTypeSet, rh, rxBus)
medtronicUtil.sendNotification(MedtronicNotificationType.PumpWrongTBRTypeSet, rh)
}
}
@ -179,7 +179,7 @@ class MedtronicUIPostprocessor @Inject constructor(
checkValue = settings["PCFG_MAX_BOLUS"]!!
if (!MedtronicUtil.isSame(checkValue.value.toDouble(), medtronicPumpStatus.maxBolus!!)) {
aapsLogger.error(LTag.PUMPCOMM, String.format(Locale.ENGLISH, "Wrong Max Bolus set on Pump (current=%s, required=%.2f).", checkValue.value, medtronicPumpStatus.maxBolus))
medtronicUtil.sendNotification(MedtronicNotificationType.PumpWrongMaxBolusSet, rh, rxBus, medtronicPumpStatus.maxBolus)
medtronicUtil.sendNotification(MedtronicNotificationType.PumpWrongMaxBolusSet, rh, medtronicPumpStatus.maxBolus)
}
}
@ -187,7 +187,7 @@ class MedtronicUIPostprocessor @Inject constructor(
checkValue = settings["PCFG_MAX_BASAL"]!!
if (!MedtronicUtil.isSame(checkValue.value.toDouble(), medtronicPumpStatus.maxBasal!!)) {
aapsLogger.error(LTag.PUMPCOMM, String.format(Locale.ENGLISH, "Wrong Max Basal set on Pump (current=%s, required=%.2f).", checkValue.value, medtronicPumpStatus.maxBasal))
medtronicUtil.sendNotification(MedtronicNotificationType.PumpWrongMaxBasalSet, rh, rxBus, medtronicPumpStatus.maxBasal)
medtronicUtil.sendNotification(MedtronicNotificationType.PumpWrongMaxBasalSet, rh, medtronicPumpStatus.maxBasal)
}
}
}