mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
edb2145aca99fb737619acbc24f099327a359d5f
Reorder FieldFlags so the eight [0.0, 1.0]-clamped float fields occupy bits 0-7 in the same order as they appear in LightCall and LightColorValues, and move color_temperature_ to the end of both structs. Under that layout the LightCall offset for clamp field i is `offsetof(LightCall, brightness_) + i * 4`, and the LightColorValues offset is exactly 12 bytes lower for every field. validate_() now iterates the active clamp bits in a small loop that computes these offsets from the bit position instead of expanding eight nearly identical inline blocks via macro. The field-name PROGMEM pointer is passed to clamp_and_log_if_invalid as `const LogString *const *`; progmem_read_ptr only runs on the cold (out-of-range) path, so the hot path performs no flash reads for the name. The eight invariants the loop relies on (flag-bit layout, field contiguity, and the constant 12-byte delta) are enforced by static_asserts so any future reshuffle fails loudly at compile time. Size deltas for the isolated light component build (vs dev): ESP32-IDF: -118 B code, +32 B PROGMEM name table = -86 B net ESP8266: -56 B code, +32 B PROGMEM name table = -24 B net 0 B RAM impact on both targets.
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
545 MiB
Languages
C++
60.1%
Python
39.3%
C
0.3%
JavaScript
0.2%
