mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Use generator expression in totalconnect (#116020)
This commit is contained in:
parent
e2b401397d
commit
8f56d170b9
@ -38,21 +38,17 @@ async def async_setup_entry(
|
|||||||
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up TotalConnect alarm panels based on a config entry."""
|
"""Set up TotalConnect alarm panels based on a config entry."""
|
||||||
alarms: list[TotalConnectAlarm] = []
|
|
||||||
|
|
||||||
coordinator: TotalConnectDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
coordinator: TotalConnectDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
|
||||||
|
|
||||||
for location in coordinator.client.locations.values():
|
async_add_entities(
|
||||||
alarms.extend(
|
TotalConnectAlarm(
|
||||||
TotalConnectAlarm(
|
coordinator,
|
||||||
coordinator,
|
location,
|
||||||
location,
|
partition_id,
|
||||||
partition_id,
|
|
||||||
)
|
|
||||||
for partition_id in location.partitions
|
|
||||||
)
|
)
|
||||||
|
for location in coordinator.client.locations.values()
|
||||||
async_add_entities(alarms)
|
for partition_id in location.partitions
|
||||||
|
)
|
||||||
|
|
||||||
# Set up services
|
# Set up services
|
||||||
platform = entity_platform.async_get_current_platform()
|
platform = entity_platform.async_get_current_platform()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user