Skip to content

Commit

Permalink
improve information on if and expression
Browse files Browse the repository at this point in the history
  • Loading branch information
barbudor committed Oct 5, 2023
1 parent d462703 commit 05ec205
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions docs/Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,16 @@ Rule1 "
## Conditional Rules
!!! failure "This feature is not included in precompiled binaries."
To use it you must [compile your build](Compile-your-build). Add the following to `user_config_override.h`:
```arduino
#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)
```
!!! failure
This features is not included in standard ESP8266 binaries such as `tasmota`, `tasmota-sensors`, `tasmota-lite`.
To use it, you must [compile your build](Compile-your-build) and add the following to `user_config_override.h`:
```arduino
#define SUPPORT_IF_STATEMENT // Add support for IF statement in rules (+4k2 code, -332 bytes mem)
```
!!! note
This feature is included in ESP32 builds as well as in ESP8266 builds for boards with more than 1MB Flash. This include `tasmota-4M`, `tasmota-zbbridge`, `tasmota-zigbee`.
----
#### Major features
Expand Down Expand Up @@ -369,13 +373,16 @@ Rule1
## Expressions in Rules
!!! failure "This feature is not included in precompiled binaries."
!!! failure
This features is not included in standard ESP8266 binaries such as `tasmota`, `tasmota-sensors`, `tasmota-lite`.
To use it, you must [compile your build](Compile-your-build) and add the following to `user_config_override.h`:
To use it you must [compile your build](Compile-your-build). Add the following to `user_config_override.h`:
```arduino
#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)
```
```arduino
#define USE_EXPRESSION // Add support for expression evaluation in rules (+3k2 code, +64 bytes mem)
```
!!! note
This feature is included in ESP32 builds as well as in ESP8266 builds for boards with more than 1MB Flash. This include `tasmota-4M`, `tasmota-zbbridge`, `tasmota-zigbee`.
----
Beginning with Tasmota version 6.4.1.14, an optional feature for using mathematical expressions in rules was introduced.
Expand All @@ -399,7 +406,7 @@ Expressions can use of the following operators. They are listed by the order of
!!! example
* `1+2*2` results in 5.0 as the multiplication is done first due to its higher priority
* `(1+2)*2` results in 6.0
* `(1+2)*2` results in 6.0
In addition to numeric constants, the following symbolic values can be used:
Expand Down

0 comments on commit 05ec205

Please sign in to comment.