mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 20:57:21 +00:00
Add satel integra binary switches unique_id (#118660)
This commit is contained in:
parent
93e87997be
commit
5cdd650023
@ -41,7 +41,7 @@ async def async_setup_platform(
|
|||||||
zone_type = device_config_data[CONF_ZONE_TYPE]
|
zone_type = device_config_data[CONF_ZONE_TYPE]
|
||||||
zone_name = device_config_data[CONF_ZONE_NAME]
|
zone_name = device_config_data[CONF_ZONE_NAME]
|
||||||
device = SatelIntegraBinarySensor(
|
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)
|
devices.append(device)
|
||||||
|
|
||||||
@ -51,7 +51,12 @@ async def async_setup_platform(
|
|||||||
zone_type = device_config_data[CONF_ZONE_TYPE]
|
zone_type = device_config_data[CONF_ZONE_TYPE]
|
||||||
zone_name = device_config_data[CONF_ZONE_NAME]
|
zone_name = device_config_data[CONF_ZONE_NAME]
|
||||||
device = SatelIntegraBinarySensor(
|
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)
|
devices.append(device)
|
||||||
|
|
||||||
@ -64,10 +69,17 @@ class SatelIntegraBinarySensor(BinarySensorEntity):
|
|||||||
_attr_should_poll = False
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(
|
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."""
|
"""Initialize the binary_sensor."""
|
||||||
self._device_number = device_number
|
self._device_number = device_number
|
||||||
|
self._attr_unique_id = f"satel_{sensor_type}_{device_number}"
|
||||||
self._name = device_name
|
self._name = device_name
|
||||||
self._zone_type = zone_type
|
self._zone_type = zone_type
|
||||||
self._state = 0
|
self._state = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user