mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-15 13:16:29 +00:00
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:
parent
8b3bf547d7
commit
92cadb4c55
@ -230,9 +230,9 @@ class APISupervisor(CoreSysAttributes):
|
|||||||
await asyncio.shield(self.sys_supervisor.update(version))
|
await asyncio.shield(self.sys_supervisor.update(version))
|
||||||
|
|
||||||
@api_process
|
@api_process
|
||||||
def reload(self, request: web.Request) -> Awaitable:
|
async def reload(self, request: web.Request) -> None:
|
||||||
"""Reload add-ons, configuration, etc."""
|
"""Reload add-ons, configuration, etc."""
|
||||||
return asyncio.gather(
|
await asyncio.gather(
|
||||||
asyncio.shield(self.sys_updater.reload()),
|
asyncio.shield(self.sys_updater.reload()),
|
||||||
asyncio.shield(self.sys_homeassistant.secrets.reload()),
|
asyncio.shield(self.sys_homeassistant.secrets.reload()),
|
||||||
asyncio.shield(self.sys_resolution.evaluate.evaluate_system()),
|
asyncio.shield(self.sys_resolution.evaluate.evaluate_system()),
|
||||||
|
@ -235,6 +235,7 @@ async def test_api_supervisor_reload(api_client: TestClient):
|
|||||||
"""Test supervisor reload."""
|
"""Test supervisor reload."""
|
||||||
resp = await api_client.post("/supervisor/reload")
|
resp = await api_client.post("/supervisor/reload")
|
||||||
assert resp.status == 200
|
assert resp.status == 200
|
||||||
|
assert await resp.json() == {"result": "ok", "data": {}}
|
||||||
|
|
||||||
|
|
||||||
async def test_api_supervisor_options_timezone(
|
async def test_api_supervisor_options_timezone(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user