1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-26 15:12:21 +01:00
This commit is contained in:
J. Nick Koston
2025-09-23 11:18:03 -05:00
parent ed62cc22ad
commit e368f4782d
8 changed files with 59 additions and 26 deletions

View File

@@ -373,6 +373,14 @@ def create_field_type_info(
# Traditional fixed array approach with copy
return FixedArrayBytesType(field, fixed_size)
# Check for pointer_to_buffer option on string fields
if field.type == 9:
has_pointer_to_buffer = get_field_opt(field, pb.pointer_to_buffer, False)
if has_pointer_to_buffer:
# Zero-copy pointer approach for strings
return PointerToBytesBufferType(field, None)
# Special handling for bytes fields
if field.type == 12:
return BytesType(field, needs_decode, needs_encode)