mirror of
https://github.com/esphome/esphome.git
synced 2026-10-14 10:12:52 +00:00
[api] Add encode_progmem_string for progmem string fields
Generated code passes the ProgmemStringRef instead of spelling out the cast.
This commit is contained in:
@@ -1285,10 +1285,9 @@ class PointerToStringBufferType(PointerToBufferTypeBase):
|
||||
return _encode_call(encode_fn, str(tag), f"this->{self.field_name}")
|
||||
if self.progmem:
|
||||
return _encode_call(
|
||||
"encode_progmem_bytes",
|
||||
"encode_progmem_string",
|
||||
str(self.number),
|
||||
f"reinterpret_cast<const uint8_t *>(this->{self.field_name}.progmem_ptr())",
|
||||
f"this->{self.field_name}.size()",
|
||||
f"this->{self.field_name}",
|
||||
force=self.force,
|
||||
)
|
||||
if result := self._encode_bytes_with_precomputed_tag(
|
||||
|
||||
Reference in New Issue
Block a user