From a77a0b21fb9290c0c187fea9807d00fc93b7df32 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Sun, 1 Aug 2021 23:02:47 +0200 Subject: [PATCH 01/10] 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() } From 770a58abd2a390949c31bb37930d294b2b7e3951 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Mon, 2 Aug 2021 22:47:36 +0200 Subject: [PATCH 02/10] sync alarm. bugfix on pod deactivation --- .../pump/omnipod/dash/OmnipodDashPumpPlugin.kt | 12 +++++++++++- .../driver/pod/state/OmnipodDashPodStateManager.kt | 1 + .../pod/state/OmnipodDashPodStateManagerImpl.kt | 12 +++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 2dd84d4097..8778a0151c 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -328,6 +328,15 @@ class OmnipodDashPumpPlugin @Inject constructor( Notification.URGENT, R.raw.boluserror ) + if (!podStateManager.alarmSynced) { + pumpSync.insertAnnouncement( + error = podStateManager.alarmType?.toString() ?: "Unknown pod failure", + pumpId = Random.Default.nextLong(), + pumpType = PumpType.OMNIPOD_DASH, + pumpSerial = serialNumber() + ) + podStateManager.alarmSynced = true + } } Completable.complete() } @@ -1068,7 +1077,8 @@ class OmnipodDashPumpPlugin @Inject constructor( private fun deactivatePod(): PumpEnactResult { val ret = executeProgrammingCommand( historyEntry = history.createRecord(OmnipodCommandType.DEACTIVATE_POD), - command = omnipodManager.deactivatePod().ignoreElements() + command = omnipodManager.deactivatePod().ignoreElements(), + checkNoActiveCommand = false, ).doOnComplete { rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_FAULT)) }.toPumpEnactResult() diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt index 2e862b81b1..d27a3b28c4 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt @@ -41,6 +41,7 @@ interface OmnipodDashPodStateManager { val time: ZonedDateTime? val timeDrift: java.time.Duration? val expiry: ZonedDateTime? + var alarmSynced: Boolean val messageSequenceNumber: Short val sequenceNumberOfLastProgrammingCommand: Short? 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 7f72f54cb5..b7173fc01c 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 @@ -233,6 +233,13 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( return null } + override var alarmSynced: Boolean + get() = podState.alarmSynced + set(value) { + podState.alarmSynced = value + store() + } + override var bluetoothConnectionState: OmnipodDashPodStateManager.BluetoothConnectionState @Synchronized get() = podState.bluetoothConnectionState @@ -498,8 +505,10 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( podState.lastStatusResponseReceived = 0 } - CommandSendingFailure, NoActiveCommand -> + CommandSendingFailure, NoActiveCommand -> { podState.activeCommand = null + podState.lastStatusResponseReceived = 0 + } } } @@ -660,6 +669,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( var eapAkaSequenceNumber: Long = 1 var bolusPulsesRemaining: Short = 0 var timeZone: String = "" // TimeZone ID (e.g. "Europe/Amsterdam") + var alarmSynced: Boolean = false var bleVersion: SoftwareVersion? = null var firmwareVersion: SoftwareVersion? = null From 52eb723db2639c0f28570563a76bd132ab1f5578 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Mon, 2 Aug 2021 23:28:54 +0200 Subject: [PATCH 03/10] add notification sound when delivery is suspended --- .../pump/omnipod/dash/OmnipodDashPumpPlugin.kt | 15 ++++++++------- .../driver/pod/definition/BeepRepetitionType.kt | 2 +- .../dash/driver/pod/definition/BeepType.kt | 2 +- omnipod-dash/src/main/res/values/strings.xml | 2 ++ .../src/main/res/xml/omnipod_dash_preferences.xml | 5 +++++ 5 files changed, 17 insertions(+), 9 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 8778a0151c..bca8146c00 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -147,13 +147,12 @@ class OmnipodDashPumpPlugin @Inject constructor( } else { rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_NOT_ATTACHED)) if (podStateManager.isSuspended) { - val notification = - Notification( - Notification.OMNIPOD_POD_SUSPENDED, - "Insulin delivery suspended", - Notification.NORMAL - ) - rxBus.send(EventNewNotification(notification)) + showNotification( + Notification.OMNIPOD_POD_SUSPENDED, + "Insulin delivery suspended", + Notification.NORMAL, + R.raw.boluserror + ) } else { rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_SUSPENDED)) if (!podStateManager.sameTimeZone) { @@ -1391,6 +1390,8 @@ class OmnipodDashPumpPlugin @Inject constructor( sp.getBoolean(R.string.key_omnipod_common_notification_uncertain_tbr_sound_enabled, true) Notification.OMNIPOD_UNCERTAIN_SMB -> sp.getBoolean(R.string.key_omnipod_common_notification_uncertain_smb_sound_enabled, true) + Notification.OMNIPOD_POD_SUSPENDED -> + sp.getBoolean(R.string.key_omnipod_common_notification_delivery_suspended_sound_enabled, true) else -> true } } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepRepetitionType.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepRepetitionType.kt index d7a1a8f761..cf668aa036 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepRepetitionType.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/BeepRepetitionType.kt @@ -8,6 +8,6 @@ enum class BeepRepetitionType( XXX(0x01.toByte()), // Used in lump of coal alert, LOW_RESERVOIR XXX2(0x03.toByte()), // Used in USER_SET_EXPIRATION XXX3(0x05.toByte()), // published system expiration alert - XXX4(0x06.toByte()), // Used in imminent pod expiration alert + XXX4(0x06.toByte()), // Used in imminent pod expiration alert, suspend in progress XXX5(0x08.toByte()); // Lump of coal alert } 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 2ce8428ee8..4fe4991119 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,6 +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 + XXX(0x04.toByte()), // Used during suspend LONG_SINGLE_BEEP(0x06.toByte()); // Used in stop delivery command } diff --git a/omnipod-dash/src/main/res/values/strings.xml b/omnipod-dash/src/main/res/values/strings.xml index b164e7bee4..6535947b56 100644 --- a/omnipod-dash/src/main/res/values/strings.xml +++ b/omnipod-dash/src/main/res/values/strings.xml @@ -21,4 +21,6 @@ omnipod_common_preferences_category_confirmation common_preferences_category_other + AAPS.Omnipod.notification_delivery_suspended_sound_enabled + Sound when delivery suspended notification enabled diff --git a/omnipod-dash/src/main/res/xml/omnipod_dash_preferences.xml b/omnipod-dash/src/main/res/xml/omnipod_dash_preferences.xml index 0e1d2dd11a..49aea42d7b 100644 --- a/omnipod-dash/src/main/res/xml/omnipod_dash_preferences.xml +++ b/omnipod-dash/src/main/res/xml/omnipod_dash_preferences.xml @@ -93,6 +93,11 @@ android:key="@string/key_omnipod_common_notification_uncertain_bolus_sound_enabled" android:title="@string/omnipod_common_preferences_notification_uncertain_bolus_sound_enabled" /> + + Date: Mon, 2 Aug 2021 23:29:19 +0200 Subject: [PATCH 04/10] format --- .../plugins/pump/omnipod/dash/driver/pod/definition/BeepType.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 4fe4991119..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,6 +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 + XXX(0x04.toByte()), // Used during suspend LONG_SINGLE_BEEP(0x06.toByte()); // Used in stop delivery command } From 0c401a84c89d974b8f60f650d6529fc41fec5d2a Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Mon, 2 Aug 2021 23:42:44 +0200 Subject: [PATCH 05/10] bugfix: MAX_POD_LIFETIME is in hours --- .../pump/omnipod/dash/driver/pod/definition/PodConstants.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/PodConstants.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/PodConstants.kt index ae648dd656..915c6b7bde 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/PodConstants.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/definition/PodConstants.kt @@ -4,6 +4,6 @@ import java.time.Duration class PodConstants { companion object { - val MAX_POD_LIFETIME = Duration.ofMinutes(80) + val MAX_POD_LIFETIME = Duration.ofHours(80) } } From ae8ba84adb74ab43170b8a0fe4ab7b3f60b49a67 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Tue, 3 Aug 2021 21:28:40 +0200 Subject: [PATCH 06/10] simplify --- .../omnipod/dash/driver/OmnipodDashManagerImpl.kt | 11 +---------- 1 file changed, 1 insertion(+), 10 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 bb39d0de5e..e504e93e62 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,16 +412,7 @@ 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) From 324469863bd0bfa1ed9c3b03a4c6cb019d9f449c Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Thu, 5 Aug 2021 21:17:15 +0200 Subject: [PATCH 07/10] undo TZ --- .../dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b7173fc01c..0d11e05373 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(false, TimeZone.SHORT) + podState.timeZone = tz.getDisplayName(true, TimeZone.SHORT) store() } From 042a21d8da4f93945f649a300f079a3fa086e887 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Thu, 5 Aug 2021 21:20:03 +0200 Subject: [PATCH 08/10] add logging for timezones --- .../dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 0d11e05373..07c551a018 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 @@ -124,7 +124,10 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( override val sameTimeZone: Boolean get() { val now = System.currentTimeMillis() - return TimeZone.getDefault().getOffset(now) == timeZone.getOffset(now) + val currentOffset = TimeZone.getDefault().getOffset(now) + val podOffset = timeZone.getOffset(now) + logger.debug(LTag.PUMPCOMM, "sameTimeZone currentOffset=$currentOffset podOffset=$podOffset") + return currentOffset == podOffset } override val bluetoothVersion: SoftwareVersion? From 6cb742d4e9428843facc8db8f0f91631bd97f6b0 Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Thu, 5 Aug 2021 21:23:45 +0200 Subject: [PATCH 09/10] add logging --- .../pod/state/OmnipodDashPodStateManagerImpl.kt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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 07c551a018..6ff2887b39 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 @@ -124,9 +124,18 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( override val sameTimeZone: Boolean get() { val now = System.currentTimeMillis() - val currentOffset = TimeZone.getDefault().getOffset(now) + val currentTimezone = TimeZone.getDefault() + val currentOffset = currentTimezone.getOffset(now) val podOffset = timeZone.getOffset(now) - logger.debug(LTag.PUMPCOMM, "sameTimeZone currentOffset=$currentOffset podOffset=$podOffset") + logger.debug( + LTag.PUMPCOMM, + "sameTimeZone currentTimezone=${currentTimezone.getDisplayName( + true, + TimeZone.SHORT + )} " + + "currentOffset=$currentOffset " + + "podOffset=$podOffset" + ) return currentOffset == podOffset } @@ -588,7 +597,7 @@ class OmnipodDashPodStateManagerImpl @Inject constructor( override fun updateFromAlarmStatusResponse(response: AlarmStatusResponse) { logger.info( LTag.PUMP, - "Received AlarmStatusReponse: $response" + "Received AlarmStatusResponse: $response" ) podState.deliveryStatus = response.deliveryStatus podState.podStatus = response.podStatus From 471f077320e90fdb0c381edbc7d8af3e42a8175b Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Thu, 5 Aug 2021 21:29:21 +0200 Subject: [PATCH 10/10] convert to primary constructor --- .../dash/driver/comm/exceptions/FailedToConnectException.kt | 4 +--- .../dash/driver/comm/scan/DiscoveredInvalidPodException.kt | 5 ++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/exceptions/FailedToConnectException.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/exceptions/FailedToConnectException.kt index 48cc7470bf..b0b16a611d 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/exceptions/FailedToConnectException.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/exceptions/FailedToConnectException.kt @@ -1,5 +1,3 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.exceptions -open class FailedToConnectException : Exception { - constructor(message: String? = null) : super("Failed to connect: ${message ?: ""}") -} +open class FailedToConnectException(message: String? = null) : Exception("Failed to connect: ${message ?: ""}") diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/DiscoveredInvalidPodException.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/DiscoveredInvalidPodException.kt index 0097cfd8df..54cf638c69 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/DiscoveredInvalidPodException.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/scan/DiscoveredInvalidPodException.kt @@ -2,6 +2,5 @@ package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.scan import android.os.ParcelUuid -class DiscoveredInvalidPodException : Exception { - constructor(message: String, serviceUUIds: List) : super("$message service UUIDs: $serviceUUIds") -} +class DiscoveredInvalidPodException(message: String, serviceUUIds: List) : + Exception("$message service UUIDs: $serviceUUIds")