From 0f3db32b46499b7b7afb935e58c7444fdaf2f4ed Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 6 Jun 2025 11:32:48 +0100 Subject: [PATCH] optimize --- esphome/components/api/api_connection.h | 4 ++-- esphome/components/api/api_frame_helper.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/esphome/components/api/api_connection.h b/esphome/components/api/api_connection.h index 12251b8ba4..89ec61877c 100644 --- a/esphome/components/api/api_connection.h +++ b/esphome/components/api/api_connection.h @@ -315,8 +315,8 @@ class APIConnection : public APIServerConnection { #ifdef USE_BINARY_SENSOR static EncodedMessage try_send_binary_sensor_state(EntityBase *binary_sensor, APIConnection *conn, uint32_t remaining_size, bool is_single); - static EncodedMessage try_send_binary_sensor_info(EntityBase *binary_sensor, APIConnection *conn, - uint32_t remaining_size, bool is_single); + static EncodedMessage try_send_binary_sensor_info(EntityBase *entity, APIConnection *conn, uint32_t remaining_size, + bool is_single); #endif #ifdef USE_COVER static EncodedMessage try_send_cover_state(EntityBase *entity, APIConnection *conn, uint32_t remaining_size, diff --git a/esphome/components/api/api_frame_helper.cpp b/esphome/components/api/api_frame_helper.cpp index 456720c668..92d419b91a 100644 --- a/esphome/components/api/api_frame_helper.cpp +++ b/esphome/components/api/api_frame_helper.cpp @@ -613,7 +613,7 @@ APIError APINoiseFrameHelper::write_protobuf_packet(uint16_t type, ProtoWriteBuf // Use write_protobuf_packets with a single packet std::vector> packets; - packets.push_back(std::make_tuple(type, 0, payload_len)); + packets.emplace_back(type, 0, payload_len); return write_protobuf_packets(buffer, packets); }