From 65985dc35f3c543e9939d91c587e0c1fa8fae94f Mon Sep 17 00:00:00 2001 From: Adrian Scillato <35405447+ascillato@users.noreply.github.com> Date: Sat, 19 May 2018 03:00:48 -0300 Subject: [PATCH] Fix 'vars' on Rules The 'vars' was not working from one rule to another because the declaration of the variable was not global and was being lost. --- sonoff/xdrv_10_rules.ino | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sonoff/xdrv_10_rules.ino b/sonoff/xdrv_10_rules.ino index 076e7333d..dfd26d534 100644 --- a/sonoff/xdrv_10_rules.ino +++ b/sonoff/xdrv_10_rules.ino @@ -88,6 +88,8 @@ uint32_t rules_triggers = 0; uint8_t rules_trigger_count = 0; uint8_t rules_teleperiod = 0; +char vars[RULES_MAX_VARS][10] = { 0 }; + /*******************************************************************************************/ long TimeDifference(unsigned long prev, unsigned long next) @@ -243,7 +245,6 @@ bool RulesRuleMatch(String &event, String &rule) bool RulesProcess() { bool serviced = false; - char vars[RULES_MAX_VARS][10] = { 0 }; char stemp[10]; delay(0); // Prohibit possible loop software watchdog @@ -488,4 +489,4 @@ boolean Xdrv10(byte function) return result; } -#endif // USE_RULES \ No newline at end of file +#endif // USE_RULES