diff --git a/esphome/components/esp32_ble_client/ble_client_base.cpp b/esphome/components/esp32_ble_client/ble_client_base.cpp index 3b35420d7b..026d55e1c6 100644 --- a/esphome/components/esp32_ble_client/ble_client_base.cpp +++ b/esphome/components/esp32_ble_client/ble_client_base.cpp @@ -299,16 +299,6 @@ bool BLEClientBase::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_ ESP_LOGD(TAG, "[%d] [%s] ESP_GATTC_OPEN_EVT in IDLE state (status=%d), ignoring", this->connection_index_, this->address_str_, param->open.status); break; - } else if (this->state() == espbt::ClientState::DISCONNECTING) { - // When a connection fails to establish, the ESP-IDF stack sends DISCONNECT_EVT - // (which we now transition to DISCONNECTING) followed by OPEN_EVT with a failure status. - // No CLOSE_EVT will follow since no GATT connection was established, so this - // failed OPEN_EVT is the terminal event — transition to IDLE here. - ESP_LOGD(TAG, "[%d] [%s] ESP_GATTC_OPEN_EVT in DISCONNECTING state (status=%d), completing disconnection", - this->connection_index_, this->address_str_, param->open.status); - this->set_state(espbt::ClientState::IDLE); - this->conn_id_ = UNSET_CONN_ID; - break; } if (this->state() != espbt::ClientState::CONNECTING) {