1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-23 12:13:49 +01:00

Merge branch 'fast_connect_cond_compile' into integration

This commit is contained in:
J. Nick Koston
2025-10-17 11:20:46 -10:00
2 changed files with 6 additions and 3 deletions

View File

@@ -169,16 +169,17 @@ 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
// NOTE: This check may not make sense here as it could interfere with AP cycling
if (!this->selected_ap_.get_bssid().has_value()) if (!this->selected_ap_.get_bssid().has_value())
this->selected_ap_ = this->sta_[0]; this->selected_ap_ = this->sta_[0];
this->start_connecting(this->selected_ap_, false); this->start_connecting(this->selected_ap_, false);
#else #else
if (!this->retry_hidden_) { if (this->retry_hidden_) {
this->start_scanning();
} else {
if (!this->selected_ap_.get_bssid().has_value()) if (!this->selected_ap_.get_bssid().has_value())
this->selected_ap_ = this->sta_[0]; this->selected_ap_ = this->sta_[0];
this->start_connecting(this->selected_ap_, false); this->start_connecting(this->selected_ap_, false);
} else {
this->start_scanning();
} }
#endif #endif
} }

View File

@@ -414,7 +414,9 @@ class WiFiComponent : public Component {
WiFiComponentState state_{WIFI_COMPONENT_STATE_OFF}; WiFiComponentState state_{WIFI_COMPONENT_STATE_OFF};
WiFiPowerSaveMode power_save_{WIFI_POWER_SAVE_NONE}; WiFiPowerSaveMode power_save_{WIFI_POWER_SAVE_NONE};
uint8_t num_retried_{0}; uint8_t num_retried_{0};
#ifdef USE_WIFI_FAST_CONNECT
uint8_t ap_index_{0}; uint8_t ap_index_{0};
#endif
#if USE_NETWORK_IPV6 #if USE_NETWORK_IPV6
uint8_t num_ipv6_addresses_{0}; uint8_t num_ipv6_addresses_{0};
#endif /* USE_NETWORK_IPV6 */ #endif /* USE_NETWORK_IPV6 */