1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-25 06:32:22 +01:00

cleaner fix

This commit is contained in:
J. Nick Koston
2025-06-17 22:29:21 +02:00
parent b27c6b3596
commit b69191e3a8

View File

@@ -45,11 +45,16 @@ void BLEClientBase::loop() {
}
this->set_state(espbt::ClientState::IDLE);
}
// READY_TO_CONNECT means we have discovered the device
// and the scanner has been stopped by the tracker.
elif (this->state_ == espbt::ClientState::READY_TO_CONNECT) { this->connect(); }
elif (this->state_ == espbt::ClientState::IDLE) { this->disable_loop(); }
else if (this->state_ == espbt::ClientState::READY_TO_CONNECT) {
this->connect();
}
// If its idle, we can disable the loop as set_state
// will enable it again when we need to connect.
else if (this->state_ == espbt::ClientState::IDLE) {
this->disable_loop();
}
}
float BLEClientBase::get_setup_priority() const { return setup_priority::AFTER_BLUETOOTH; }