Use generators for async_add_entities in Abode (#76569)
This commit is contained in:
parent
52fd63acbc
commit
ca3033b84c
7 changed files with 35 additions and 49 deletions
|
@ -30,12 +30,10 @@ async def async_setup_entry(
|
|||
CONST.TYPE_OPENING,
|
||||
]
|
||||
|
||||
entities = []
|
||||
|
||||
for device in data.abode.get_devices(generic_type=device_types):
|
||||
entities.append(AbodeBinarySensor(data, device))
|
||||
|
||||
async_add_entities(entities)
|
||||
async_add_entities(
|
||||
AbodeBinarySensor(data, device)
|
||||
for device in data.abode.get_devices(generic_type=device_types)
|
||||
)
|
||||
|
||||
|
||||
class AbodeBinarySensor(AbodeDevice, BinarySensorEntity):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue