mirror of
https://github.com/esphome/esphome.git
synced 2025-09-26 07:02:21 +01:00
cleaner fix
This commit is contained in:
@@ -45,11 +45,16 @@ void BLEClientBase::loop() {
|
|||||||
}
|
}
|
||||||
this->set_state(espbt::ClientState::IDLE);
|
this->set_state(espbt::ClientState::IDLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// READY_TO_CONNECT means we have discovered the device
|
// READY_TO_CONNECT means we have discovered the device
|
||||||
// and the scanner has been stopped by the tracker.
|
// and the scanner has been stopped by the tracker.
|
||||||
elif (this->state_ == espbt::ClientState::READY_TO_CONNECT) { this->connect(); }
|
else if (this->state_ == espbt::ClientState::READY_TO_CONNECT) {
|
||||||
elif (this->state_ == espbt::ClientState::IDLE) { this->disable_loop(); }
|
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; }
|
float BLEClientBase::get_setup_priority() const { return setup_priority::AFTER_BLUETOOTH; }
|
||||||
|
Reference in New Issue
Block a user