From 29b5935a225f91329aa53d0fdeb80d6d2336cd09 Mon Sep 17 00:00:00 2001 From: kbx81 Date: Thu, 3 Sep 2026 00:35:44 -0500 Subject: [PATCH] [serial_proxy] Split refused-write logging by cause Writes are the only high-rate, unacknowledged operation, so a legacy client streaming without a subscription would flood WARN one line per request. Contention (another client holds the port) stays WARN; the never-subscribed case logs at VERBOSE. One-shot operations keep WARN in both cases since their request/ack pattern bounds the rate. --- esphome/components/serial_proxy/serial_proxy.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/esphome/components/serial_proxy/serial_proxy.cpp b/esphome/components/serial_proxy/serial_proxy.cpp index a4df90b5a4..e69bbfb31c 100644 --- a/esphome/components/serial_proxy/serial_proxy.cpp +++ b/esphome/components/serial_proxy/serial_proxy.cpp @@ -278,7 +278,14 @@ void SerialProxy::write_from_client(api::APIConnection *api_connection, const ui // Bytes from anyone but the live subscriber would interleave with the subscriber's // traffic -- or with an active tap's -- on the wire if (!this->is_subscriber_(api_connection)) { - ESP_LOGW(TAG, "Ignoring write from client without port subscription [%" PRIu32 "]", this->instance_index_); + if (this->api_connection_ != nullptr) { + ESP_LOGW(TAG, "Ignoring write from client that does not hold serial proxy [%" PRIu32 "]", this->instance_index_); + } else { + // A legacy client streaming writes without subscribing would flood WARN, one per + // request; writes are the only high-rate, unacknowledged operation, so keep this + // visible without drowning the log + ESP_LOGV(TAG, "Ignoring write from client without port subscription [%" PRIu32 "]", this->instance_index_); + } return; } #endif