Merge pull request #731 from 0pen-dash/avereha/fix-low-reservoir-alert

dash small fixes
This commit is contained in:
Milos Kozak 2021-10-15 22:38:23 +02:00 committed by GitHub
commit 857d75c0e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 9 deletions

View file

@ -1031,7 +1031,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
DateFormat.format("HH:mm", Date(this.startTime))
) + "\n"
}
val (temporaryBasal, extendedBolus, _, profile) = pumpSync.expectedPumpState()
val temporaryBasal = pumpSync.expectedPumpState().temporaryBasal
temporaryBasal?.run {
ret += resourceHelper.gs(
R.string.omnipod_common_short_status_temp_basal,
@ -1229,7 +1229,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
expirationReminderEnabled,
expirationHours
).andThen(
podStateManager.updateExpirationAlertSettings(
podStateManager.updateLowReservoirAlertSettings(
lowReservoirAlertEnabled,
lowReservoirAlertUnits
)

View file

@ -65,13 +65,9 @@ class DashInsertCannulaViewModel @Inject constructor(
null
super.disposable += omnipodManager.activatePodPart2(basalProgram, expirationHoursBeforeShutdown)
.ignoreElements()
.andThen(podStateManager.updateExpirationAlertSettings(expirationReminderEnabled, expirationHours))
.subscribeBy(
onNext = { podEvent ->
logger.debug(
LTag.PUMP,
"Received PodEvent in Pod activation part 2: $podEvent"
)
},
onError = { throwable ->
logger.error(LTag.PUMP, "Error in Pod activation part 2", throwable)
source.onSuccess(PumpEnactResult(injector).success(false).comment(I8n.textFromException(throwable, resourceHelper)))
@ -103,7 +99,6 @@ class DashInsertCannulaViewModel @Inject constructor(
pumpSerial = podStateManager.uniqueId?.toString() ?: "n/a"
)
podStateManager.updateExpirationAlertSettings(expirationReminderEnabled, expirationHours)
rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED))
source.onSuccess(PumpEnactResult(injector).success(true))
}