Skip to content

Commit

Permalink
[Docs] Update rules docs not using %eventvalue1%
Browse files Browse the repository at this point in the history
  • Loading branch information
TD-er committed Nov 14, 2022
1 parent e05a248 commit e05d00c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
6 changes: 5 additions & 1 deletion docs/source/Plugin/P000_Relay.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
---------------------------------

Expand Down
7 changes: 6 additions & 1 deletion docs/source/Plugin/P000_Servo_motor.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
---------------------------------

Expand Down
8 changes: 6 additions & 2 deletions docs/source/Plugin/P001_Switch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
.. ~~~~~~~~~~~~~~~~~~
Expand Down

0 comments on commit e05d00c

Please sign in to comment.