Enable disallow-any-generics in update (#78501)

This commit is contained in:
epenet 2022-09-15 11:29:11 +02:00 committed by GitHub
parent c37d294d12
commit 19ea95a6e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -73,10 +73,12 @@ __all__ = [
"UpdateEntityFeature",
]
# mypy: disallow-any-generics
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up Select entities."""
component = hass.data[DOMAIN] = EntityComponent(
component = hass.data[DOMAIN] = EntityComponent[UpdateEntity](
_LOGGER, DOMAIN, hass, SCAN_INTERVAL
)
await component.async_setup(config)
@ -109,13 +111,13 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up a config entry."""
component: EntityComponent = hass.data[DOMAIN]
component: EntityComponent[UpdateEntity] = hass.data[DOMAIN]
return await component.async_setup_entry(entry)
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
component: EntityComponent = hass.data[DOMAIN]
component: EntityComponent[UpdateEntity] = hass.data[DOMAIN]
return await component.async_unload_entry(entry)
@ -437,11 +439,11 @@ class UpdateEntity(RestoreEntity):
async def websocket_release_notes(
hass: HomeAssistant,
connection: websocket_api.connection.ActiveConnection,
msg: dict,
msg: dict[str, Any],
) -> None:
"""Get the full release notes for a entity."""
component = hass.data[DOMAIN]
entity: UpdateEntity | None = component.get_entity(msg["entity_id"])
component: EntityComponent[UpdateEntity] = hass.data[DOMAIN]
entity = component.get_entity(msg["entity_id"])
if entity is None:
connection.send_error(