esphome-docs/esphomeyaml/components/switch/index.rst
2018-05-17 17:34:45 +02:00

59 lines
2.1 KiB
ReStructuredText
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Switch Component
================
The ``switch`` domain includes all platforms that should show up like a
switch and can only be turned ON or OFF.
Currently supported switch platforms:
======================== ======================== ========================
|GPIO Switch|_ |IR Transmitter|_ |Restart Switch|_
------------------------ ------------------------ ------------------------
`GPIO Switch`_ `IR Transmitter`_ `Restart Switch`_
------------------------ ------------------------ ------------------------
|Shutdown Switch|_ |Output Switch|_
------------------------ ------------------------ ------------------------
`Shutdown Switch`_ `Output Switch`_
======================== ======================== ========================
.. |GPIO Switch| image:: /esphomeyaml/images/pin.svg
:class: component-image
.. _GPIO Switch: /esphomeyaml/components/switch/gpio.html
.. |IR Transmitter| image:: /esphomeyaml/images/remote.svg
:class: component-image
.. _IR Transmitter: /esphomeyaml/components/switch/ir_transmitter.html
.. |Restart Switch| image:: /esphomeyaml/images/restart.svg
:class: component-image
.. _Restart Switch: /esphomeyaml/components/switch/restart.html
.. |Shutdown Switch| image:: /esphomeyaml/images/power.svg
:class: component-image
.. _Shutdown Switch: /esphomeyaml/components/switch/shutdown.html
.. |Output Switch| image:: /esphomeyaml/images/upload.svg
:class: component-image
.. _Output Switch: /esphomeyaml/components/switch/output.html
Base Switch Configuration
-------------------------
.. code:: yaml
switch:
- platform: ...
name: "Switch Name"
icon: "mdi:restart"
Configuration variables:
- **name** (**Required**, string): The name of the switch.
- **icon** (*Optional*, icon): Manually set the icon to use for the
sensor in the frontend.
- **inverted** (*Optional*, boolean): Whether to invert the binary
state, i.e. report ON states as OFF and vice versa. Defaults
to ``False``.
- All other options from `MQTT
Component </esphomeyaml/components/mqtt.html#mqtt-component-base-configuration>`__.