From a76fbefee8ccac476c02adf2a1373561cc527d3f Mon Sep 17 00:00:00 2001 From: Johannes Mockenhaupt Date: Fri, 1 Sep 2017 19:25:46 +0200 Subject: [PATCH] Add pref to disable all pump comm alerts. (cherry picked from commit f074a5b) --- .../androidaps/plugins/PumpCombo/ComboPlugin.java | 3 ++- app/src/main/res/values/strings.xml | 3 +++ app/src/main/res/xml/pref_combo.xml | 6 ++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java index 2441584928..37ec5ac41d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpCombo/ComboPlugin.java @@ -137,7 +137,8 @@ public class ComboPlugin implements PluginBase, PumpInterface { while (true) { Command localLastCmd = pump.lastCmd; CommandResult localLastCmdResult = pump.lastCmdResult; - if (localLastCmdResult != null && !localLastCmdResult.success) { + if (!SP.getBoolean(R.string.combo_disable_alerts, false) && + localLastCmdResult != null && !localLastCmdResult.success) { long now = System.currentTimeMillis(); long fiveMinutesSinceLastAlarm = lastAlarmTime + (5 * 60 * 1000) + (15 * 1000); boolean loopEnabled = ConfigBuilderPlugin.getActiveLoop() != null; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 4f95d46808..4c204d2cbf 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -727,5 +727,8 @@ Splits boluses into 2 U parts and waits around 45 after each to slow down bolus delivery. Enables the in-development bolus with progress report and cancel option. Unlocks experimental features which are in development and might be broken entirely. + combo_disable_alerts + Disable all alerts + Ignore all errors encountered while communicating with the pump. diff --git a/app/src/main/res/xml/pref_combo.xml b/app/src/main/res/xml/pref_combo.xml index d1d1cd5a6b..9e2927d4cf 100644 --- a/app/src/main/res/xml/pref_combo.xml +++ b/app/src/main/res/xml/pref_combo.xml @@ -38,6 +38,12 @@ android:numeric="decimal" android:dialogMessage="@string/combo_experimental_reject_tbr_changes_below_delta_summary"/> + + \ No newline at end of file