fix alerts. fix display for basal rates
This commit is contained in:
parent
45fb0a5a21
commit
abc051d64e
|
@ -1193,7 +1193,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
|||
val lowReservoirAlertEnabled = sp.getBoolean(R.string.key_omnipod_common_low_reservoir_alert_enabled, true)
|
||||
val lowReservoirAlertUnits = sp.getInt(R.string.key_omnipod_common_low_reservoir_alert_units, 10)
|
||||
|
||||
if (!podStateManager.differentAlertSettings(
|
||||
if (podStateManager.sameAlertSettings(
|
||||
expirationReminderEnabled,
|
||||
expirationHours,
|
||||
lowReservoirAlertEnabled,
|
||||
|
|
|
@ -105,7 +105,7 @@ interface OmnipodDashPodStateManager {
|
|||
- after getPodStatus was successful(we have an up-to-date podStatus)
|
||||
*/
|
||||
fun recoverActivationFromPodStatus(): String?
|
||||
fun differentAlertSettings(expirationReminderEnabled: Boolean, expirationHours: Int, lowReservoirAlertEnabled: Boolean, lowReservoirAlertUnits: Int): Boolean
|
||||
fun sameAlertSettings(expirationReminderEnabled: Boolean, expirationHours: Int, lowReservoirAlertEnabled: Boolean, lowReservoirAlertUnits: Int): Boolean
|
||||
fun updateExpirationAlertSettings(expirationReminderEnabled: Boolean, expirationHours: Int): Completable
|
||||
fun updateLowReservoirAlertSettings(lowReservoirAlertEnabled: Boolean, lowReservoirAlertUnits: Int): Completable
|
||||
|
||||
|
|
|
@ -435,7 +435,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
override fun differentAlertSettings(
|
||||
override fun sameAlertSettings(
|
||||
expirationReminderEnabled: Boolean,
|
||||
expirationHours: Int,
|
||||
lowReservoirAlertEnabled: Boolean,
|
||||
|
|
|
@ -25,8 +25,9 @@ object ProfileUtil {
|
|||
val basalValueValue = pumpType.determineCorrectBasalSize(basalValue.value)
|
||||
val hour = basalValue.timeAsSeconds / (60 * 60)
|
||||
stringBuilder.append((if (hour < 10) "0" else "") + hour + ":00")
|
||||
stringBuilder.append(" ")
|
||||
stringBuilder.append(String.format(Locale.ENGLISH, "%.3f", basalValueValue))
|
||||
stringBuilder.append(", ")
|
||||
stringBuilder.append(",\n")
|
||||
}
|
||||
return if (stringBuilder.length > 3) stringBuilder.substring(0, stringBuilder.length - 2) else stringBuilder.toString()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue