From d9da4cf24d0bd5a3656529a40c1b089f2311e8bd Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 13 Jun 2025 16:10:33 -0500 Subject: [PATCH] Fix misleading comment in API (#9069) --- esphome/components/api/api_connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 93ba9248b4..d09b1107d2 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -260,7 +260,7 @@ uint16_t APIConnection::encode_message_to_buffer(ProtoMessage &msg, uint16_t mes return 0; // Doesn't fit } - // Allocate exact buffer space needed (just the payload, not the overhead) + // Allocate buffer space - pass payload size, allocation functions add header/footer space ProtoWriteBuffer buffer = is_single ? conn->allocate_single_message_buffer(size) : conn->allocate_batch_message_buffer(size);