optimize
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -613,7 +613,7 @@ APIError APINoiseFrameHelper::write_protobuf_packet(uint16_t type, ProtoWriteBuf
|
||||
|
||||
// Use write_protobuf_packets with a single packet
|
||||
std::vector<std::tuple<uint16_t, uint32_t, uint16_t>> packets;
|
||||
packets.push_back(std::make_tuple(type, 0, payload_len));
|
||||
packets.emplace_back(type, 0, payload_len);
|
||||
|
||||
return write_protobuf_packets(buffer, packets);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user