Only raise notification to check pump time when the latter could be read.
This commit is contained in:
parent
b4d2d9f71d
commit
8b81925ccb
1 changed files with 7 additions and 5 deletions
|
@ -690,12 +690,14 @@ public class ComboPlugin implements PluginBase, PumpInterface, ConstraintsInterf
|
||||||
if (mismatch) checkPumpHistory();
|
if (mismatch) checkPumpHistory();
|
||||||
|
|
||||||
// raise notification if clock is off (setting clock is not supported by ruffy)
|
// raise notification if clock is off (setting clock is not supported by ruffy)
|
||||||
Date now = new Date();
|
if (preCheckResult.state.pumpTimeMinutesOfDay != 0) {
|
||||||
int minutesOfDayNow = now.getHours() * 60 + now.getMinutes();
|
Date now = new Date();
|
||||||
if ((Math.abs(preCheckResult.state.pumpTimeMinutesOfDay - minutesOfDayNow) > 3)) {
|
int minutesOfDayNow = now.getHours() * 60 + now.getMinutes();
|
||||||
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, "Check pump clock", Notification.NORMAL);
|
if ((Math.abs(preCheckResult.state.pumpTimeMinutesOfDay - minutesOfDayNow) > 3)) {
|
||||||
MainApp.bus().post(new EventNewNotification(notification));
|
Notification notification = new Notification(Notification.COMBO_PUMP_ALARM, "Check pump clock", Notification.NORMAL);
|
||||||
|
MainApp.bus().post(new EventNewNotification(notification));
|
||||||
// runCommand("Updating pump clock", 2, ruffyScripter::setDateAndTime);
|
// runCommand("Updating pump clock", 2, ruffyScripter::setDateAndTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue