diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 684d2ecefe..7b793c2bdb 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -1791,7 +1791,7 @@ void APIConnection::process_batch_() { this->batch_first_message_ = true; size_t items_processed = 0; - uint32_t remaining_size = std::numeric_limits::max(); + uint16_t remaining_size = std::numeric_limits::max(); // Track where each message's header padding begins in the buffer // For plaintext: this is where the 6-byte header padding starts