From 0af60409292b8685fdac44f6443f96b5572bc6d2 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:53:49 +1200 Subject: [PATCH] [binary_sensor] Tidy up name/id (#4138) --- components/binary_sensor/analog_threshold.rst | 2 -- components/binary_sensor/ble_presence.rst | 3 --- components/binary_sensor/cap1188.rst | 2 -- components/binary_sensor/esp32_touch.rst | 2 -- components/binary_sensor/gpio.rst | 2 -- components/binary_sensor/homeassistant.rst | 2 -- components/binary_sensor/hydreon_rgxx.rst | 18 +++--------------- components/binary_sensor/index.rst | 3 ++- components/binary_sensor/modbus_controller.rst | 2 -- components/binary_sensor/mpr121.rst | 2 -- components/binary_sensor/nextion.rst | 1 - components/binary_sensor/pn532.rst | 2 -- components/binary_sensor/rc522.rst | 2 -- components/binary_sensor/rdm6300.rst | 2 -- components/binary_sensor/status.rst | 4 +--- components/binary_sensor/template.rst | 4 ---- components/binary_sensor/ttp229.rst | 4 ---- components/binary_sensor/tuya.rst | 2 -- 18 files changed, 6 insertions(+), 53 deletions(-) diff --git a/components/binary_sensor/analog_threshold.rst b/components/binary_sensor/analog_threshold.rst index 236eed00f..f006afdfc 100644 --- a/components/binary_sensor/analog_threshold.rst +++ b/components/binary_sensor/analog_threshold.rst @@ -36,8 +36,6 @@ a binary sensor. Configuration variables ----------------------- -- **name** (**Required**, string): The name of the binary sensor. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - **sensor_id** (**Required**, :ref:`config-id`): The ID of the source sensor. - **threshold** (**Required**, float or mapping): Configures the reference for comparison. Accepts either a shorthand float number that will be used as both upper/lower threshold, or a mapping to define different values for each (to diff --git a/components/binary_sensor/ble_presence.rst b/components/binary_sensor/ble_presence.rst index 412049a50..c8a5c6565 100644 --- a/components/binary_sensor/ble_presence.rst +++ b/components/binary_sensor/ble_presence.rst @@ -54,7 +54,6 @@ The ``ble_presence`` binary sensor platform lets you track the presence of a Blu Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the binary sensor. - **mac_address** (*Optional*, MAC Address): The MAC address to track for this binary sensor. Note that exactly one of ``mac_address``, ``irk``, ``service_uuid`` or ``ibeacon_uuid`` must be present. @@ -72,8 +71,6 @@ Configuration variables: same building. - **ibeacon_minor** (*Optional*, int): The iBeacon minor identifier of the beacon that needs to be tracked. Usually used to identify beacons within an iBeacon group. -- **id** (*Optional*, :ref:`config-id`): Manually specify - the ID used for code generation. - **min_rssi** (*Optional*, int): at which minimum RSSI level would the component report the device be present. - **timeout** (*Optional*, :ref:`config-time`): The delay after last detecting the device before publishing not present state. The default is 5 minutes. diff --git a/components/binary_sensor/cap1188.rst b/components/binary_sensor/cap1188.rst index 016720311..65f0608cc 100644 --- a/components/binary_sensor/cap1188.rst +++ b/components/binary_sensor/cap1188.rst @@ -68,9 +68,7 @@ binary sensors for each touch sensor. Configuration variables: -- **name** (*Optional*, string): The name for the binary sensor. - **cap1188_id** (*Optional*, :ref:`config-id`): The ID of the CAP1188 defined above. Useful for multiple CAP1188's on the I²C bus. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - **channel** (**Required**, int): The channel number the CAP1188 the touchkey is connected to. - All other options from :ref:`Binary Sensor `. diff --git a/components/binary_sensor/esp32_touch.rst b/components/binary_sensor/esp32_touch.rst index 7c6bc25f3..72153999a 100644 --- a/components/binary_sensor/esp32_touch.rst +++ b/components/binary_sensor/esp32_touch.rst @@ -141,8 +141,6 @@ Configuration variables: events on. - **threshold** (**Required**, ``int``): The threshold to use to detect touch events. See :ref:`esp32-finding-thresholds` below for help determining this value. -- **name** (**Required**, string): The name of the binary sensor. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - **wakeup_threshold** (*Optional*, ``int``): The threshold to use to detect touch events to wake-up from deep sleep. See :ref:`esp32-finding-thresholds` below for help determining this value. Touch pad sensors that should trigger a wake-up from deep sleep must specify this value. The :ref:`deep_sleep-component` must also be configured to enable diff --git a/components/binary_sensor/gpio.rst b/components/binary_sensor/gpio.rst index 65aefcb12..465cddd28 100644 --- a/components/binary_sensor/gpio.rst +++ b/components/binary_sensor/gpio.rst @@ -27,8 +27,6 @@ Configuration variables: ------------------------ - **pin** (**Required**, :ref:`Pin Schema `): The pin to periodically check. -- **name** (**Required**, string): The name of the binary sensor. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Binary Sensor `. Activating internal pullups diff --git a/components/binary_sensor/homeassistant.rst b/components/binary_sensor/homeassistant.rst index 2628c5d58..b822a075b 100644 --- a/components/binary_sensor/homeassistant.rst +++ b/components/binary_sensor/homeassistant.rst @@ -30,11 +30,9 @@ With Home Assistant 2021.6 or newer, entity state attributes can also be importe Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the binary sensor. - **entity_id** (**Required**, string): The entity ID to import from Home Assistant. - **attribute** (*Optional*, string): The name of the state attribute to import from the specified entity. The entity state is used when this option is omitted. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Binary Sensor `. See Also diff --git a/components/binary_sensor/hydreon_rgxx.rst b/components/binary_sensor/hydreon_rgxx.rst index 47a5b7dba..d49864221 100644 --- a/components/binary_sensor/hydreon_rgxx.rst +++ b/components/binary_sensor/hydreon_rgxx.rst @@ -34,27 +34,15 @@ Configuration variables: - **too_cold** (*Optional*): ``true`` if the sensor reports being too cold. Hydreon only mentions this feature for the RG-9. - - **name** (**Required**, string): The name for the sensor. - - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - - All other options from :ref:`Binary Sensor `. + - All options from :ref:`Binary Sensor `. - **lens_bad** (*Optional*): ``true`` if the sensor reports the lens being bad. - - **name** (**Required**, string): The name for the sensor. - - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - - All other options from :ref:`Binary Sensor `. + - All options from :ref:`Binary Sensor `. - **em_sat** (*Optional*): ``true`` if the sensor reports the Emitter being saturated. - - **name** (**Required**, string): The name for the sensor. - - - **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas. - - - All other options from :ref:`Binary Sensor `. + - All options from :ref:`Binary Sensor `. See Also diff --git a/components/binary_sensor/index.rst b/components/binary_sensor/index.rst index fba4b9da6..949a2bf15 100644 --- a/components/binary_sensor/index.rst +++ b/components/binary_sensor/index.rst @@ -27,7 +27,8 @@ you can always override it. Configuration variables: -- **name** (**Required**, string): The name for the binary sensor. +- **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 binary sensor. At least one of **id** and **name** must be specified. .. note:: diff --git a/components/binary_sensor/modbus_controller.rst b/components/binary_sensor/modbus_controller.rst index 8e8ecea77..1ff315fe3 100644 --- a/components/binary_sensor/modbus_controller.rst +++ b/components/binary_sensor/modbus_controller.rst @@ -12,8 +12,6 @@ and requires :doc:`/components/modbus_controller` to be configured. Configuration variables: ------------------------ -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- **name** (**Required**, string): The name of the sensor. - **register_type** (**Required**): type of the modbus register. - ``coil``: Coils are 1-bit registers (ON/OFF values) that are used to control discrete outputs. Read and Write access. Modbus *Function Code 1 (Read Coil Status)* will be used. diff --git a/components/binary_sensor/mpr121.rst b/components/binary_sensor/mpr121.rst index 73fcd743b..4d41a2137 100644 --- a/components/binary_sensor/mpr121.rst +++ b/components/binary_sensor/mpr121.rst @@ -69,9 +69,7 @@ binary sensors for each touch sensor. Configuration variables: -- **name** (*Optional*, string): The name for the binary sensor. - **mpr121_id** (*Optional*, :ref:`config-id`): The ID of the MPR121 defined above. Useful for multiple MPR121's on the I²C bus -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - **channel** (**Required**, int): The channel number at the MPR121 the touchkey is connected to. - **touch_threshold** (*Optional*, int): A per-channel override of the global touch_threshold value. If not specified, uses the global value. - **release_threshold** (*Optional*, int): A per-channel override of the global release_threshold value. If not specified, uses the global value. diff --git a/components/binary_sensor/nextion.rst b/components/binary_sensor/nextion.rst index 9825c216f..2260ddb02 100644 --- a/components/binary_sensor/nextion.rst +++ b/components/binary_sensor/nextion.rst @@ -39,7 +39,6 @@ See :doc:`/components/display/nextion` for setting up the display Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the sensor. - **nextion_id** (*Optional*, :ref:`config-id`): The ID of the Nextion display. - **component_name** (*Optional*, string): The name of the Nextion component. - **variable_name** (*Optional*, string): The name of the Nextion variable. Any value over ``0`` is considered to be **on** diff --git a/components/binary_sensor/pn532.rst b/components/binary_sensor/pn532.rst index fe161c46d..c2db142a9 100644 --- a/components/binary_sensor/pn532.rst +++ b/components/binary_sensor/pn532.rst @@ -208,8 +208,6 @@ Configuration variables: - **uid** (**Required**, string): The unique ID of the NFC/RFID tag. This is a hyphen-separated list of hexadecimal values. For example ``74-10-37-94``. -- **name** (**Required**, string): The name of the binary sensor. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Binary Sensor `. .. _pn532-setting_up_tags: diff --git a/components/binary_sensor/rc522.rst b/components/binary_sensor/rc522.rst index 1c89732b1..837e797ca 100644 --- a/components/binary_sensor/rc522.rst +++ b/components/binary_sensor/rc522.rst @@ -189,8 +189,6 @@ Configuration variables: - **uid** (**Required**, string): The unique ID of the NFC/RFID tag. This is a hyphen-separated list of hexadecimal values. For example ``74-10-37-94``. -- **name** (**Required**, string): The name of the binary sensor. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Binary Sensor `. .. _rc522-setting_up_tags: diff --git a/components/binary_sensor/rdm6300.rst b/components/binary_sensor/rdm6300.rst index 11b102e6f..901a5db17 100644 --- a/components/binary_sensor/rdm6300.rst +++ b/components/binary_sensor/rdm6300.rst @@ -107,8 +107,6 @@ Configuration variables: ************************ - **uid** (**Required**, int): The unique ID of the NFC/RFID tag. -- **name** (**Required**, string): The name of the binary sensor. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Binary Sensor `. .. _rdm6300-setting_up_tags: diff --git a/components/binary_sensor/status.rst b/components/binary_sensor/status.rst index cdaac910a..b426031a1 100644 --- a/components/binary_sensor/status.rst +++ b/components/binary_sensor/status.rst @@ -22,9 +22,7 @@ for Home Assistant. Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the binary sensor. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- All other options from :ref:`Binary Sensor `. (Inverted mode is not supported) +- All options from :ref:`Binary Sensor `. (Inverted mode is not supported) See Also -------- diff --git a/components/binary_sensor/template.rst b/components/binary_sensor/template.rst index 85b70513d..c1c8e645b 100644 --- a/components/binary_sensor/template.rst +++ b/components/binary_sensor/template.rst @@ -36,12 +36,8 @@ Possible return values of the lambda: Configuration variables: ------------------------ -- **name** (**Required**, string): The name of the binary sensor. - **lambda** (*Optional*, :ref:`lambda `): Lambda to be evaluated repeatedly to get the current state of the binary sensor. -- **id** (*Optional*, - :ref:`config-id`): Manually specify - the ID used for code generation. - All other options from :ref:`Binary Sensor `. .. _binary_sensor-template-publish_action: diff --git a/components/binary_sensor/ttp229.rst b/components/binary_sensor/ttp229.rst index 6910db3b2..8fbf712fc 100644 --- a/components/binary_sensor/ttp229.rst +++ b/components/binary_sensor/ttp229.rst @@ -47,9 +47,7 @@ The configuration is made up of two parts: The central component, and individual Configuration variables: -- **name** (**Required**, string): The name of the binary sensor. - **channel** (**Required**, int): The channel number at the TTP229 the touchkey is connected to. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Binary Sensor `. ``ttp229_bsf`` Component @@ -85,9 +83,7 @@ Base Configuration: Configuration variables: -- **name** (**Required**, string): The name of the binary sensor. - **channel** (**Required**, int): The channel number at the TTP229 the touchkey is connected to. -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. - All other options from :ref:`Binary Sensor `. See Also diff --git a/components/binary_sensor/tuya.rst b/components/binary_sensor/tuya.rst index ab6489af2..30c362e69 100644 --- a/components/binary_sensor/tuya.rst +++ b/components/binary_sensor/tuya.rst @@ -20,8 +20,6 @@ You can create the binary sensor as follows: Configuration variables: ------------------------ -- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation. -- **name** (**Required**, string): The name of the binary sensor. - **sensor_datapoint** (**Required**, int): The datapoint id number of the binary sensor. - All other options from :ref:`Binary Sensor `.