From 88b4830a0cccb074a05e0724d5d4364e4eea33ef Mon Sep 17 00:00:00 2001 From: Andrei Vereha Date: Sat, 13 Nov 2021 12:41:53 +0100 Subject: [PATCH] show notification only once and if there is no CommandDeactivatePod in progress --- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 19 ++++++++++--------- 1 file changed, 10 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 405e7da295..8a4a7cf5d9 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 @@ -342,15 +342,16 @@ class OmnipodDashPumpPlugin @Inject constructor( aapsLogger.info(LTag.PUMP, "syncBolusWithPumpId on CANCEL_BOLUS returned: $sync") } } - - podStateManager.alarmType?.let { - showNotification( - Notification.OMNIPOD_POD_FAULT, - it.toString(), - Notification.URGENT, - R.raw.boluserror - ) - if (!podStateManager.alarmSynced) { + if (!podStateManager.alarmSynced) { + podStateManager.alarmType?.let { + if (!commandQueue.isCustomCommandInQueue(CommandDeactivatePod::class.java)) { + showNotification( + Notification.OMNIPOD_POD_FAULT, + it.toString(), + Notification.URGENT, + R.raw.boluserror + ) + } pumpSync.insertAnnouncement( error = it.toString(), pumpId = Random.Default.nextLong(),