Check pump time not last connection time

This commit is contained in:
AdrianLxM 2017-12-08 19:23:41 +01:00 committed by Johannes Mockenhaupt
parent d2f2266a2b
commit 4d356096cf
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -710,7 +710,7 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
/** check pump time (main menu) and raise notification if clock is off by more than 2m /** check pump time (main menu) and raise notification if clock is off by more than 2m
* (setting clock is not supported by ruffy) */ * (setting clock is not supported by ruffy) */
private void checkPumpTime(PumpState state) { private void checkPumpTime(PumpState state) {
if (state.timestamp != 0 && Math.abs(state.timestamp - System.currentTimeMillis()) > 2 * 60 * 1000) { if (state.pumpTime != 0 && Math.abs(state.pumpTime - System.currentTimeMillis()) > 2 * 60 * 1000) {
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, MainApp.sResources.getString(R.string.combo_notification_check_time_date), Notification.NORMAL); Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, MainApp.sResources.getString(R.string.combo_notification_check_time_date), Notification.NORMAL);
MainApp.bus().post(new EventNewNotification(notification)); MainApp.bus().post(new EventNewNotification(notification));
} }