mirror of
https://github.com/esphome/esphome.git
synced 2025-09-26 15:12:21 +01:00
fix dump
This commit is contained in:
@@ -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));
|
||||||
|
@@ -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);"
|
||||||
|
Reference in New Issue
Block a user