mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-01-23 21:51:53 +01:00
Add initial_run to regular lambda effect (#1806)
This commit is contained in:
parent
16cdfe44dc
commit
021272ecee
@ -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
|
||||
**************************
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user