mirror of
https://github.com/esphome/esphome.git
synced 2025-09-08 22:32:21 +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_() {
|
void ESP32BLETracker::try_promote_discovered_clients_() {
|
||||||
|
// Only promote the first discovered client to avoid multiple simultaneous connections
|
||||||
for (auto *client : this->clients_) {
|
for (auto *client : this->clients_) {
|
||||||
if (client->state() != ClientState::DISCOVERED) {
|
if (client->state() != ClientState::DISCOVERED) {
|
||||||
continue;
|
continue;
|
||||||
|
@@ -142,10 +142,12 @@ struct ClientStateCounts {
|
|||||||
uint8_t searching = 0;
|
uint8_t searching = 0;
|
||||||
uint8_t disconnecting = 0;
|
uint8_t disconnecting = 0;
|
||||||
|
|
||||||
bool operator!=(const ClientStateCounts &other) const {
|
bool operator==(const ClientStateCounts &other) const {
|
||||||
return connecting != other.connecting || discovered != other.discovered || searching != other.searching ||
|
return connecting == other.connecting && discovered == other.discovered && searching == other.searching &&
|
||||||
disconnecting != other.disconnecting;
|
disconnecting == other.disconnecting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator!=(const ClientStateCounts &other) const { return !(*this == other); }
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ClientState : uint8_t {
|
enum class ClientState : uint8_t {
|
||||||
|
Reference in New Issue
Block a user