mirror of
https://github.com/esphome/esphome.git
synced 2026-10-03 09:46:03 +00:00
[bluetooth_proxy] Add an advertisement filter hook (#19220)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com> Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Claude Opus 5
pre-commit-ci-lite[bot]
parent
eea66fc32b
commit
6b08aa60e6
@@ -0,0 +1,13 @@
|
||||
"""The codegen hook external filtering components use to turn on the filter slot."""
|
||||
|
||||
from esphome.components import bluetooth_proxy
|
||||
from esphome.core import CORE
|
||||
|
||||
|
||||
def test_enable_advertisement_filter_emits_define() -> None:
|
||||
"""External components call this rather than emitting the define."""
|
||||
bluetooth_proxy.enable_advertisement_filter()
|
||||
|
||||
assert "USE_BLUETOOTH_PROXY_ADVERTISEMENT_FILTER" in {
|
||||
define.name for define in CORE.defines
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
# Compile the gated filter path; no external component is in-tree to call
|
||||
# enable_advertisement_filter(), so the define is forced here.
|
||||
<<: !include common.yaml
|
||||
|
||||
esphome:
|
||||
build_flags:
|
||||
- "-DUSE_BLUETOOTH_PROXY_ADVERTISEMENT_FILTER"
|
||||
|
||||
esp32_ble_tracker:
|
||||
|
||||
bluetooth_proxy:
|
||||
active: true
|
||||
Reference in New Issue
Block a user