diff --git a/Rules---IF-ELSE-ELSEIF-and-AND-OR-Support.md b/Rules---IF-ELSE-ELSEIF-and-AND-OR-Support.md index 81728ec2..30cf9628 100644 --- a/Rules---IF-ELSE-ELSEIF-and-AND-OR-Support.md +++ b/Rules---IF-ELSE-ELSEIF-and-AND-OR-Support.md @@ -1,6 +1,3 @@ -> :warning: :warning: :warning: EXPERIMENTAL :warning: :warning: :warning: -**This feature is still under development** - By default, Both EXPRESSION and IF support is disabled. In order to enable IF support, please add these lines in `user_config_override.h`: - `#define USE_EXPRESSION` // Add support for expression evaluation in rules (+3k2 code, +64 bytes mem) - `#define SUPPORT_IF_STATEMENT` // Add support for IF statement in rules (+4k2 code, -332 bytes mem) @@ -39,17 +36,17 @@ IF statement supports 3 formats: - `IF () [ELSEIF () ] ELSE ENDIF` `` is a logical expression, for example: -- `VAR1 >= 10` +- `VAR1>=10` - Multiple comparison expression with logical operator `AND` or `OR` between them. `AND` has higher priority than `OR`. For example: -`UPTIME > 100 AND MEM1 == 1 OR MEM2 == 1` +`UPTIME>100 AND MEM1==1 OR MEM2==1` Parenthesis can be used to change the priority of logical expression. For example: -`UPTIME > 100 AND (MEM1 == 1 OR MEM2 == 1)` +`UPTIME>100 AND (MEM1==1 OR MEM2==1)` `` - A Sonoff-Tasmota command (e.g.,`LedPower on`) - Another IF statement (`IF ... ENDIF`) - Multiple Sonoff-Tasmota commands or IF statements separated by `;`. For example: - `Power1 off; LedPower on; IF (Mem1 == 0) Var1 Var1+1; Mem1 1 ENDIF; Delay 10; Power1 on` + `Power1 off; LedPower on; IF (Mem1==0) Var1 Var1+1; Mem1 1 ENDIF; Delay 10; Power1 on` `Backlog` is implied and is not required (saves rule set buffer space). ## Example