mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-10-05 05:27:54 +02:00
59 lines
2.1 KiB
ReStructuredText
59 lines
2.1 KiB
ReStructuredText
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>`__.
|