Don't raise alerts if loop is disabled.

(cherry picked from commit dc7fd2b)
This commit is contained in:
Johannes Mockenhaupt 2017-08-30 15:06:00 +02:00
parent 9d6ff73b34
commit 9649682ae3
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -139,7 +139,8 @@ public class ComboPlugin implements PluginBase, PumpInterface {
if (localLastCmdResult != null && !localLastCmdResult.success) {
long now = System.currentTimeMillis();
long fiveMinutesSinceLastAlarm = lastAlarmTime + (5 * 60 * 1000) + (15 * 1000);
if (now > fiveMinutesSinceLastAlarm) {
boolean loopEnabled = ConfigBuilderPlugin.getActiveLoop() != null;
if (now > fiveMinutesSinceLastAlarm && loopEnabled) {
log.error("Command failed: " + localLastCmd);
log.error("Command result: " + localLastCmdResult);
PumpState localPumpState = pump.state;