Enable disallow-any-generics in update (#78501)
This commit is contained in:
parent
c37d294d12
commit
19ea95a6e4
1 changed files with 8 additions and 6 deletions
|
@ -73,10 +73,12 @@ __all__ = [
|
||||||
"UpdateEntityFeature",
|
"UpdateEntityFeature",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# mypy: disallow-any-generics
|
||||||
|
|
||||||
|
|
||||||
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
"""Set up Select entities."""
|
"""Set up Select entities."""
|
||||||
component = hass.data[DOMAIN] = EntityComponent(
|
component = hass.data[DOMAIN] = EntityComponent[UpdateEntity](
|
||||||
_LOGGER, DOMAIN, hass, SCAN_INTERVAL
|
_LOGGER, DOMAIN, hass, SCAN_INTERVAL
|
||||||
)
|
)
|
||||||
await component.async_setup(config)
|
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:
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Set up a config entry."""
|
"""Set up a config entry."""
|
||||||
component: EntityComponent = hass.data[DOMAIN]
|
component: EntityComponent[UpdateEntity] = hass.data[DOMAIN]
|
||||||
return await component.async_setup_entry(entry)
|
return await component.async_setup_entry(entry)
|
||||||
|
|
||||||
|
|
||||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Unload a config entry."""
|
"""Unload a config entry."""
|
||||||
component: EntityComponent = hass.data[DOMAIN]
|
component: EntityComponent[UpdateEntity] = hass.data[DOMAIN]
|
||||||
return await component.async_unload_entry(entry)
|
return await component.async_unload_entry(entry)
|
||||||
|
|
||||||
|
|
||||||
|
@ -437,11 +439,11 @@ class UpdateEntity(RestoreEntity):
|
||||||
async def websocket_release_notes(
|
async def websocket_release_notes(
|
||||||
hass: HomeAssistant,
|
hass: HomeAssistant,
|
||||||
connection: websocket_api.connection.ActiveConnection,
|
connection: websocket_api.connection.ActiveConnection,
|
||||||
msg: dict,
|
msg: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Get the full release notes for a entity."""
|
"""Get the full release notes for a entity."""
|
||||||
component = hass.data[DOMAIN]
|
component: EntityComponent[UpdateEntity] = hass.data[DOMAIN]
|
||||||
entity: UpdateEntity | None = component.get_entity(msg["entity_id"])
|
entity = component.get_entity(msg["entity_id"])
|
||||||
|
|
||||||
if entity is None:
|
if entity is None:
|
||||||
connection.send_error(
|
connection.send_error(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue