Use authenticated brands proxy for update entity pictures#5228
Open
Use authenticated brands proxy for update entity pictures#5228
Conversation
The `entity_picture` on HACS Update entities hardcoded the legacy CDN URL `https://brands.home-assistant.io/_/{domain}/icon.png`. That CDN no longer accepts new custom-integration submissions after the brands-proxy API arrived in HA 2026.3, so Update entities for custom integrations that ship inline `brand/` assets show broken pictures. Switch to `/api/brands/integration/{domain}/icon.png` — a path served by HA's local brands proxy, which resolves both core integrations (via the upstream CDN with stale-while-revalidate) and custom integrations (via the inline asset). The HA frontend's `addBrandsAuth` helper appends the access token client-side when rendering the URL. Snapshots regenerated with `pytest --snapshot-update`. Relates to hacs#5171, hacs#5223 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HacsRepositoryUpdateEntity.entity_picturereturned a hardcoded legacy-CDN URL:After the brands-proxy API landed in HA 2026.3, the CDN no longer accepts new custom-integration submissions, so Update entities for custom integrations that ship inline
brand/assets show a broken picture.Change
Return
/api/brands/integration/{domain}/icon.png— a relative path served by HA's local brands proxy. For core integrations the proxy fetches the upstream CDN image via stale-while-revalidate; for custom integrations it serves the inlinebrand/icon.pngbundled with the integration.Snapshots under
tests/snapshots/hacs-test-org/were regenerated viapytest --snapshot-update. Thedomains.jsonreferences incustom_components/hacs/validate/brands.pyand its fixtures are intentionally untouched — that validator's fallback still serves a valid back-compat check for custom integrations already present in the brands repo.Relates to #5171
Relates to #5223
The primary fix for the HACS dashboard icons lives in hacs/frontend; this PR finishes the job for Update entities.
Open question for reviewers
This change assumes the HA frontend's entity-picture rendering pipeline applies
addBrandsAuth(from upstreamsrc/util/brands-url.ts) to URLs beginning with/api/brands/, so that the access token gets appended client-side. If that's not the case for the update-card render path, the path will 401 on HA ≥ 2026.3. Please verify — happy to pivot if a different shape of URL is preferred.Test plan
scripts/testpasses (pytest with refreshed snapshots).ruff checkpasses./api/brands/integration/{domain}/icon.png?token=….🤖 Generated with Claude Code