Add initial_run to regular lambda effect (#1806)

This commit is contained in:
Jesse Hills 2022-01-21 11:09:11 +13:00 committed by GitHub
parent 16cdfe44dc
commit 021272ecee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -405,10 +405,10 @@ with the behavior of the ``light.is_on`` and ``light.is_off`` condition above.
``light.on_state`` Trigger
**************************
This trigger is activated each time the set light state is changed. It is not triggered
This trigger is activated each time the set light state is changed. It is not triggered
based on current state, but rather, it triggers on the set state which can differ from
the current state due to transitions. For example, the ``light.on_state`` trigger can
be used for immediate action when the light is set to off; while ``light.on_turn_off``
be used for immediate action when the light is set to off; while ``light.on_turn_off``
does not trigger until the light actually achieves the off state.
.. code-block:: yaml
@ -586,6 +586,10 @@ Lambda Effect
This effect allows you to write completely custom light effects yourself using :ref:`lambdas <config-lambda>`.
Available variable in the lambda:
- **initial_run** - A bool which is true on the first execution of the lambda. Useful to reset static variables when restarting an effect.
.. code-block:: yaml
light:
@ -622,6 +626,7 @@ Configuration variables:
- **lambda** (**Required**, :ref:`lambda <config-lambda>`): The code to execute. ``static`` variables are
especially useful.
Addressable Rainbow Effect
**************************