From fbb519140d32e71402db6c5cbe6cfc3db36f907a Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 6 Jun 2025 02:11:25 +0100 Subject: [PATCH] remove batch --- esphome/components/api/api_connection.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/esphome/components/api/api_connection.cpp b/esphome/components/api/api_connection.cpp index 308d9f405d..333480b2ae 100644 --- a/esphome/components/api/api_connection.cpp +++ b/esphome/components/api/api_connection.cpp @@ -1412,12 +1412,13 @@ void APIConnection::alarm_control_panel_command(const AlarmControlPanelCommandRe #ifdef USE_EVENT void APIConnection::send_event(event::Event *event, std::string event_type) { this->schedule_message_(event, - [event_type = std::move(event_type)](EntityBase *entity) -> std::unique_ptr { + [event_type = std::move(event_type)](EntityBase *entity, ProtoWriteBuffer &buffer, + uint32_t max_size) -> APIConnection::MessageInfo { auto *e = static_cast(entity); EventResponse msg; // Stack allocated! - msg.event_type = std::move(event_type); + msg.event_type = event_type; msg.key = e->get_object_id_hash(); - return encode_message_to_buffer(msg, buffer, max_size); + return APIConnection::encode_message_to_buffer(msg, buffer, max_size); }); } void APIConnection::send_event_info(event::Event *event) {