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

Add manual_only option to addon boot config (#5272)

* Add manual_forced option to addon boot config

* Include client library in pull request template

* Add boot_config to api output so frontend can use it

* `manual_forced` to `manual_only`
This commit is contained in:
Mike Degatano
2024-08-27 11:59:52 -04:00
committed by GitHub
parent 91a8fae9b5
commit 0177cd9528
10 changed files with 78 additions and 6 deletions

View File

@@ -346,3 +346,23 @@ async def test_api_addon_system_managed(
body = await resp.json()
assert body["data"]["system_managed"] is False
assert body["data"]["system_managed_config_entry"] is None
async def test_addon_options_boot_mode_manual_only_invalid(
api_client: TestClient, install_addon_example: Addon
):
"""Test changing boot mode is invalid if set to manual only."""
install_addon_example.data["ingress"] = False
resp = await api_client.get("/addons/local_example/info")
assert resp.status == 200
body = await resp.json()
assert body["data"]["boot"] == "manual"
assert body["data"]["boot_config"] == "manual_only"
resp = await api_client.post("/addons/local_example/options", json={"boot": "auto"})
assert resp.status == 400
body = await resp.json()
assert (
body["message"]
== "Addon local_example boot option is set to manual_only so it cannot be changed"
)