1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 14:43:51 +00:00

Fix bluetooth proxy busy loop when disconnecting pending BLE connections

This commit is contained in:
J. Nick Koston
2025-07-05 11:11:36 -05:00
parent 4e9e48e2e7
commit 096ec79ef9

View File

@@ -170,7 +170,7 @@ int BluetoothProxy::get_bluetooth_connections_free() {
void BluetoothProxy::loop() { void BluetoothProxy::loop() {
if (!api::global_api_server->is_connected() || this->api_connection_ == nullptr) { if (!api::global_api_server->is_connected() || this->api_connection_ == nullptr) {
for (auto *connection : this->connections_) { for (auto *connection : this->connections_) {
if (connection->get_address() != 0) { if (connection->get_address() != 0 && !connection->disconnect_pending()) {
connection->disconnect(); connection->disconnect();
} }
} }