Improve lists in integrations [R-S] (#113233)
* Improve lists in integrations [R-S] * Fix * Fix
This commit is contained in:
parent
e6a692f354
commit
77917506bb
60 changed files with 543 additions and 611 deletions
|
@ -45,17 +45,15 @@ async def async_setup_entry(
|
|||
) -> None:
|
||||
"""Set up binary_sensors based on a config entry."""
|
||||
coordinator: SchlageDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
|
||||
entities = []
|
||||
for device_id in coordinator.data.locks:
|
||||
for description in _DESCRIPTIONS:
|
||||
entities.append(
|
||||
SchlageBinarySensor(
|
||||
coordinator=coordinator,
|
||||
description=description,
|
||||
device_id=device_id,
|
||||
)
|
||||
)
|
||||
async_add_entities(entities)
|
||||
async_add_entities(
|
||||
SchlageBinarySensor(
|
||||
coordinator=coordinator,
|
||||
description=description,
|
||||
device_id=device_id,
|
||||
)
|
||||
for device_id in coordinator.data.locks
|
||||
for description in _DESCRIPTIONS
|
||||
)
|
||||
|
||||
|
||||
class SchlageBinarySensor(SchlageEntity, BinarySensorEntity):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue