Skip to content

fix: use local brands API for update entity picture#5339

Draft
CervezaStallone wants to merge 1 commit into
hacs:mainfrom
CervezaStallone:fix/use-local-brands-api-for-update-entity-picture
Draft

fix: use local brands API for update entity picture#5339
CervezaStallone wants to merge 1 commit into
hacs:mainfrom
CervezaStallone:fix/use-local-brands-api-for-update-entity-picture

Conversation

@CervezaStallone

Copy link
Copy Markdown

Summary

Since HA 2026.3.0, brand images are served through the local HA API (/api/brands/integration/{domain}/icon.png) instead of being fetched directly from the external CDN by the browser. Custom integrations can now ship their own brand images in a brand/ subdirectory (announcement).

However, update.py still constructs the entity picture URL pointing at the CDN:

# before
return f"https://brands.home-assistant.io/_/{self.repository.data.domain}/icon.png"

The CDN returns a generic placeholder PNG (200 OK, ~3 KB) for any domain not listed in the official brands repository. HA's frontend detects this placeholder and displays "icon not available" — so custom integrations that correctly ship a brand/ directory still show no icon in the Updates card.

Fix

# after
return f"/api/brands/integration/{self.repository.data.domain}/icon.png"

Using the relative local API path routes the request through HA's backend, which serves from the integration's local brand/ directory when present, and falls back to the CDN for official integrations. This fixes icon display for all custom integrations that follow the HA 2026.3 spec.

Impact

  • Official integrations (in the brands CDN): no change — local API proxies to CDN as before
  • Custom integrations with a brand/ directory: icon now shows correctly
  • Custom integrations without a brand/ directory: HA returns a fallback, same as before

Since HA 2026.3.0, brand images are served through the local API
(/api/brands/integration/{domain}/icon.png) instead of the external CDN.
Custom integrations can now ship their own brand images in a brand/
subdirectory, but the update entity was still pointing at the CDN URL
which returns a generic placeholder for unknown domains — causing HA
to display 'icon not available' for any custom integration not listed
in the official brands repository.

Fixes icon display for all custom integrations that ship a brand/
directory per the HA 2026.3 spec.
return None

return f"https://brands.home-assistant.io/_/{self.repository.data.domain}/icon.png"
return f"/api/brands/integration/{self.repository.data.domain}/icon.png"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to point to the brand's website if you are using HA < 2026.3.0, as that Path does not exist before it.
Can you also access this without a token?

@hacs-bot hacs-bot Bot marked this pull request as draft June 30, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants