Address yale review comments (#124810)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
This commit is contained in:
parent
2900fa733d
commit
70488ffd15
20 changed files with 267 additions and 283 deletions
|
@ -63,22 +63,17 @@ async def async_setup_entry(
|
|||
) -> None:
|
||||
"""Set up the yale event platform."""
|
||||
data = config_entry.runtime_data
|
||||
entities: list[YaleEventEntity] = []
|
||||
|
||||
for lock in data.locks:
|
||||
detail = data.get_device_detail(lock.device_id)
|
||||
if detail.doorbell:
|
||||
entities.extend(
|
||||
YaleEventEntity(data, lock, description)
|
||||
for description in TYPES_DOORBELL
|
||||
)
|
||||
|
||||
for doorbell in data.doorbells:
|
||||
entities.extend(
|
||||
YaleEventEntity(data, doorbell, description)
|
||||
for description in TYPES_DOORBELL + TYPES_VIDEO_DOORBELL
|
||||
)
|
||||
|
||||
entities: list[YaleEventEntity] = [
|
||||
YaleEventEntity(data, lock, description)
|
||||
for description in TYPES_DOORBELL
|
||||
for lock in data.locks
|
||||
if (detail := data.get_device_detail(lock.device_id)) and detail.doorbell
|
||||
]
|
||||
entities.extend(
|
||||
YaleEventEntity(data, doorbell, description)
|
||||
for description in TYPES_DOORBELL + TYPES_VIDEO_DOORBELL
|
||||
for doorbell in data.doorbells
|
||||
)
|
||||
async_add_entities(entities)
|
||||
|
||||
|
||||
|
@ -86,7 +81,6 @@ class YaleEventEntity(YaleDescriptionEntity, EventEntity):
|
|||
"""An yale event entity."""
|
||||
|
||||
entity_description: YaleEventEntityDescription
|
||||
_attr_has_entity_name = True
|
||||
_last_activity: Activity | None = None
|
||||
|
||||
@callback
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue