From 36ab68c1ea3260e1f2fe693f5287826b26d8a8ab Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 10 Oct 2025 17:31:13 -1000 Subject: [PATCH] [esp32_ble] Partial revert of #10862 - Fix GATT client notifications --- esphome/components/esp32_ble/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esphome/components/esp32_ble/__init__.py b/esphome/components/esp32_ble/__init__.py index 15afb22ab8..caa3934707 100644 --- a/esphome/components/esp32_ble/__init__.py +++ b/esphome/components/esp32_ble/__init__.py @@ -332,12 +332,15 @@ def final_validation(config): # Check if BLE Server is needed has_ble_server = "esp32_ble_server" in full_config - add_idf_sdkconfig_option("CONFIG_BT_GATTS_ENABLE", has_ble_server) # Check if BLE Client is needed (via esp32_ble_tracker or esp32_ble_client) has_ble_client = ( "esp32_ble_tracker" in full_config or "esp32_ble_client" in full_config ) + + # ESP-IDF BLE stack requires GATT Server to be enabled when GATT Client is enabled + # This is an internal dependency in the Bluedroid stack (tested up to ESP-IDF 5.5.1) + add_idf_sdkconfig_option("CONFIG_BT_GATTS_ENABLE", has_ble_server or has_ble_client) add_idf_sdkconfig_option("CONFIG_BT_GATTC_ENABLE", has_ble_client) # Handle max_connections: check for deprecated location in esp32_ble_tracker