From b05301b1497942167a015a6113b7f424e42942cd Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Tue, 31 Dec 2019 17:24:47 +0100 Subject: [PATCH] Refactor change --- tasmota/xdrv_10_rules.ino | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tasmota/xdrv_10_rules.ino b/tasmota/xdrv_10_rules.ino index 2b390bec9..78cb73e10 100644 --- a/tasmota/xdrv_10_rules.ino +++ b/tasmota/xdrv_10_rules.ino @@ -439,13 +439,11 @@ bool RuleSetProcess(uint8_t rule_set, String &event_saved) ucommand.toUpperCase(); // if (!ucommand.startsWith("BACKLOG")) { commands = "backlog " + commands; } // Always use Backlog to prevent power race exception - -// if ((ucommand.indexOf("EVENT ") != -1) && (ucommand.indexOf("BACKLOG ") == -1)) { -// commands = "backlog " + commands; // Always use Backlog with event to prevent rule event loop exception -// } - - if ((ucommand.indexOf("IF ") == -1) && (ucommand.indexOf("EVENT ") != -1) && (ucommand.indexOf("BACKLOG ") == -1)) { - commands = "backlog " + commands; // Use Backlog with event unless IF is used which uses an implicit backlog to prevent rule event loop exception + // Use Backlog with event to prevent rule event loop exception unless IF is used which uses an implicit backlog + if ((ucommand.indexOf("IF ") == -1) && + (ucommand.indexOf("EVENT ") != -1) && + (ucommand.indexOf("BACKLOG ") == -1)) { + commands = "backlog " + commands; } RulesVarReplace(commands, F("%VALUE%"), Rules.event_value);