Add output button documentation (#1846)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
This commit is contained in:
parent
7b43258e06
commit
8617317065
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
|
@ -0,0 +1,49 @@
|
|||
Generic Output Button
|
||||
=====================
|
||||
|
||||
.. seo::
|
||||
:description: Instructions for setting up generic output buttons in ESPHome that control an output component.
|
||||
:image: upload.svg
|
||||
|
||||
The ``output`` button platform allows you to use any output component as a button. This can for example be used to
|
||||
momentarily set a GPIO pin using a button.
|
||||
|
||||
.. figure:: images/generic-ui.png
|
||||
:align: center
|
||||
:width: 80.0%
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
# Example configuration entry
|
||||
output:
|
||||
- platform: gpio
|
||||
pin: 25
|
||||
id: output1
|
||||
|
||||
button:
|
||||
- platform: output
|
||||
name: "Generic Output"
|
||||
output: output1
|
||||
duration: 500ms
|
||||
|
||||
Configuration variables:
|
||||
------------------------
|
||||
|
||||
- **name** (**Required**, string): The name for the button.
|
||||
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
|
||||
- **output** (**Required**, :ref:`config-id`): The ID of the output component to use.
|
||||
- **duration** (**Required**, :ref:`config-time`): How long the output should be set when the button is pressed.
|
||||
- All other options from :ref:`Button <config-button>`.
|
||||
|
||||
.. note::
|
||||
|
||||
When used with a :doc:`/components/output/gpio`, the pin will be low by default and pulled high when the button is
|
||||
pressed. To invert this behaviour and have the pin pulled low when the button is pressed, set the `inverted` option
|
||||
in the :ref:`config-pin_schema`.
|
||||
|
||||
See Also
|
||||
--------
|
||||
|
||||
- :doc:`/components/output/index`
|
||||
- :apiref:`output/button/output_button.h`
|
||||
- :ghedit:`Edit`
|
|
@ -484,6 +484,7 @@ Button Components
|
|||
|
||||
Button Core, components/button/index, folder-open.svg
|
||||
Template Button, components/button/template, description.svg
|
||||
Generic Output Button, components/button/output, upload.svg
|
||||
Restart Button, components/button/restart, restart.svg
|
||||
Wake-on-LAN, components/button/wake_on_lan, power_settings.svg
|
||||
|
||||
|
|
Loading…
Reference in New Issue