From 1de0a73a635abeb5121b53261b207724ed84d99f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 7 Aug 2025 12:55:31 -1000 Subject: [PATCH] preen --- .../components/bluetooth_proxy/bluetooth_connection.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/esphome/components/bluetooth_proxy/bluetooth_connection.cpp b/esphome/components/bluetooth_proxy/bluetooth_connection.cpp index a21a859c9e..b16b894188 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_connection.cpp +++ b/esphome/components/bluetooth_proxy/bluetooth_connection.cpp @@ -118,12 +118,11 @@ void BluetoothConnection::loop() { } // Check if we should disable the loop - // - For V3_WITH_CACHE: Services are never sent, disable immediately once connected + // - For V3_WITH_CACHE: Services are never sent, disable after INIT state // - For other connections: Disable only after service discovery is complete // (send_service_ == DONE_SENDING_SERVICES, which is only set after services are sent) - if ((this->state() == espbt::ClientState::ESTABLISHED || this->state() == espbt::ClientState::CONNECTED) && - (this->connection_type_ == espbt::ConnectionType::V3_WITH_CACHE || - this->send_service_ == DONE_SENDING_SERVICES)) { + if (this->state_ != espbt::ClientState::INIT && (this->connection_type_ == espbt::ConnectionType::V3_WITH_CACHE || + this->send_service_ == DONE_SENDING_SERVICES)) { this->disable_loop(); } }