Skip to content

Add a Marketplace view to the brands integration - #185001

Merged
balloob merged 1 commit into
devfrom
frenck/marketplace-brand-icons
Oct 8, 2026
Merged

balloob merged 1 commit into
devfrom
frenck/marketplace-brand-icons

Conversation

@frenck

@frenck frenck commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Breaking change

Proposed change

The Marketplace shows integrations before they are installed. Custom integrations ship their brand images in a brand folder of their own nowadays, and the brands integration only serves that folder once the integration is installed. So in the Marketplace, most of them show the placeholder.

This adds a view for the Marketplace, /api/brands/marketplace/<domain>/<image>. It looks in the same places as the integration view, plus one:

  1. The brand folder of the integration, when it is installed.
  2. The brands repository, as before.
  3. brands.home-assistant.io/marketplace/<domain>/<image>, which serves the brand folder of Marketplace integrations that are not installed yet (Serve Marketplace icons from the brand folder of custom integrations brands#11283).
  4. The placeholder.

It reuses the existing building blocks, including the disk cache, so the browser only talks to Home Assistant. A 404 from the new path is cached like everywhere else in this integration; a 503 (the service does not know yet) is not.

This needs home-assistant/brands#11283 to be live before it ships. Without it, the new path answers 404, and those get cached for 30 days.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

@home-assistant

home-assistant Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (brands) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of brands can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign brands Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The conditional test assertion skips body verification for one case and conflicts with the repository’s testing convention.

1 open finding
What changed in this PR

Adds a Marketplace-specific brands API that resolves installed custom branding, repository assets, Marketplace CDN assets, then placeholders.

Changes:

  • Registers and implements the authenticated Marketplace brands view.
  • Adds coverage for resolution priority, caching, failures, validation, and authentication.
File Description
homeassistant/​components/​brands/​__init__.py Adds the Marketplace image endpoint and fallback chain.
tests/​components/​brands/​test_init.py Tests Marketplace image serving and caching behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/components/brands/test_init.py
@frenck
frenck marked this pull request as ready for review October 8, 2026 19:17
@frenck
frenck requested a review from a team as a code owner October 8, 2026 19:17
@balloob
balloob merged commit d9ee978 into dev Oct 8, 2026
39 checks passed
@balloob
balloob deleted the frenck/marketplace-brand-icons branch October 8, 2026 19:26
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants