Skip to content

Replace deprecated get_supervisor_info addons field with get_addons_info#105

Draft
Copilot wants to merge 4 commits intomainfrom
copilot/remove-addons-from-supervisor-info
Draft

Replace deprecated get_supervisor_info addons field with get_addons_info#105
Copilot wants to merge 4 commits intomainfrom
copilot/remove-addons-from-supervisor-info

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

get_supervisor_info will stop returning the addons field in an upcoming HA Core release, breaking addon discovery in this integration.

Changes

  • __init__.py: Swap get_supervisor_info for get_addons_info (returns dict[slug, addon_info] instead of a flat list under addons key)
  • get_ha_installed_addons: Unwrap the dict values to preserve the existing list[dict] return type
@callback
def get_ha_installed_addons(hass: HomeAssistant) -> list[dict[str, Any]]:
    if not is_hassio(hass):
        return []
    addons_info = get_addons_info(hass)

    if addons_info:
        return list(addons_info.values())
    return []

get_addons_info is available in the current stable release, so this change is backward-compatible.

Original prompt

This section details on the original issue you should resolve

<issue_title>get_supervisor_info will no longer return addons soon</issue_title>
<issue_description>Wanted to give you a heads up about a breaking change coming soon that we detected will affect you. In supervisor the addons field returned from a call to supervisor's /supervisor/info API has been deprecated for a while. As a result supervisor's client library aiohasupervisor does not support it. I've been slowly migrating core to use the client library for all interactions with supervisor and get rid of deprecated things like that.

So when home-assistant/core#164413 goes in (probably in a month, we're not going to put it in the march release) this code will break:

def get_ha_installed_addons(hass: HomeAssistant) -> list[dict[str, Any]]:
if not is_hassio(hass):
return []
supervisor_info = get_supervisor_info(hass)
if supervisor_info:
return supervisor_info.get("addons", [])
return []

Because the dictionary from get_supervisor_info will no longer include the addons fields.

Fortunately there's a simple alternative. homeassistant.components.hassio.get_addons_info returns all the same info as a dictionary keyed by addon slug. It's also available now in the current stable release so the following code is equivalent, works now and will keep working after the referenced PR goes in:

@callback
def get_ha_installed_addons(hass: HomeAssistant) -> list[dict[str, Any]]:
    if not is_hassio(hass):
        return []
    addons_info = get_addons_info(hass)

    if addons_info:
        return list(addons_info.values())
    return []
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ludeeus <15093472+ludeeus@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove addons field from get_supervisor_info response Replace deprecated get_supervisor_info addons field with get_addons_info Mar 2, 2026
@ludeeus ludeeus marked this pull request as ready for review March 2, 2026 18:08
@ludeeus ludeeus added the bugfix label Mar 2, 2026
@mdegat01
Copy link

mdegat01 commented Mar 4, 2026

Actually @ludeeus give me a sec on this one. There appears to be an issue with this suggested alternative. The way the code pattern works in the hassio component right now is this:

  1. Get the list of installed addons (originally using a call to supervisor/info, now using a call to addons)
  2. For each one make a call to addons/{slug}/info
  3. Create a dictionary of {<key>: <addon info>} out of this and return this dictionary from get_addons_info

The problem is if that second call fails it apparently sticks None in there. Which wasn't in the typing of the method so I didn't realize. I'm going to have to decide how best to address that to make this seamless in home-assistant/core#164413 and don't want to cause complications for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

get_supervisor_info will no longer return addons soon

3 participants