Add cover toggle support (#1189)

* Add cover toggle support

Step through open/stop/close/stop sequence with every toggle

* Tweak

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Daniel Müller 2021-09-27 22:31:20 +02:00 committed by GitHub
parent b40fe3ca16
commit c60b571a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -110,6 +110,31 @@ This :ref:`action <config-action>` stops the cover with the given ID when execut
call.set_command_stop();
call.perform();
.. _cover-toggle_action:
``cover.toggle`` Action
-----------------------
This :ref:`action <config-action>` toggles the cover with the given ID when executed,
cycling through the states close/stop/open/stop... This allows the cover to be controlled
by a single push button.
.. code-block:: yaml
on_...:
then:
- cover.toggle: cover_1
.. note::
This action can also be expressed in :ref:`lambdas <config-lambda>`:
.. code-block:: cpp
auto call = id(cover_1).make_call();
call.set_command_toggle();
call.perform();
.. _cover-control_action:
``cover.control`` Action