Improve type hint in entity_component (#80596)

Imrpove type hint in entity_component
This commit is contained in:
epenet 2022-10-20 12:38:22 +02:00 committed by GitHub
parent 454394a242
commit eb93372cd6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,7 @@ _EntityT = TypeVar("_EntityT", bound=entity.Entity)
async def async_update_entity(hass: HomeAssistant, entity_id: str) -> None:
"""Trigger an update for an entity."""
domain = entity_id.split(".", 1)[0]
entity_comp: EntityComponent[entity.Entity] | None
entity_comp = hass.data.get(DATA_INSTANCES, {}).get(domain)
if entity_comp is None: