mirror of
https://github.com/esphome/esphome.git
synced 2026-07-11 01:15:33 +00:00
e35aa729f3ec6ff6640b3035cb20241766bc8514
Add a max_value field option to api_options.proto that tells the code generator the maximum value a field can have. When max_value < 128, the generated calculate_size() uses constant arithmetic instead of calling varint size functions, and encode() uses direct byte writes instead of varint encoding. Also optimize FixedArrayBytesType: when fixed_array_size < 128, the length varint is always 1 byte, so calculate_size() uses constant arithmetic and encode() uses write_raw_byte for the length. Applied to BluetoothLERawAdvertisement.address_type (max_value=4). Measured on ESP32 (upstairsdesk89proxy): - BluetoothLERawAdvertisement::calculate_size: 88 → 71 bytes (-19%) - BluetoothLERawAdvertisement::encode: 199 → 179 bytes (-10%) - Total BLE proxy hot path: 1807 → 1770 bytes (-37 bytes)
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme
Multiple Licenses
549 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
