1
0
mirror of https://github.com/esphome/esphome.git synced 2025-04-15 15:20:27 +01:00

Debug disconnecting before connected

This commit is contained in:
J. Nick Koston 2025-02-21 18:11:41 -06:00
parent 3fcb676fef
commit c4fb343dac
No known key found for this signature in database

View File

@ -125,7 +125,7 @@ esp_err_t BLEClientBase::pair() { return esp_ble_set_encryption(this->remote_bda
void BLEClientBase::disconnect() {
if (this->state_ == espbt::ClientState::IDLE || this->state_ == espbt::ClientState::DISCONNECTING)
return;
if (this->conn_id_ == UNSET_CONN_ID) {
if (this->state_ == espbt::ClientState::CONNECTING || this->conn_id_ == UNSET_CONN_ID) {
ESP_LOGW(TAG, "[%d] [%s] Disconnecting before connected", this->connection_index_, this->address_str_.c_str());
return;
}