mirror of
https://github.com/esphome/esphome.git
synced 2026-03-01 02:14:19 -07:00
a71d1c8867a726d05dd9324601148121a75ff5be
Replace runtime powf() calls in light gamma correction with pre-computed uint16[256] PROGMEM lookup tables generated at Python codegen time. The gamma value is a compile-time constant, so the tables can be computed once and shared across all lights with the same gamma value. This eliminates powf/ieee754_powf (~2.3KB) from the binary. Two 512-byte PROGMEM tables (forward + reverse) are shared per unique gamma value, for a net savings of ~1.3KB flash and zero RAM impact. The LUT uses linear interpolation between table entries, achieving zero PWM errors at both 8-bit and 16-bit resolution compared to the old powf-based approach. Breaking change: gamma parameter removed from LightColorValues::as_*() methods since gamma correction is now applied externally via LightState::gamma_correct_lut(). gamma_correct() and gamma_uncorrect() in helpers.h are deprecated (removal in 2026.12.0).
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
524 MiB
Languages
C++
64.1%
Python
35.5%
C
0.3%
