diff --git a/esphome/components/api/api_pb2.h b/esphome/components/api/api_pb2.h index 728250baf4..1f91c5c179 100644 --- a/esphome/components/api/api_pb2.h +++ b/esphome/components/api/api_pb2.h @@ -991,7 +991,7 @@ class NoiseEncryptionSetKeyRequest : public ProtoDecodableMessage { #ifdef HAS_PROTO_MESSAGE_DUMP const char *message_name() const override { return "noise_encryption_set_key_request"; } #endif - std::string key{}; // Storage for decoded data + std::string key{}; #ifdef HAS_PROTO_MESSAGE_DUMP void dump_to(std::string &out) const override; #endif @@ -1914,7 +1914,7 @@ class BluetoothGATTWriteRequest : public ProtoDecodableMessage { uint64_t address{0}; uint32_t handle{0}; bool response{false}; - std::string data{}; // Storage for decoded data + std::string data{}; #ifdef HAS_PROTO_MESSAGE_DUMP void dump_to(std::string &out) const override; #endif @@ -1948,7 +1948,7 @@ class BluetoothGATTWriteDescriptorRequest : public ProtoDecodableMessage { #endif uint64_t address{0}; uint32_t handle{0}; - std::string data{}; // Storage for decoded data + std::string data{}; #ifdef HAS_PROTO_MESSAGE_DUMP void dump_to(std::string &out) const override; #endif @@ -2283,7 +2283,7 @@ class VoiceAssistantAudio : public ProtoDecodableMessage { #endif const uint8_t *data_ptr_{nullptr}; size_t data_len_{0}; - std::string data{}; // Storage for decoded data + std::string data{}; void set_data(const uint8_t *data, size_t len) { this->data_ptr_ = data; this->data_len_ = len; diff --git a/script/api_protobuf/api_protobuf.py b/script/api_protobuf/api_protobuf.py index 4b6ed891a8..b23f788256 100755 --- a/script/api_protobuf/api_protobuf.py +++ b/script/api_protobuf/api_protobuf.py @@ -625,9 +625,7 @@ class BytesType(TypeInfo): # Add std::string storage if message needs decoding if self.needs_decode: - content.append( - f"std::string {self.field_name}{{}}; // Storage for decoded data" - ) + content.append(f"std::string {self.field_name}{{}};") # Add setter method if message needs encoding if self.needs_encode: