Add satel integra binary switches unique_id (#118660)

This commit is contained in:
Dawid Pietryga 2024-06-22 13:35:26 +02:00 committed by GitHub
parent 93e87997be
commit 5cdd650023
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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