diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index 58242495d9..3f11222b19 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -672,20 +672,6 @@ class ProtoSize { // NOTE: sint64 support functions (add_sint64_field, add_sint64_field_repeated) removed // sint64 type is not supported by ESPHome API to reduce overhead on embedded systems - /** - * @brief Calculates and adds the size of a string/bytes field to the total message size - */ - static inline void add_string_field(uint32_t &total_size, uint32_t field_id_size, const std::string &str) { - // Skip calculation if string is empty - if (str.empty()) { - return; // No need to update total_size - } - - // Calculate and directly add to total_size - const uint32_t str_size = static_cast(str.size()); - total_size += field_id_size + varint(str_size) + str_size; - } - /** * @brief Calculates and adds the size of a string field using length */