1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 08:15:49 +00:00

not needed

This commit is contained in:
J. Nick Koston
2025-11-06 14:42:42 -06:00
parent 190668c25f
commit d8b419b60c
2 changed files with 8 additions and 16 deletions

View File

@@ -170,15 +170,10 @@ void WiFiComponent::loop() {
this->status_set_warning(LOG_STR("waiting to reconnect")); this->status_set_warning(LOG_STR("waiting to reconnect"));
if (millis() - this->action_started_ > 5000) { if (millis() - this->action_started_ > 5000) {
#ifdef USE_WIFI_FAST_CONNECT #ifdef USE_WIFI_FAST_CONNECT
if (this->fast_connect_exhausted_) {
// All APs tried, fall back to scanning
this->start_scanning();
} else {
// Safety check: Ensure selected_sta_index_ is valid before retrying // Safety check: Ensure selected_sta_index_ is valid before retrying
// (should already be set by retry_connect(), but check for robustness) // (should already be set by retry_connect(), but check for robustness)
this->reset_selected_ap_to_first_if_invalid_(); this->reset_selected_ap_to_first_if_invalid_();
this->start_connecting_to_selected_(false); this->start_connecting_to_selected_(false);
}
#else #else
if (this->retry_hidden_) { if (this->retry_hidden_) {
this->reset_selected_ap_to_first_if_invalid_(); this->reset_selected_ap_to_first_if_invalid_();
@@ -759,7 +754,6 @@ void WiFiComponent::check_connecting_finished() {
this->num_retried_ = 0; this->num_retried_ = 0;
#ifdef USE_WIFI_FAST_CONNECT #ifdef USE_WIFI_FAST_CONNECT
this->fast_connect_exhausted_ = false; // Reset on successful connection
this->save_fast_connect_settings_(); this->save_fast_connect_settings_();
#endif #endif
@@ -821,11 +815,10 @@ void WiFiComponent::retry_connect() {
this->selected_sta_index_ = 0; // Retry from the first configured AP this->selected_sta_index_ = 0; // Retry from the first configured AP
this->reset_for_next_ap_attempt_(); this->reset_for_next_ap_attempt_();
} else if (this->selected_sta_index_ >= static_cast<int8_t>(this->sta_.size()) - 1) { } else if (this->selected_sta_index_ >= static_cast<int8_t>(this->sta_.size()) - 1) {
// Exhausted all configured APs, fall back to full scan // Exhausted all configured APs, cycle back to first
ESP_LOGW(TAG, "No more APs to try, starting scan"); // Each AP is tried with SSID only (no BSSID/channel) which triggers ESP-IDF internal scanning
this->fast_connect_exhausted_ = true; this->selected_sta_index_ = 0;
this->restart_adapter(); this->reset_for_next_ap_attempt_();
return;
} else { } else {
// Try next AP // Try next AP
this->selected_sta_index_++; this->selected_sta_index_++;

View File

@@ -482,7 +482,6 @@ class WiFiComponent : public Component {
// Group all boolean values together // Group all boolean values together
#ifdef USE_WIFI_FAST_CONNECT #ifdef USE_WIFI_FAST_CONNECT
bool trying_loaded_ap_{false}; bool trying_loaded_ap_{false};
bool fast_connect_exhausted_{false}; // All APs tried, fall back to scan
#endif #endif
bool retry_hidden_{false}; bool retry_hidden_{false};
bool has_ap_{false}; bool has_ap_{false};