From 4b097030095bc2a45a7798e8f4e6bda7a93940b2 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:52:16 +1200 Subject: [PATCH] [button] Tidy up name/id (#4139) --- components/button/factory_reset.rst | 4 +--- components/button/index.rst | 3 ++- components/button/output.rst | 2 -- components/button/restart.rst | 4 +--- components/button/safe_mode.rst | 4 +--- components/button/shutdown.rst | 4 +--- components/button/template.rst | 4 +--- components/button/uart.rst | 2 -- components/button/wake_on_lan.rst | 2 -- 9 files changed, 7 insertions(+), 22 deletions(-) diff --git a/components/button/factory_reset.rst b/components/button/factory_reset.rst index 03e1bfe09..f8ed5a97a 100644 --- a/components/button/factory_reset.rst +++ b/components/button/factory_reset.rst @@ -35,9 +35,7 @@ After reboot all states, parameters and variables will be reinitialized with the Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the button. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- All other options from :ref:`Button `. +- All options from :ref:`Button `. See Also -------- diff --git a/components/button/index.rst b/components/button/index.rst index 0151b7c69..921d37848 100644 --- a/components/button/index.rst +++ b/components/button/index.rst @@ -40,7 +40,8 @@ All buttons in ESPHome have a name and an optional icon. Configuration variables: -- **name** (**Required**, string): The name for the button. +- **id** (*Optional*, string): Manually specify the ID for code generation. At least one of **id** and **name** must be specified. +- **name** (*Optional*, string): The name for the button. At least one of **id** and **name** must be specified. .. note:: diff --git a/components/button/output.rst b/components/button/output.rst index d037730fc..e54d70462 100644 --- a/components/button/output.rst +++ b/components/button/output.rst @@ -29,8 +29,6 @@ momentarily set a GPIO pin using a button. 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 `. diff --git a/components/button/restart.rst b/components/button/restart.rst index 03be784b7..0f6d44519 100644 --- a/components/button/restart.rst +++ b/components/button/restart.rst @@ -18,9 +18,7 @@ through Home Assistant. Configuration variables: ------------------------ -- **name** (**Required**, string): The name for the button. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- All other options from :ref:`Button `. +- All options from :ref:`Button `. See Also -------- diff --git a/components/button/safe_mode.rst b/components/button/safe_mode.rst index 45fe8534a..7342d08e2 100644 --- a/components/button/safe_mode.rst +++ b/components/button/safe_mode.rst @@ -24,9 +24,7 @@ This component requires :doc:`/components/safe_mode` to be configured. Configuration variables: ------------------------ -- **name** (**Required**, string): The name for the button. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- All other options from :ref:`Button `. +- All options from :ref:`Button `. See Also -------- diff --git a/components/button/shutdown.rst b/components/button/shutdown.rst index 68dadc518..c6d363b50 100644 --- a/components/button/shutdown.rst +++ b/components/button/shutdown.rst @@ -24,9 +24,7 @@ pressing the reset button or restarting the power supply. Configuration variables: ------------------------ -- **name** (**Required**, string): The name for the button. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- All other options from :ref:`Button `. +- All options from :ref:`Button `. See Also -------- diff --git a/components/button/template.rst b/components/button/template.rst index 11095ab82..cc8d3965a 100644 --- a/components/button/template.rst +++ b/components/button/template.rst @@ -20,9 +20,7 @@ it will automatically appear in Home Assistant as a button and can be controlled Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the switch. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- All other options from :ref:`Button `. +- All options from :ref:`Button `. See Also -------- diff --git a/components/button/uart.rst b/components/button/uart.rst index 565e42af2..174d7b827 100644 --- a/components/button/uart.rst +++ b/components/button/uart.rst @@ -22,8 +22,6 @@ The ``uart`` button platform allows you to send a pre-defined sequence of bytes Configuration variables: ------------------------ -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- **name** (*Optional*, string): The name for the button. - **data** (**Required**, string or list of bytes): The data to send via UART. Either an ASCII string or a list of bytes. - **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the UART hub. diff --git a/components/button/wake_on_lan.rst b/components/button/wake_on_lan.rst index 10b510201..b91e5f3ba 100644 --- a/components/button/wake_on_lan.rst +++ b/components/button/wake_on_lan.rst @@ -19,9 +19,7 @@ by specifying its MAC address. Configuration variables: ------------------------ -- **name** (**Required**, string): The name for the button. - **target_mac_address** (**Required**, MAC Address): The MAC Address of the target computer. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Button `. See Also