1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-19 16:25:50 +00:00
This commit is contained in:
J. Nick Koston
2025-11-06 11:35:57 -06:00
parent 670d85090c
commit e7e2df5c6d

View File

@@ -538,10 +538,8 @@ void WiFiComponent::print_connect_params_() {
LOG_STR_ARG(get_signal_bars(rssi)), get_wifi_channel(), wifi_subnet_mask_().str().c_str(), LOG_STR_ARG(get_signal_bars(rssi)), get_wifi_channel(), wifi_subnet_mask_().str().c_str(),
wifi_gateway_ip_().str().c_str(), wifi_dns_ip_(0).str().c_str(), wifi_dns_ip_(1).str().c_str()); wifi_gateway_ip_().str().c_str(), wifi_dns_ip_(0).str().c_str(), wifi_dns_ip_(1).str().c_str());
#ifdef ESPHOME_LOG_HAS_VERBOSE #ifdef ESPHOME_LOG_HAS_VERBOSE
if (const WiFiAP *config = this->get_selected_sta_()) { if (const WiFiAP *config = this->get_selected_sta_(); config && config->get_bssid().has_value()) {
if (config->get_bssid().has_value()) { ESP_LOGV(TAG, " Priority: %.1f", this->get_sta_priority(*config->get_bssid()));
ESP_LOGV(TAG, " Priority: %.1f", this->get_sta_priority(*config->get_bssid()));
}
} }
#endif #endif
#ifdef USE_WIFI_11KV_SUPPORT #ifdef USE_WIFI_11KV_SUPPORT
@@ -731,9 +729,8 @@ void WiFiComponent::check_connecting_finished() {
ESP_LOGI(TAG, "Connected"); ESP_LOGI(TAG, "Connected");
// We won't retry hidden networks unless a reconnect fails more than three times again // We won't retry hidden networks unless a reconnect fails more than three times again
if (this->retry_hidden_) { if (this->retry_hidden_) {
if (const WiFiAP *config = this->get_selected_sta_()) { if (const WiFiAP *config = this->get_selected_sta_(); config && !config->get_hidden()) {
if (!config->get_hidden()) ESP_LOGW(TAG, "Network '%s' should be marked as hidden", config->get_ssid().c_str());
ESP_LOGW(TAG, "Network '%s' should be marked as hidden", config->get_ssid().c_str());
} }
} }
this->retry_hidden_ = false; this->retry_hidden_ = false;
@@ -805,12 +802,10 @@ void WiFiComponent::check_connecting_finished() {
} }
void WiFiComponent::retry_connect() { void WiFiComponent::retry_connect() {
if (const WiFiAP *config = this->get_selected_sta_()) { if (const WiFiAP *config = this->get_selected_sta_(); config && config->get_bssid()) {
if (config->get_bssid()) { auto bssid = *config->get_bssid();
auto bssid = *config->get_bssid(); float priority = this->get_sta_priority(bssid);
float priority = this->get_sta_priority(bssid); this->set_sta_priority(bssid, priority - 1.0f);
this->set_sta_priority(bssid, priority - 1.0f);
}
} }
delay(10); delay(10);