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

@@ -895,7 +895,18 @@ class PointerToBytesBufferType(TypeInfo):
return WireType.LENGTH_DELIMITED # Uses wire type 2
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:
return f"size.add_length({self.number}, this->{self.field_name}_len);"