Skip to content

[FEATURE] Extend ha_call_addon_api to support Supervisor config management (rename to ha_manage_addon) #913

Description

@kingpanther13

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:

  1. Rename ha_call_addon_apiha_manage_addon
  2. Make path optional (currently required) to support a second mode
  3. 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
  4. 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)
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions