Use the brands proxy for update entity pictures when available - #5524
Open
ReikanYsora wants to merge 1 commit into
Open
Use the brands proxy for update entity pictures when available#5524ReikanYsora wants to merge 1 commit into
ReikanYsora wants to merge 1 commit into
Conversation
Home Assistant 2026.3 serves brand images through a local, token-gated proxy at /api/brands/, which also serves the brand/ assets custom integrations ship themselves now that home-assistant/brands no longer accepts images for them. The update entities still pointed entity_picture at the public CDN, so integrations that are not grandfathered into the CDN showed the placeholder image in the updates list. Return the proxy path when the brands integration is loaded, which is the case on every core with the proxy, and keep the CDN URL otherwise so older cores are unaffected. The frontend appends the access token to /api/brands/ paths itself, exactly as it does for core's own update entities.
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.
Hi :)
Proposed change
Since Home Assistant 2026.3, brand images are served by a local, token-gated proxy at
/api/brands/integration/{domain}/{image}(announcement), which resolvescustom_components/<domain>/brand/before falling back to the CDN.HacsRepositoryUpdateEntity.entity_picturestill points at the CDN, so update entities of integrations that ship their ownbrand/folder show the placeholder image in the updates list.Core's own
UpdateEntityreturns/api/brands/integration/{platform}/icon.pngby default (update/__init__.py); this makes HACS do the same for the repository's domain when the proxy exists.This picks up where #5228 and #5339 stopped, and addresses the two points raised in their reviews:
brandsintegration is loaded ("brands" in hass.config.components).brandsis a bootstrap core integration on every 2026.3+ install (bootstrap.py) and does not exist before it, so this detects the endpoint itself rather than a version number. Older cores keep the CDN URL unchanged./api/brands/URL when it renders an entity picture (state-badge.tsviahass.hassUrl()→addBrandsAuth). A token baked into the attribute would expire after an hour.Feature detection also keeps the existing snapshots identical on both CI legs, since the test harness does not load
brandson either.The dashboard icons are handled separately in hacs/frontend#949.
Verification
test_update_entity_picture, parametrised over both states, asserts the CDN URL withoutbrandsand the proxy path with it.ruff checkclean.brandsis inhass.config.components, and for two downloaded custom integrations shippingbrand/icon.pngbut absent fromhome-assistant/brands,/api/brands/integration/{domain}/icon.pngserves the real icon (200) both with the bearer token and with thebrands/access_tokenquery token, while the current CDNentity_pictureanswers 200 with the placeholder. Without a token the proxy answers 403.Related: #5171, #5223, #5228, #5339.
Cheers ;)
ReikanYsora / Jérôme