Fix /supervisor/reload after refactoring (#5791)

As discussed in [1], refactoring in #5759 changed signature of the
reload method and CLI now gets unexpected schema when `ha su reload` is
called. Change the method to return None as before and add a test for a
proper body content.

[1] https://github.com/home-assistant/supervisor/pull/5759/files#diff-1b4ed26f31e52ff5fe53efdc695eebacb1e46411f23cce58295591b2b20cd3faR238
This commit is contained in:
Jan Čermák 2025-03-27 15:03:57 +01:00 committed by GitHub
parent 8b3bf547d7
commit 92cadb4c55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -230,9 +230,9 @@ class APISupervisor(CoreSysAttributes):
await asyncio.shield(self.sys_supervisor.update(version))
@api_process
def reload(self, request: web.Request) -> Awaitable:
async def reload(self, request: web.Request) -> None:
"""Reload add-ons, configuration, etc."""
return asyncio.gather(
await asyncio.gather(
asyncio.shield(self.sys_updater.reload()),
asyncio.shield(self.sys_homeassistant.secrets.reload()),
asyncio.shield(self.sys_resolution.evaluate.evaluate_system()),

View File

@ -235,6 +235,7 @@ async def test_api_supervisor_reload(api_client: TestClient):
"""Test supervisor reload."""
resp = await api_client.post("/supervisor/reload")
assert resp.status == 200
assert await resp.json() == {"result": "ok", "data": {}}
async def test_api_supervisor_options_timezone(