From ff3e14099cf7df88c43e2268adac1aa703c955d1 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 10 Aug 2026 17:14:24 -0500 Subject: [PATCH] Point the slot range message at rp2040_ble and explain the import split --- esphome/components/bluetooth_connection/__init__.py | 7 +++++-- esphome/components/bluetooth_proxy/__init__.py | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/esphome/components/bluetooth_connection/__init__.py b/esphome/components/bluetooth_connection/__init__.py index 02c4a3989c..b8db91c1b2 100644 --- a/esphome/components/bluetooth_connection/__init__.py +++ b/esphome/components/bluetooth_connection/__init__.py @@ -106,8 +106,11 @@ async def _rp2_register(backend: cg.MockObj, config: ConfigType) -> None: @dataclass(frozen=True) class _PlatformBackend: - """One platform's backend: codegen class, extra schema keys (lazy so the - platform stack is only imported when targeted), and stack registration.""" + """One platform's backend: codegen class, extra schema keys, and stack + registration. The esp32 fragments import their stack lazily because those + imports register esp32-only automations as a side effect; rp2040_ble is + side-effect-free, so it is imported at module scope (the cap constant + needs it there anyway).""" backend_class: cg.MockObjClass schema_fragment: Callable[[], cv.Schema] diff --git a/esphome/components/bluetooth_proxy/__init__.py b/esphome/components/bluetooth_proxy/__init__.py index 3d0d706a24..8050442791 100644 --- a/esphome/components/bluetooth_proxy/__init__.py +++ b/esphome/components/bluetooth_proxy/__init__.py @@ -185,8 +185,8 @@ def _rp2_config_schema() -> cv.All: min=1, max=max_conn, msg=f"rp2 supports at most {max_conn} connection slot(s); " - "the BTstack pool overrides in bluetooth_connection " - f"are sized for {max_conn}", + "the BTstack pool overrides in rp2040_ble are sized " + f"for {max_conn}", ), ), }