mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 09:08:41 +00:00
The protobuf code generator already parses all enum definitions and knows every enum's maximum value. Use this to automatically apply the max_value < 128 optimization to all enum fields, eliminating the need for manual annotation. Since every enum in api.proto has max < 128, all 58 enum field size calculations now use constant arithmetic instead of calling varint size functions. Builds on #15424 which introduced the max_value optimization.