mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 15:27:33 +00:00
Warn when any UDP address is dropped and print the boot delay with PRIu32
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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_) {
|
||||
|
||||
Reference in New Issue
Block a user