1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 07:02:21 +01:00
This commit is contained in:
J. Nick Koston
2025-09-22 22:43:56 -05:00
parent cf7fad9c14
commit 8a54b6d76e
2 changed files with 18 additions and 2 deletions

View File

@@ -2126,7 +2126,12 @@ void UpdateCommandRequest::dump_to(std::string &out) const {
} }
#endif #endif
#ifdef USE_ZWAVE_PROXY #ifdef USE_ZWAVE_PROXY
void ZWaveProxyFrame::dump_to(std::string &out) const { dump_field(out, "data", this->data); } void ZWaveProxyFrame::dump_to(std::string &out) const {
MessageDumpHelper helper(out, "ZWaveProxyFrame");
out.append(" data: ");
out.append(format_hex_pretty(this->data, this->data_len));
out.append("\n");
}
void ZWaveProxyRequest::dump_to(std::string &out) const { void ZWaveProxyRequest::dump_to(std::string &out) const {
MessageDumpHelper helper(out, "ZWaveProxyRequest"); MessageDumpHelper helper(out, "ZWaveProxyRequest");
dump_field(out, "type", static_cast<enums::ZWaveProxyRequestType>(this->type)); dump_field(out, "type", static_cast<enums::ZWaveProxyRequestType>(this->type));

View File

@@ -895,7 +895,18 @@ class PointerToBytesBufferType(TypeInfo):
return WireType.LENGTH_DELIMITED # Uses wire type 2 return WireType.LENGTH_DELIMITED # Uses wire type 2
def dump(self, name: str) -> str: def dump(self, name: str) -> str:
return f"format_hex_pretty(this->{name}, this->{name}_len)" return (
f"format_hex_pretty(this->{self.field_name}, this->{self.field_name}_len)"
)
@property
def dump_content(self) -> str:
# Custom dump that doesn't use dump_field template
return (
f'out.append(" {self.name}: ");\n'
+ f"out.append({self.dump(self.field_name)});\n"
+ 'out.append("\\n");'
)
def get_size_calculation(self, name: str, force: bool = False) -> str: def get_size_calculation(self, name: str, force: bool = False) -> str:
return f"size.add_length({self.number}, this->{self.field_name}_len);" return f"size.add_length({self.number}, this->{self.field_name}_len);"