From 5cdd6500232c15bb4211811c7a670b3d42b0d995 Mon Sep 17 00:00:00 2001 From: Dawid Pietryga Date: Sat, 22 Jun 2024 13:35:26 +0200 Subject: [PATCH] Add satel integra binary switches unique_id (#118660) --- .../components/satel_integra/binary_sensor.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/satel_integra/binary_sensor.py b/homeassistant/components/satel_integra/binary_sensor.py index b668ced326c..209b6c38cda 100644 --- a/homeassistant/components/satel_integra/binary_sensor.py +++ b/homeassistant/components/satel_integra/binary_sensor.py @@ -41,7 +41,7 @@ async def async_setup_platform( zone_type = device_config_data[CONF_ZONE_TYPE] zone_name = device_config_data[CONF_ZONE_NAME] device = SatelIntegraBinarySensor( - controller, zone_num, zone_name, zone_type, SIGNAL_ZONES_UPDATED + controller, zone_num, zone_name, zone_type, CONF_ZONES, SIGNAL_ZONES_UPDATED ) devices.append(device) @@ -51,7 +51,12 @@ async def async_setup_platform( zone_type = device_config_data[CONF_ZONE_TYPE] zone_name = device_config_data[CONF_ZONE_NAME] device = SatelIntegraBinarySensor( - controller, zone_num, zone_name, zone_type, SIGNAL_OUTPUTS_UPDATED + controller, + zone_num, + zone_name, + zone_type, + CONF_OUTPUTS, + SIGNAL_OUTPUTS_UPDATED, ) devices.append(device) @@ -64,10 +69,17 @@ class SatelIntegraBinarySensor(BinarySensorEntity): _attr_should_poll = False def __init__( - self, controller, device_number, device_name, zone_type, react_to_signal + self, + controller, + device_number, + device_name, + zone_type, + sensor_type, + react_to_signal, ): """Initialize the binary_sensor.""" self._device_number = device_number + self._attr_unique_id = f"satel_{sensor_type}_{device_number}" self._name = device_name self._zone_type = zone_type self._state = 0