{{ message }}
Repository navigation
Wait for a fresh Teslemetry advertisement before connecting over Bluetooth - #184193
Merged
silamon merged 8 commits intoOct 6, 2026
Merged
Conversation
10 of 21 tasks
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The connection still uses the stale pre-window BLE device instead of the device from the fresh advertisement.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Updates Teslemetry Bluetooth pairing to avoid connecting during the adapter’s active-scan transition.
Changes:
- Waits briefly for a fresh connectable advertisement after active scanning.
- Skips active scanning when the vehicle is already known.
- Adds coverage for advertisement timing, timeout, and logging.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Bre77
marked this pull request as draft
October 4, 2026 13:19
…-race # Conflicts: # tests/components/teslemetry/test_config_flow.py
…-race # Conflicts: # homeassistant/components/teslemetry/config_flow.py # tests/components/teslemetry/test_config_flow.py
Bre77
marked this pull request as ready for review
October 6, 2026 02:41
silamon
approved these changes
Oct 6, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.


Breaking change
Proposed change
The Teslemetry "Add local vehicle" Bluetooth step no longer connects at the exact moment its active scan ends, which made a local Bluetooth adapter in the default Auto scanning mode fail instantly on every attempt. When an Auto scanner leaves the scan's active window it restarts discovery, and BlueZ drops the vehicle from that adapter until its next advertisement, so after the scan finds the vehicle the step now waits up to 5 seconds for a connectable advertisement heard once no Auto scanner is still in its active window, then connects. When the vehicle's name is already known from an earlier advertisement, the step skips the active scan and connects straight away. The wait listens with
async_register_advertisement_callback, because the change-driven callbacks behindasync_process_advertisementsare skipped for an advertisement identical to the previous one. When the vehicle is not found, the step logs at debug level the Bluetooth name it looked for, so a debug log shows why setup reporteddevice_not_found.Please add to beta, milestone 2026.10
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: