Resolve a pre-migration composite source device for Bluetooth scanners by frenck · Pull Request #184568 · home-assistant/core · GitHub
Skip to content

Resolve a pre-migration composite source device for Bluetooth scanners - #184568

Merged
frenck merged 1 commit into
devfrom
frenck/fix-bluetooth-composite-via-device
Oct 6, 2026
Merged

frenck merged 1 commit into
devfrom
frenck/fix-bluetooth-composite-via-device

Conversation

@frenck

@frenck frenck commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Breaking change

Proposed change

A remote Bluetooth scanner config entry, such as one for an ESPHome Bluetooth proxy, stores the id of its source device to link the scanner's device to it. For entries created before the device registry split composite devices into one device per config entry, that stored id is now a pre-migration composite device id. Passing it as via_device_id logs "Detected that integration 'bluetooth' passes the id of a pre-migration composite device ... This will stop working in Home Assistant 2027.8".

A stored composite device id is now resolved to the split device that belongs to the config entry providing the scanner, the same lookup search and tag triggers use for composite device ids.

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:

@frenck
frenck requested a review from bdraco as a code owner October 6, 2026 21:54
Copilot AI balanced review requested due to automatic review settings October 6, 2026 21:54
@home-assistant home-assistant Bot added bugfix cla-signed has-tests integration: bluetooth small-pr PRs with less than 30 lines. Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage Top 50 Integration is ranked within the top 50 by usage labels Oct 6, 2026
@home-assistant

home-assistant Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

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.

Copilot review overview

🟢 Approval recommended

The focused fix correctly resolves the source device and includes adequate regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Resolves legacy composite source-device IDs for remote Bluetooth scanners.

Changes:

  • Maps composite IDs to the split device owned by the scanner’s source config entry.
  • Adds regression coverage confirming correct linkage without warnings.
File Description
homeassistant/​components/​bluetooth/​__init__.py Resolves legacy composite source IDs.
tests/​components/​bluetooth/​test_config_flow.py Tests composite-device resolution.

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

@frenck frenck added this to the 2026.10.0 milestone Oct 6, 2026
@frenck
frenck merged commit 2ee7b99 into dev Oct 6, 2026
56 checks passed
@frenck
frenck deleted the frenck/fix-bluetooth-composite-via-device branch October 6, 2026 22:29
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bugfix cherry-picked cla-signed has-tests integration: bluetooth Quality Scale: internal small-pr PRs with less than 30 lines. Top 50 Integration is ranked within the top 50 by usage Top 100 Integration is ranked within the top 100 by usage Top 200 Integration is ranked within the top 200 by usage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detected that integration 'bluetooth' passes the id of a pre-migration composite device

3 participants