From dd346263f3f1e56c9bc7d48fcdcb76c6e74f52f0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 20 Apr 2024 01:54:47 +0200 Subject: [PATCH] Fix missing conn_id check in bluetooth_proxy disconnect event Pointed out by @elupus while debugging https://github.com/home-assistant/core/issues/103117 --- esphome/components/bluetooth_proxy/bluetooth_connection.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/esphome/components/bluetooth_proxy/bluetooth_connection.cpp b/esphome/components/bluetooth_proxy/bluetooth_connection.cpp index 97a25262c..b85ec3947 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_connection.cpp +++ b/esphome/components/bluetooth_proxy/bluetooth_connection.cpp @@ -20,6 +20,8 @@ bool BluetoothConnection::gattc_event_handler(esp_gattc_cb_event_t event, esp_ga switch (event) { case ESP_GATTC_DISCONNECT_EVT: { + if (param->disconnect.conn_id != this->conn_id_) + break; this->proxy_->send_device_connection(this->address_, false, 0, param->disconnect.reason); this->set_address(0); this->proxy_->send_connections_free();