From 19dba53f070d30de3e0bcc2ff31410632920bae8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 6 Jun 2025 01:20:18 +0100 Subject: [PATCH] remove batch --- esphome/components/api/api_connection.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 00892655f6..5bd1e823d2 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -1418,9 +1418,7 @@ void APIConnection::send_event(event::Event *event, std::string event_type) { this->schedule_batch_(); } void APIConnection::send_event_info(event::Event *event) { - // For info messages, we can use bind to avoid lambda overhead - this->deferred_batch_.add_item(event, &APIConnection::try_send_event_info_); - this->schedule_batch_(); + this->schedule_info_message_(event, &APIConnection::try_send_event_info_); } std::unique_ptr APIConnection::try_send_event_info_(EntityBase *entity) { auto *event = static_cast(entity); @@ -1463,9 +1461,7 @@ std::unique_ptr APIConnection::try_send_update_state_(EntityBase * return msg; } void APIConnection::send_update_info(update::UpdateEntity *update) { - // For info messages, we can use bind to avoid lambda overhead - this->deferred_batch_.add_item(update, &APIConnection::try_send_update_info_); - this->schedule_batch_(); + this->schedule_info_message_(update, &APIConnection::try_send_update_info_); } std::unique_ptr APIConnection::try_send_update_info_(EntityBase *entity) { auto *update = static_cast(entity);