mirror of
https://github.com/esphome/esphome.git
synced 2026-02-18 23:45:40 -07:00
0b02476e8a99bae1122b73af70d37f3734534938
After clamp_and_log_if_invalid() clamps the value in-place, the LightColorValues setter's clamp() is guaranteed to be a no-op. For 5 of 9 fields the compiler was inlining the setter's clamp, generating ~18 bytes of redundant float compare + conditional move per field. Use friend access to assign directly to LightColorValues fields, bypassing the setter. Also apply the same optimization to normalize_color() where division by max_value guarantees results stay in [0,1].
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
362 MiB
Languages
C++
64.2%
Python
35.5%
C
0.2%
