Make use of generic EntityComponent (part 2) (#78494)
This commit is contained in:
parent
bbf54e6f44
commit
64988521bb
21 changed files with 108 additions and 63 deletions
|
@ -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
|
||||
):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue