Show notification to check pump date if last bolus is older than 24h.
This commit is contained in:
parent
3ff56c7fa2
commit
aae9f7d153
|
@ -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<Bolus> 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());
|
||||
|
|
|
@ -792,4 +792,5 @@
|
|||
<string name="zerovalueinprofile">Ungültiges Profil: %s</string>
|
||||
<string name="hoursago">vor %.1f h</string>
|
||||
<string name="combo_high_temp_rejected_due_to_pump_history_changes">Es wurde keine hohe TBR gesetzt, da nach der Berechnung Boluseinträge in der Pumpenhistorik gefunden wurden.</string>
|
||||
<string name="combo_check_date">Der letzte Bolus liegt mehr als 24 Stunden zurück. Prüfe bitte das Datum auf der Uhr.</string>
|
||||
</resources>
|
||||
|
|
|
@ -877,5 +877,6 @@
|
|||
<string name="combo_error_multiple_boluses_with_identical_timestamp">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.</string>
|
||||
<string name="mute">Mute</string>
|
||||
<string name="about_link_urls">\n\nhttp://www.androidaps.org\nhttp://www.androidaps.de (de)\n\nfacebook:\nhttp://facebook.androidaps.org\nhttp://facebook.androidaps.de (de)</string>
|
||||
<string name="combo_check_date">The last bolus is older than 24 hours. Please check the date on the pump is set correctly.</string>
|
||||
</resources>
|
||||
|
||||
|
|
Loading…
Reference in a new issue