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 021be21033..006f38f362 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 @@ -130,7 +130,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf /** Cache of the last <=2 boluses on the pump. Used to detect changes in pump history, * requiring reading pump more history. This is read/set in {@link #checkHistory()} when changed * pump history was detected and was read, as well as in {@link #deliverBolus(DetailedBolusInfo)} - * after bolus delivery. */ + * after bolus delivery. Newest record is the first one. */ private volatile List recentBoluses = new ArrayList<>(0); public static ComboPlugin getPlugin() { @@ -424,6 +424,12 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf pump.initialized = true; MainApp.bus().post(new EventInitializationChanged()); + // show notification to check pump date if last bolus is older than 24 hours + if (!recentBoluses.isEmpty() && recentBoluses.get(0).timestamp < System.currentTimeMillis() - 24 * 60 * 60 * 1000) { + Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, MainApp.gs(R.string.combo_check_date), Notification.URGENT); + MainApp.bus().post(new EventNewNotification(notification)); + } + // ComboFragment updates state fully only after the pump has initialized, // so force an update after initialization completed MainApp.bus().post(new EventComboPumpUpdateGUI()); diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 1272304a5c..68ff187e53 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -792,4 +792,5 @@ Ungültiges Profil: %s vor %.1f h Es wurde keine hohe TBR gesetzt, da nach der Berechnung Boluseinträge in der Pumpenhistorik gefunden wurden. + Der letzte Bolus liegt mehr als 24 Stunden zurück. Prüfe bitte das Datum auf der Uhr. diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 6353f55fbc..54306fa182 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -877,5 +877,6 @@ Multiple boluses with the same amount within the same minute were just imported. Only one record could be added to treatments. Please check the pump and manually add a bolus record using the Careportal tab. Make sure to create a bolus with a time no other bolus uses. Mute \n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de) + The last bolus is older than 24 hours. Please check the date on the pump is set correctly.