[select] Tidy up name/id (#4149)

This commit is contained in:
Jesse Hills 2024-08-14 14:33:14 +12:00 committed by GitHub
parent 9892a0fce9
commit 7d4690f362
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 3 additions and 8 deletions

View File

@ -30,7 +30,8 @@ All selects in ESPHome have a name and an optional icon.
Configuration variables:
- **name** (**Required**, string): The name for the select.
- **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 select. At least one of **id** and **name** must be specified.
.. note::

View File

@ -10,7 +10,6 @@ registers.
Configuration variables:
------------------------
- **name** (**Required**, string): The name of the Select.
- **address** (**Required**, int): The start address of the first or only register
of the Select (can be decimal or hexadecimal).
- **optionsmap** (**Required**, Map[str, int]): Provide a mapping from options (str) of
@ -38,7 +37,6 @@ Configuration variables:
- **force_new_range** (*Optional*, boolean): If possible sensors with sequential addresses are
grouped together and requested in one range. Setting this to ``true`` enforces the start of a new
range at that address.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`): Lambda to be evaluated every update interval
to get the current option of the select.
@ -57,7 +55,7 @@ Configuration variables:
- **write_lambda** (*Optional*, :ref:`lambda <config-lambda>`): Lambda to be evaluated on every update
of the Sensor, before the new value is written to the modbus registers.
- **use_write_multiple** (*Optional*, boolean): By default the modbus command *Function Code 6 (Preset Single Registers)*
- **use_write_multiple** (*Optional*, boolean): By default the modbus command *Function Code 6 (Preset Single Registers)*
is used for setting the holding register if only one register is set. If your device only supports *Function Code 16 (Preset Multiple Registers)* set this option to ``true``.
- **optimistic** (*Optional*, boolean): Whether to operate in optimistic mode - when in this mode,
any command sent to the Modbus Select will immediately update the reported state. Defaults

View File

@ -25,7 +25,6 @@ using :ref:`lambdas <config-lambda>`.
Configuration variables:
------------------------
- **name** (**Required**, string): The name of the Select.
- **options** (**Required**, list): The list of options this Select has.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`):
Lambda to be evaluated every update interval to get the current option of the select.
@ -42,7 +41,6 @@ Configuration variables:
- **initial_option** (*Optional*, string): The option to set the option to on setup if not
restored with ``restore_value``.
Cannot be used with ``lambda``. Defaults to the first option in the ``options`` list.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Select <config-select>`.
.. note::

View File

@ -49,8 +49,6 @@ Based on this, you can create the select as follows:
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the switch.
- **enum_datapoint** (**Required**, int): The enum datapoint id number for the select.
- **options** (**Required**, Map[int, str]): Provide a mapping from values (int) of
this Select to options (str) of the *enum_datapoint* and vice versa. All options and