Docs for repeat action (#1604)

This commit is contained in:
Oxan van Leeuwen 2021-11-10 22:08:37 +01:00 committed by GitHub
parent ebc6513223
commit b6189bef9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -561,6 +561,30 @@ Configuration variables:
- **condition** (**Required**): The condition to check whether to execute. See :ref:`Conditions <config-condition>`.
- **then** (**Required**, :ref:`config-action`): The action to perform until the condition evaluates to false.
.. _repeat_action:
``repeat`` Action
-----------------
This action allows you to repeat a block a given number of times.
For example, the automation below will flash the light five times.
.. code-block:: yaml
on_...:
- repeat:
count: 5
then:
- light.turn_on: some_light
- delay: 1s
- light.turn_off: some_light
- delay: 10s
Configuration variables:
- **count** (**Required**, integer): The number of times the action should be repeated.
- **then** (**Required**, :ref:`config-action`): The action to repeat.
.. _wait_until_action:
``wait_until`` Action