mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-01-28 22:42:05 +01:00
Add interval docs
This commit is contained in:
parent
d6b902616e
commit
3327997f5b
@ -317,6 +317,8 @@ All Triggers
|
|||||||
- :ref:`binary_sensor.on_click <binary_sensor-on_click>` / :ref:`binary_sensor.on_double_click <binary_sensor-on_double_click>` / :ref:`binary_sensor.on_multi_click <binary_sensor-on_multi_click>`
|
- :ref:`binary_sensor.on_click <binary_sensor-on_click>` / :ref:`binary_sensor.on_double_click <binary_sensor-on_double_click>` / :ref:`binary_sensor.on_multi_click <binary_sensor-on_multi_click>`
|
||||||
- :ref:`esphomeyaml.on_boot <esphomeyaml-on_boot>` / :ref:`esphomeyaml.on_shutdown <esphomeyaml-on_shutdown>` / :ref:`esphomeyaml.on_loop <esphomeyaml-on_loop>`
|
- :ref:`esphomeyaml.on_boot <esphomeyaml-on_boot>` / :ref:`esphomeyaml.on_shutdown <esphomeyaml-on_shutdown>` / :ref:`esphomeyaml.on_loop <esphomeyaml-on_loop>`
|
||||||
- :ref:`pn532.on_tag <pn532-on_tag>`
|
- :ref:`pn532.on_tag <pn532-on_tag>`
|
||||||
|
- :ref:`time.on_time <time-on_time>`
|
||||||
|
- :ref:`interval.interval <interval>`
|
||||||
|
|
||||||
All Actions
|
All Actions
|
||||||
-----------
|
-----------
|
||||||
@ -555,6 +557,29 @@ Please note this is only useful right now if your script contains a ``delay`` ac
|
|||||||
then:
|
then:
|
||||||
- script.stop: my_script
|
- script.stop: my_script
|
||||||
|
|
||||||
|
.. _interval:
|
||||||
|
|
||||||
|
``interval``
|
||||||
|
------------
|
||||||
|
|
||||||
|
This component allows you to run actions periodically with a fixed interval.
|
||||||
|
For example if you want to toggle a switch every minute, you can use this component.
|
||||||
|
Please note that this certain cases are also possible with the :ref:`time.on_time <time-on_time>`
|
||||||
|
trigger, but this one is more light-weight and user-friendly.
|
||||||
|
|
||||||
|
.. code-block:: yaml
|
||||||
|
|
||||||
|
# Example configuration entry
|
||||||
|
interval:
|
||||||
|
- interval: 1min
|
||||||
|
then:
|
||||||
|
- switch.toggle: relay_1
|
||||||
|
|
||||||
|
Configuration options:
|
||||||
|
|
||||||
|
- **interval** (**Required**, :ref:`config-time`): The interval to execute the action with.
|
||||||
|
- **then** (**Required**, :ref:`config-action`): The action to perform.
|
||||||
|
|
||||||
See Also
|
See Also
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user