mirror of
https://github.com/esphome/esphome.git
synced 2025-09-07 05:42:20 +01:00
address bot comments
This commit is contained in:
@@ -803,6 +803,7 @@ void ESP32BLETracker::handle_scanner_failure_() {
|
||||
}
|
||||
|
||||
void ESP32BLETracker::try_promote_discovered_clients_() {
|
||||
// Only promote the first discovered client to avoid multiple simultaneous connections
|
||||
for (auto *client : this->clients_) {
|
||||
if (client->state() != ClientState::DISCOVERED) {
|
||||
continue;
|
||||
|
@@ -142,10 +142,12 @@ struct ClientStateCounts {
|
||||
uint8_t searching = 0;
|
||||
uint8_t disconnecting = 0;
|
||||
|
||||
bool operator!=(const ClientStateCounts &other) const {
|
||||
return connecting != other.connecting || discovered != other.discovered || searching != other.searching ||
|
||||
disconnecting != other.disconnecting;
|
||||
bool operator==(const ClientStateCounts &other) const {
|
||||
return connecting == other.connecting && discovered == other.discovered && searching == other.searching &&
|
||||
disconnecting == other.disconnecting;
|
||||
}
|
||||
|
||||
bool operator!=(const ClientStateCounts &other) const { return !(*this == other); }
|
||||
};
|
||||
|
||||
enum class ClientState : uint8_t {
|
||||
|
Reference in New Issue
Block a user