mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-09-12 01:24:04 +00:00
[Docs] Update rules docs not using %eventvalue1%
Example on the [forum](https://www.letscontrolit.com/forum/viewtopic.php?p=60959#p60959)
This commit is contained in:
@@ -207,7 +207,7 @@ Rules examples
|
||||
.. code-block:: none
|
||||
|
||||
On Switch#State Do
|
||||
if [Switch#State]=1
|
||||
if %eventvalue1%=1
|
||||
GPIO,12,1
|
||||
else
|
||||
GPIO,12,0
|
||||
@@ -216,6 +216,10 @@ Rules examples
|
||||
|
||||
This rule will turn the relay ON when the button is pressed, and OFF when released.
|
||||
|
||||
.. note::
|
||||
Events may be handled from an event queue, so by the time the event is being handled, the state of the switch can already be different.
|
||||
Therefore it is best to use the state of the switch at the time the event was generated,using ``%eventvalue1%`` .
|
||||
|
||||
Indicators (recommended settings)
|
||||
---------------------------------
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ Rules examples
|
||||
.. code-block:: none
|
||||
|
||||
On Switch#State Do
|
||||
if [Switch#State]=1
|
||||
if %eventvalue1%=1
|
||||
Servo,1,12,-45
|
||||
Servo,2,14,45
|
||||
else
|
||||
@@ -62,6 +62,11 @@ Rules examples
|
||||
|
||||
This rule will tilt the servos 45° when the button is pressed, and it'll go back to 0 once released.
|
||||
|
||||
.. note::
|
||||
Events may be handled from an event queue, so by the time the event is being handled, the state of the switch can already be different.
|
||||
Therefore it is best to use the state of the switch at the time the event was generated,using ``%eventvalue1%`` .
|
||||
|
||||
|
||||
Indicators (recommended settings)
|
||||
---------------------------------
|
||||
|
||||
|
||||
@@ -131,15 +131,19 @@ Rules examples
|
||||
.. code-block:: none
|
||||
|
||||
on Switch#State do
|
||||
if [Switch#State]=3
|
||||
if %eventvalue1%=3
|
||||
//double click triggered!
|
||||
GPIO,12,0
|
||||
else
|
||||
GPIO,2,[Switch#State]
|
||||
GPIO,2,%eventvalue1%
|
||||
GPIO,12,1
|
||||
endif
|
||||
endon
|
||||
|
||||
.. note::
|
||||
Events may be handled from an event queue, so by the time the event is being handled, the state of the switch can already be different.
|
||||
Therefore it is best to use the state of the switch at the time the event was generated,using ``%eventvalue1%`` .
|
||||
|
||||
.. Commands available
|
||||
.. ~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
Reference in New Issue
Block a user