Make use of generic EntityComponent (part 2) (#78494)

This commit is contained in:
epenet 2022-09-17 18:18:53 +02:00 committed by GitHub
parent bbf54e6f44
commit 64988521bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 108 additions and 63 deletions

View file

@ -38,6 +38,8 @@ TRIGGER_SCHEMA = cv.TRIGGER_BASE_SCHEMA.extend(
}
)
# mypy: disallow-any-generics
class CalendarEventListener:
"""Helper class to listen to calendar events."""
@ -172,7 +174,7 @@ async def async_attach_trigger(
event_type = config[CONF_EVENT]
offset = config[CONF_OFFSET]
component: EntityComponent = hass.data[DOMAIN]
component: EntityComponent[CalendarEntity] = hass.data[DOMAIN]
if not (entity := component.get_entity(entity_id)) or not isinstance(
entity, CalendarEntity
):