diff --git a/supervisor/api/addons.py b/supervisor/api/addons.py index dc98282dd00..feba4752209 100644 --- a/supervisor/api/addons.py +++ b/supervisor/api/addons.py @@ -110,7 +110,7 @@ PwnedSecret, ) from ..validate import docker_ports -from .const import ATTR_REMOVE_CONFIG, ATTR_SIGNED +from .const import ATTR_BOOT_CONFIG, ATTR_REMOVE_CONFIG, ATTR_SIGNED from .utils import api_process, api_validate, json_loads _LOGGER: logging.Logger = logging.getLogger(__name__) @@ -218,6 +218,7 @@ async def info(self, request: web.Request) -> dict[str, Any]: ATTR_VERSION_LATEST: addon.latest_version, ATTR_PROTECTED: addon.protected, ATTR_RATING: rating_security(addon), + ATTR_BOOT_CONFIG: addon.boot_config, ATTR_BOOT: addon.boot, ATTR_OPTIONS: addon.options, ATTR_SCHEMA: addon.schema_ui, diff --git a/supervisor/api/const.py b/supervisor/api/const.py index be0356d31b6..e34998a3963 100644 --- a/supervisor/api/const.py +++ b/supervisor/api/const.py @@ -17,6 +17,7 @@ ATTR_ATTRIBUTES = "attributes" ATTR_AVAILABLE_UPDATES = "available_updates" ATTR_BACKGROUND = "background" +ATTR_BOOT_CONFIG = "boot_config" ATTR_BOOT_SLOT = "boot_slot" ATTR_BOOT_SLOTS = "boot_slots" ATTR_BOOT_TIMESTAMP = "boot_timestamp" diff --git a/tests/api/test_addons.py b/tests/api/test_addons.py index 645fa95069c..9ea5c345adf 100644 --- a/tests/api/test_addons.py +++ b/tests/api/test_addons.py @@ -352,6 +352,13 @@ async def test_addon_options_boot_mode_forced_invalid( api_client: TestClient, install_addon_example: Addon ): """Test changing boot mode is invalid if set to manual forced.""" + 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_forced" + resp = await api_client.post("/addons/local_example/options", json={"boot": "auto"}) assert resp.status == 400 body = await resp.json()