From a77a0b21fb9290c0c187fea9807d00fc93b7df32 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Sun, 1 Aug 2021 23:02:47 +0200 Subject: [PATCH] alert on suspend. don't use DST for timezone name --- .../omnipod/dash/driver/OmnipodDashManagerImpl.kt | 11 ++++++++++- .../omnipod/dash/driver/pod/definition/BeepType.kt | 1 + .../pod/state/OmnipodDashPodStateManagerImpl.kt | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt index e504e93e62..bb39d0de5e 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt @@ -412,7 +412,16 @@ class OmnipodDashManagerImpl @Inject constructor( ), // FIXME use activation time BeepType.FOUR_TIMES_BIP_BEEP, BeepRepetitionType.XXX4 - ) + ), + AlertConfiguration( + AlertType.SUSPEND_IN_PROGRESS, + enabled = true, + durationInMinutes = 15, + autoOff = false, + AlertTrigger.TimerTrigger(15), + BeepType.XXX, + BeepRepetitionType.XXX4 + ), ) val userExpiryAlertDelay = podLifeLeft.minus( Duration.ofHours(userConfiguredExpirationHours ?: MAX_POD_LIFETIME.toHours() + 1) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepType.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepType.kt index ad41a53654..2ce8428ee8 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepType.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepType.kt @@ -4,5 +4,6 @@ enum class BeepType(val value: Byte) { SILENT(0x00.toByte()), FOUR_TIMES_BIP_BEEP(0x02.toByte()), // Used in low reservoir alert, user expiration alert, expiration alert, imminent expiration alert, lump of coal alert + XXX(0x04.toByte()), // Used during suspend LONG_SINGLE_BEEP(0x06.toByte()); // Used in stop delivery command } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt index 0a7ca2ed56..7f72f54cb5 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt @@ -117,7 +117,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( override var timeZone: TimeZone get() = TimeZone.getTimeZone(podState.timeZone) set(tz) { - podState.timeZone = tz.getDisplayName(true, TimeZone.SHORT) + podState.timeZone = tz.getDisplayName(false, TimeZone.SHORT) store() }