[ble_device_base] Bind BLEHub to the build's tracker at compile time - #18181
Conversation
…anner-state # Conflicts: # esphome/components/bluetooth_proxy/bluetooth_proxy.cpp
…-scanner-listener
|
@bluetoothbot review |
|
To use the changes from this PR as an external component, add the following to your ESPHome configuration YAML file: external_components:
- source: github://pr#18181
components: [bk72xx_ble_tracker, ble_device_base, bluetooth_proxy, esp32_ble_tracker, ln882h_ble_tracker, rp2_ble_tracker]
refresh: 1h(Added by the PR bot) |
|
@bluetoothbot review |
|
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
PR Review — [ble_device_base] Bind BLEHub to the build's tracker at compile timeApprove — the devirtualization is correct and consistently applied, and this round closes the last actionable nit from the previous review. Only non-blocking notes remain. Specific strengths, each re-verified against the tree this round rather than carried forward on trust:
Resolved since the previous round:
Remaining, both non-blocking:
✅ Resolved since last review (1)Previously-flagged issues verified fixed
🟢 Suggestions
1. Mode-change report is compiled out for push hubs, but a push only fires on a state transition
|
There was a problem hiding this comment.
Tip
No blocking issues found — ready to merge.
|
decline the remaining bot suggestion. Its going to get refactored anyways in future PRs |
|
thanks |
What does this implement/fix?
Replaces the abstract BLEHub interface with a compile time binding, chained on #18179. Exactly one tracker exists per build, so ble_device_base/ble_hub_impl.h now selects it with a
using BLEHub = ...alias (each tracker's codegen emits a USE_*_BLE_TRACKER define) and the virtual class is deleted. Every hub call becomes a direct, inlinable member call; the trackers drop their vtable for the contract; ble_hub.h keeps the shared types and documents the duck typed method surface, which a tracker missing a method fails at the consumer's call site.What falls out:
This should land before 2026.8.0 ships: the BLEHub contract is new in this cycle and has never been released, so reshaping it now is free while doing it later would be a breaking change.
Not breaking for users or external components; the interface never shipped and there are no external hubs or platforms.
Types of changes
Related issue or feature (if applicable):
Pull request in esphome.io with documentation (if applicable):
Pull request in developers.esphome.io with developer documentation (if applicable):
Test Environment
Example entry for
config.yaml:# Example config.yamlChecklist:
tests/folder).If user exposed functionality or configuration variables are added/changed: