What would you like to see?
Extend ha_call_addon_api to also support writing addon configuration via the Supervisor API, and rename it to ha_manage_addon to reflect its broader scope.
Currently ha_call_addon_api proxies HTTP/WebSocket calls to the addon container's own web API. Addon configuration (options, network, boot mode, etc.) lives in the Supervisor API (POST /addons/{slug}/options), which no existing tool can reach — ha_call_service only exposes hassio.addon_start/stop/restart/stdin, and ha_get_addon is read-only.
Proposed changes:
- Rename
ha_call_addon_api → ha_manage_addon
- Make
path optional (currently required) to support a second mode
- Add high-level Supervisor config params:
options: dict | None — addon configuration values (the Configuration tab)
network: dict | None — host port mappings (e.g., {"5800/tcp": 8081})
boot: str | None — "auto" or "manual"
auto_update: bool | None
watchdog: bool | None
- Two operating modes:
- Proxy mode (existing behavior): when
path is provided → calls addon container API via HTTP/WebSocket, unchanged
- Config mode (new): when any of
options/network/boot/auto_update/watchdog is provided → POSTs to Supervisor API via _supervisor_api_call() (which already supports POST)
- Validation:
path and config params are mutually exclusive — error if both provided
Why do you need this?
Real use case from #912: user wants to switch kiosk addons, which requires configuring the new addon's options (FF_OPEN_URL, FF_KIOSK), setting its host port, and disabling old addon auto-start. Steps 2-4 all require manual UI interaction today because no tool reaches the Supervisor config API.
Hassio services only cover start/stop/restart — confirmed via ha_list_services(domain="hassio").
Additional context
What would you like to see?
Extend
ha_call_addon_apito also support writing addon configuration via the Supervisor API, and rename it toha_manage_addonto reflect its broader scope.Currently
ha_call_addon_apiproxies HTTP/WebSocket calls to the addon container's own web API. Addon configuration (options, network, boot mode, etc.) lives in the Supervisor API (POST /addons/{slug}/options), which no existing tool can reach —ha_call_serviceonly exposeshassio.addon_start/stop/restart/stdin, andha_get_addonis read-only.Proposed changes:
ha_call_addon_api→ha_manage_addonpathoptional (currently required) to support a second modeoptions: dict | None— addon configuration values (the Configuration tab)network: dict | None— host port mappings (e.g.,{"5800/tcp": 8081})boot: str | None—"auto"or"manual"auto_update: bool | Nonewatchdog: bool | Nonepathis provided → calls addon container API via HTTP/WebSocket, unchangedoptions/network/boot/auto_update/watchdogis provided → POSTs to Supervisor API via_supervisor_api_call()(which already supports POST)pathand config params are mutually exclusive — error if both providedWhy do you need this?
Real use case from #912: user wants to switch kiosk addons, which requires configuring the new addon's options (
FF_OPEN_URL,FF_KIOSK), setting its host port, and disabling old addon auto-start. Steps 2-4 all require manual UI interaction today because no tool reaches the Supervisor config API.Hassio services only cover start/stop/restart — confirmed via
ha_list_services(domain="hassio").Additional context
ha_set_addontool)_supervisor_api_call()intools_addons.pyalready acceptsmethodanddataparams — the write infrastructure existsPOST /addons/{slug}/optionswith fieldsoptions,network,boot,auto_update,watchdogPOST /addons/{slug}/options/validate