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:
@@ -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)],
|
||||
|
||||
Reference in New Issue
Block a user