From 4a9e5f5da99f0326f1dc9d904ab281c67615f037 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 9 Aug 2026 09:44:23 -0500 Subject: [PATCH] Require the proxy in the wrapper's compile gate The hub wrapper serves the proxy's API surface, but its gate keyed on the backend define alone while the backend guarded its own proxy pieces on USE_BLUETOOTH_PROXY. Narrow BLUETOOTH_CONNECTION_HAS_GATT to require both so a future backend-only consumer build agrees with the backend's guards. No change to any build this PR can produce (only the proxy emits USE_BLE_GATT_CLIENT here). --- .../bluetooth_connection/bluetooth_connection.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/esphome/components/bluetooth_connection/bluetooth_connection.h b/esphome/components/bluetooth_connection/bluetooth_connection.h index cdf7076ab7..5052e7eca1 100644 --- a/esphome/components/bluetooth_connection/bluetooth_connection.h +++ b/esphome/components/bluetooth_connection/bluetooth_connection.h @@ -19,10 +19,12 @@ // The connection-aware API request handlers are compiled: a GATT backend is // wired by codegen (one slot per connection). This is the single spelling of // that predicate - the hub wrapper and the API request handlers gate on it. -// Advertisement-only builds get the clean-error handlers; address-scoped -// maintenance (unpair, cache clear) still works there through the -// per-platform free functions below. -#ifdef USE_BLE_GATT_CLIENT +// The wrapper serves the proxy's API surface, so it compiles only when a +// backend AND the proxy are present; advertisement-only and backend-only +// builds get the clean-error handlers instead. Address-scoped maintenance +// (unpair, cache clear) still works there through the per-platform free +// functions below. +#if defined(USE_BLE_GATT_CLIENT) && defined(USE_BLUETOOTH_PROXY) #define BLUETOOTH_CONNECTION_HAS_GATT #endif