From 3e69f41b42a71f6ec81617744e3ee6ac879e6442 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 3 Aug 2025 13:54:03 -1000 Subject: [PATCH] needs ifdef --- esphome/components/api/api_connection.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/esphome/components/api/api_connection.h b/esphome/components/api/api_connection.h index d15ad58114..f0f308c248 100644 --- a/esphome/components/api/api_connection.h +++ b/esphome/components/api/api_connection.h @@ -708,8 +708,11 @@ class APIConnection : public APIServerConnection { // 2. OR: We should try to send immediately (should_try_send_immediately = true) // AND Batch delay is 0 (user has opted in to immediate sending) // 3. AND: Buffer has space available - if ((message_type == UpdateStateResponse::MESSAGE_TYPE || - (this->flags_.should_try_send_immediately && this->get_batch_delay_ms_() == 0)) && + if (( +#ifdef USE_UPDATE + message_type == UpdateStateResponse::MESSAGE_TYPE || +#endif + (this->flags_.should_try_send_immediately && this->get_batch_delay_ms_() == 0)) && this->helper_->can_write_without_blocking()) { // Now actually encode and send if (creator(entity, this, MAX_BATCH_PACKET_SIZE, true) &&