Add pref to disable all pump comm alerts.

(cherry picked from commit f074a5b)
This commit is contained in:
Johannes Mockenhaupt 2017-09-01 19:25:46 +02:00
parent 516a8c044b
commit a76fbefee8
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1
3 changed files with 11 additions and 1 deletions

View file

@ -137,7 +137,8 @@ public class ComboPlugin implements PluginBase, PumpInterface {
while (true) { while (true) {
Command localLastCmd = pump.lastCmd; Command localLastCmd = pump.lastCmd;
CommandResult localLastCmdResult = pump.lastCmdResult; 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 now = System.currentTimeMillis();
long fiveMinutesSinceLastAlarm = lastAlarmTime + (5 * 60 * 1000) + (15 * 1000); long fiveMinutesSinceLastAlarm = lastAlarmTime + (5 * 60 * 1000) + (15 * 1000);
boolean loopEnabled = ConfigBuilderPlugin.getActiveLoop() != null; boolean loopEnabled = ConfigBuilderPlugin.getActiveLoop() != null;

View file

@ -727,5 +727,8 @@
<string name="combo_enable_experimental_split_bolus_summary">Splits boluses into 2 U parts and waits around 45 after each to slow down bolus delivery.</string> <string name="combo_enable_experimental_split_bolus_summary">Splits boluses into 2 U parts and waits around 45 after each to slow down bolus delivery.</string>
<string name="combo_enable_experimental_bolus_summary">Enables the in-development bolus with progress report and cancel option.</string> <string name="combo_enable_experimental_bolus_summary">Enables the in-development bolus with progress report and cancel option.</string>
<string name="combo_enable_experimental_features_summary">Unlocks experimental features which are in development and might be broken entirely.</string> <string name="combo_enable_experimental_features_summary">Unlocks experimental features which are in development and might be broken entirely.</string>
<string name="key_combo_disable_alerts">combo_disable_alerts</string>
<string name="combo_disable_alerts">Disable all alerts</string>
<string name="combo_disable_alerts_summary">Ignore all errors encountered while communicating with the pump.</string>
</resources> </resources>

View file

@ -38,6 +38,12 @@
android:numeric="decimal" android:numeric="decimal"
android:dialogMessage="@string/combo_experimental_reject_tbr_changes_below_delta_summary"/> android:dialogMessage="@string/combo_experimental_reject_tbr_changes_below_delta_summary"/>
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_combo_disable_alerts"
android:title="@string/combo_disable_alerts"
android:summary="@string/combo_disable_alerts_summary"/>
</PreferenceCategory> </PreferenceCategory>
</PreferenceScreen> </PreferenceScreen>