1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-16 23:05:46 +00:00
This commit is contained in:
J. Nick Koston
2025-11-09 15:54:43 -06:00
parent 307cd0cc83
commit f8c5c26958

View File

@@ -508,14 +508,19 @@ void WiFiComponent::save_wifi_sta(const std::string &ssid, const std::string &pa
} }
void WiFiComponent::start_connecting(const WiFiAP &ap, bool two) { void WiFiComponent::start_connecting(const WiFiAP &ap, bool two) {
// Log connection attempt at INFO level // Log connection attempt at INFO level with priority
if (ap.get_bssid().has_value()) { if (ap.get_bssid().has_value()) {
ESP_LOGI(TAG, "Connecting to '%s' " LOG_SECRET("(%s)") " (attempt %u/%u in phase %s)...", ap.get_ssid().c_str(), float priority = this->get_sta_priority(ap.get_bssid().value());
format_mac_address_pretty(ap.get_bssid().value().data()).c_str(), this->num_retried_ + 1, ESP_LOGI(
get_max_retries_for_phase(this->retry_phase_), LOG_STR_ARG(retry_phase_to_log_string(this->retry_phase_))); TAG,
"Connecting to " LOG_SECRET("'%s'") " " LOG_SECRET("(%s)") " (priority %.1f, attempt %u/%u in phase %s)...",
ap.get_ssid().c_str(), format_mac_address_pretty(ap.get_bssid().value().data()).c_str(), priority,
this->num_retried_ + 1, get_max_retries_for_phase(this->retry_phase_),
LOG_STR_ARG(retry_phase_to_log_string(this->retry_phase_)));
} else { } else {
ESP_LOGI(TAG, "Connecting to '%s' (attempt %u/%u in phase %s)...", ap.get_ssid().c_str(), this->num_retried_ + 1, ESP_LOGI(TAG, "Connecting to " LOG_SECRET("'%s'") " (attempt %u/%u in phase %s)...", ap.get_ssid().c_str(),
get_max_retries_for_phase(this->retry_phase_), LOG_STR_ARG(retry_phase_to_log_string(this->retry_phase_))); this->num_retried_ + 1, get_max_retries_for_phase(this->retry_phase_),
LOG_STR_ARG(retry_phase_to_log_string(this->retry_phase_)));
} }
#ifdef ESPHOME_LOG_HAS_VERBOSE #ifdef ESPHOME_LOG_HAS_VERBOSE