From a5fc6b480a4ed509d4c5a811681ee60fcfa8b2fa Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 23 Feb 2026 09:33:49 -0600 Subject: [PATCH] [esp32_ble_client] Add comment for conn_id reset on failed OPEN_EVT --- esphome/components/esp32_ble_client/ble_client_base.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/esp32_ble_client/ble_client_base.cpp b/esphome/components/esp32_ble_client/ble_client_base.cpp index 6bf0a87b1e..4ec93f6fd7 100644 --- a/esphome/components/esp32_ble_client/ble_client_base.cpp +++ b/esphome/components/esp32_ble_client/ble_client_base.cpp @@ -311,6 +311,8 @@ bool BLEClientBase::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_ if (param->open.status != ESP_GATT_OK && param->open.status != ESP_GATT_ALREADY_OPEN) { this->log_gattc_warning_("Connection open", param->open.status); this->set_state(espbt::ClientState::IDLE); + // Reset conn_id since the connection was never established and + // CLOSE_EVT may not follow to clean it up this->conn_id_ = UNSET_CONN_ID; break; }