Refactor binary sensor creation in Risco integration (#82043)
parent
fe7ffe9519
commit
52a8f4df82
|
@ -28,16 +28,13 @@ async def async_setup_entry(
|
|||
if is_local(config_entry):
|
||||
local_data: LocalData = hass.data[DOMAIN][config_entry.entry_id]
|
||||
async_add_entities(
|
||||
RiscoLocalBinarySensor(local_data.system.id, zone_id, zone)
|
||||
entity
|
||||
for zone_id, zone in local_data.system.zones.items()
|
||||
for entity in (
|
||||
RiscoLocalBinarySensor(local_data.system.id, zone_id, zone),
|
||||
RiscoLocalAlarmedBinarySensor(local_data.system.id, zone_id, zone),
|
||||
RiscoLocalArmedBinarySensor(local_data.system.id, zone_id, zone),
|
||||
)
|
||||
async_add_entities(
|
||||
RiscoLocalAlarmedBinarySensor(local_data.system.id, zone_id, zone)
|
||||
for zone_id, zone in local_data.system.zones.items()
|
||||
)
|
||||
async_add_entities(
|
||||
RiscoLocalArmedBinarySensor(local_data.system.id, zone_id, zone)
|
||||
for zone_id, zone in local_data.system.zones.items()
|
||||
)
|
||||
else:
|
||||
coordinator: RiscoDataUpdateCoordinator = hass.data[DOMAIN][
|
||||
|
|
Loading…
Reference in New Issue