Warn when any UDP address is dropped and print the boot delay with PRIu32

This commit is contained in:
J. Nick Koston
2026-09-04 21:21:50 +02:00
parent 0a74cb4e89
commit afc93a4dc8
2 changed files with 5 additions and 4 deletions
@@ -9,6 +9,7 @@
#include "esphome/core/log.h"
#include <cerrno>
#include <cinttypes>
#include <cstring>
namespace esphome::api {
@@ -228,7 +229,7 @@ void OutgoingConnectionManager::dump_config() const {
ESP_LOGCONFIG(TAG,
" Outgoing connection port: %u\n"
" Outgoing connection host: %s\n"
" Outgoing connection boot delay: %ums",
" Outgoing connection boot delay: %" PRIu32 "ms",
API_OUTGOING_CONNECTION_PORT, host, BOOT_WAIT_MS);
}
+3 -3
View File
@@ -19,9 +19,9 @@ void UDPComponent::setup() {
}
this->sockaddrs_.push_back(saddr);
}
if (!this->addresses_.empty() && this->sockaddrs_.empty()) {
// Sending would be a silent no-op; surface the misconfiguration
this->status_set_warning(LOG_STR("no valid addresses"));
if (this->sockaddrs_.size() != this->addresses_.size()) {
// A dropped address silently receives nothing; surface the misconfiguration
this->status_set_warning(LOG_STR("invalid address"));
}
// set up broadcast socket
if (this->should_broadcast_) {