Add on_open and on_closed triggers to cover (#1524)

This commit is contained in:
Chris Nussbaum 2021-10-11 21:39:24 -05:00 committed by GitHub
parent ce1165cd90
commit af2933a560
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -222,6 +222,36 @@ fields are read-only, if you want to act on the cover, use the ``make_call()`` m
// Cover is currently closing
}
.. _cover-on_open_trigger:
``cover.on_open`` Trigger
*************************
This trigger is activated each time the cover reaches a fully open state.
.. code-block:: yaml
cover:
- platform: template # or any other platform
# ...
on_open:
- logger.log: "Cover is Open!"
.. _cover-on_closed_trigger:
``cover.on_closed`` Trigger
***************************
This trigger is activated each time the cover reaches a fully closed state.
.. code-block:: yaml
cover:
- platform: template # or any other platform
# ...
on_closed:
- logger.log: "Cover is Closed!"
See Also
--------

View File

@ -338,6 +338,7 @@ All Triggers
:ref:`ota.on_end <ota-on_end>` / :ref:`ota.on_error <ota-on_error>` /
:ref:`ota.on_state_change <ota-on_state_change>`
- :ref:`display.on_page_change <display-on_page_change-trigger>`
- :ref:`cover.on_open <cover-on_open_trigger>` / :ref:`cover.on_closed <cover-on_closed_trigger>`
All Actions
-----------