[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:
TD-er
2022-11-14 10:27:15 +01:00
parent e05a24845f
commit e05d00c93e
3 changed files with 17 additions and 4 deletions
+5 -1
View File
@@ -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)
---------------------------------
+6 -1
View File
@@ -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)
---------------------------------
+6 -2
View File
@@ -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
.. ~~~~~~~~~~~~~~~~~~