1
0
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:
J. Nick Koston
2025-08-04 16:26:40 -10:00
parent 166ed736a9
commit 655d001d72
2 changed files with 6 additions and 3 deletions

View File

@@ -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;

View File

@@ -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 {