mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Refactor change
This commit is contained in:
parent
c13b755a59
commit
b05301b149
@ -439,13 +439,11 @@ bool RuleSetProcess(uint8_t rule_set, String &event_saved)
|
|||||||
ucommand.toUpperCase();
|
ucommand.toUpperCase();
|
||||||
|
|
||||||
// if (!ucommand.startsWith("BACKLOG")) { commands = "backlog " + commands; } // Always use Backlog to prevent power race exception
|
// if (!ucommand.startsWith("BACKLOG")) { commands = "backlog " + commands; } // Always use Backlog to prevent power race exception
|
||||||
|
// Use Backlog with event to prevent rule event loop exception unless IF is used which uses an implicit backlog
|
||||||
// if ((ucommand.indexOf("EVENT ") != -1) && (ucommand.indexOf("BACKLOG ") == -1)) {
|
if ((ucommand.indexOf("IF ") == -1) &&
|
||||||
// commands = "backlog " + commands; // Always use Backlog with event to prevent rule event loop exception
|
(ucommand.indexOf("EVENT ") != -1) &&
|
||||||
// }
|
(ucommand.indexOf("BACKLOG ") == -1)) {
|
||||||
|
commands = "backlog " + commands;
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RulesVarReplace(commands, F("%VALUE%"), Rules.event_value);
|
RulesVarReplace(commands, F("%VALUE%"), Rules.event_value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user