1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Add country to Supervisor info (#5826)

Similar to timezone also add country information to the Supervisor
info. This is useful to set country specific configurations such as
Wireless radio regulatory setting. This is also useful for add-ons
which need country information but only have hassio API access.
This commit is contained in:
Stefan Agner
2025-04-22 16:18:23 +02:00
committed by GitHub
parent adfb433f57
commit 5d07dd2c42
5 changed files with 39 additions and 0 deletions

View File

@@ -252,6 +252,21 @@ async def test_api_supervisor_options_timezone(
assert coresys.timezone == "Europe/Zurich"
async def test_api_supervisor_options_country(api_client: TestClient, coresys: CoreSys):
"""Test setting supervisor country via API."""
assert coresys.config.country is None
resp = await api_client.post("/supervisor/options", json={"country": "CH"})
assert resp.status == 200
assert coresys.config.country == "CH"
resp = await api_client.get("/supervisor/info")
assert resp.status == 200
body = await resp.json()
assert body["data"]["country"] == "CH"
@pytest.mark.parametrize(
("blockbuster", "option_value", "config_value"),
[("no_blockbuster", "on", False), ("no_blockbuster", "on_at_startup", True)],