From a303f9323682911c91a8c3eed50ec7dd1d6ba8d8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 6 Jul 2025 21:50:36 -0500 Subject: [PATCH] Fix bluetooth proxy busy loop when disconnecting pending BLE connections (#9332) --- esphome/components/bluetooth_proxy/bluetooth_proxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp index fbe2a3e67c..bf0adf1efd 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +++ b/esphome/components/bluetooth_proxy/bluetooth_proxy.cpp @@ -170,7 +170,7 @@ int BluetoothProxy::get_bluetooth_connections_free() { void BluetoothProxy::loop() { if (!api::global_api_server->is_connected() || this->api_connection_ == nullptr) { for (auto *connection : this->connections_) { - if (connection->get_address() != 0) { + if (connection->get_address() != 0 && !connection->disconnect_pending()) { connection->disconnect(); } }