From 5adc58f82697285c7d7a69986ce2f44dd6f2dcef Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 22 Jul 2025 09:00:44 -1000 Subject: [PATCH] cleans to dump --- esphome/components/api/api_pb2_dump.cpp | 4 ---- script/api_protobuf/api_protobuf.py | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/esphome/components/api/api_pb2_dump.cpp b/esphome/components/api/api_pb2_dump.cpp index dbc5a10366..ddd739c424 100644 --- a/esphome/components/api/api_pb2_dump.cpp +++ b/esphome/components/api/api_pb2_dump.cpp @@ -720,7 +720,6 @@ void DeviceInfoResponse::dump_to(std::string &out) const { out.append(" area: "); this->area.dump_to(out); out.append("\n"); - #endif out.append("}"); } @@ -1187,7 +1186,6 @@ void CameraImageResponse::dump_to(std::string &out) const { out.append(" data: "); out.append(format_hex_pretty(this->data_ptr_, this->data_len_)); out.append("\n"); - dump_field(out, "done", this->done); #ifdef USE_DEVICES dump_field(out, "device_id", this->device_id); @@ -1799,7 +1797,6 @@ void VoiceAssistantRequest::dump_to(std::string &out) const { out.append(" audio_settings: "); this->audio_settings.dump_to(out); out.append("\n"); - dump_field(out, "wake_word_phrase", this->wake_word_phrase_ref_); out.append("}"); } @@ -1834,7 +1831,6 @@ void VoiceAssistantAudio::dump_to(std::string &out) const { out.append(format_hex_pretty(reinterpret_cast(this->data.data()), this->data.size())); } out.append("\n"); - dump_field(out, "end", this->end); out.append("}"); } diff --git a/script/api_protobuf/api_protobuf.py b/script/api_protobuf/api_protobuf.py index f64bf38324..07f2111258 100755 --- a/script/api_protobuf/api_protobuf.py +++ b/script/api_protobuf/api_protobuf.py @@ -620,7 +620,7 @@ class StringType(TypeInfo): # For SOURCE_BOTH, we need custom logic o = f'out.append(" {self.name}: ");\n' o += self.dump(f"this->{self.field_name}") + "\n" - o += 'out.append("\\n");\n' + o += 'out.append("\\n");' return o def get_size_calculation(self, name: str, force: bool = False) -> str: @@ -689,7 +689,7 @@ class MessageType(TypeInfo): def dump_content(self) -> str: o = f'out.append(" {self.name}: ");\n' o += f"this->{self.field_name}.dump_to(out);\n" - o += 'out.append("\\n");\n' + o += 'out.append("\\n");' return o def get_size_calculation(self, name: str, force: bool = False) -> str: @@ -768,7 +768,7 @@ class BytesType(TypeInfo): def dump_content(self) -> str: o = f'out.append(" {self.name}: ");\n' o += self.dump(f"this->{self.field_name}") + "\n" - o += 'out.append("\\n");\n' + o += 'out.append("\\n");' return o def get_size_calculation(self, name: str, force: bool = False) -> str: