Files
esphome/script
J. Nick Koston e174e579ed [api] Add max_data_length proto option and optimize entity name/object_id
Add max_data_length field option for string/bytes fields. When
max_data_length < 128, the codegen emits constant-size length varint
calculations and direct byte writes.

Annotate all entity name and object_id fields with
(max_data_length) = 120 and (force) = true across all 25
ListEntities*Response messages (50 fields).

Generated code changes:
- calculate_size: `calc_length(1, size)` -> `2 + size` (constant)
- encode: `encode_string(N, ref)` -> `write_raw_byte(tag) + write_raw_byte(len) + encode_raw(data, len)`

Eliminates 2 function calls per field per entity list response,
removes zero-check branches, and removes varint size computation.
2026-04-03 13:33:51 -10:00
..
2023-11-25 10:18:36 +11:00