Enable mypy part 1 (addons and api) (#5759)

* Fix mypy issues in addons

* Fix mypy issues in api

* fix docstring

* Brackets instead of get with default
This commit is contained in:
Mike Degatano
2025-03-25 15:06:35 -04:00
committed by GitHub
parent 543d6efec4
commit 0636e49fe2
62 changed files with 500 additions and 382 deletions

View File

@@ -230,19 +230,12 @@ class APISupervisor(CoreSysAttributes):
await asyncio.shield(self.sys_supervisor.update(version))
@api_process
def reload(self, request: web.Request) -> Awaitable[None]:
def reload(self, request: web.Request) -> Awaitable:
"""Reload add-ons, configuration, etc."""
return asyncio.shield(
asyncio.wait(
[
self.sys_create_task(coro)
for coro in [
self.sys_updater.reload(),
self.sys_homeassistant.secrets.reload(),
self.sys_resolution.evaluate.evaluate_system(),
]
]
)
return asyncio.gather(
asyncio.shield(self.sys_updater.reload()),
asyncio.shield(self.sys_homeassistant.secrets.reload()),
asyncio.shield(self.sys_resolution.evaluate.evaluate_system()),
)
@api_process