mirror of
https://github.com/esphome/esphome.git
synced 2026-09-16 09:38:42 +00:00
3f56e0255a4f141a58f79f8e09e72db8854298c7
When a uniform-colored addressable strip transitions from one color to another, interpolate math-only against a cached start color instead of reading each LED's current value back through the 8-bit stored byte. The old algorithm used led.get_red()/etc. every step as the source for the delta, which round-tripped through gamma uncorrect/correct and the 8-bit stored byte. At gamma 2.8, any pre-gamma value below ~27 rounds to stored byte 0, so small early-transition steps produced stored 0 and the next step read back 0, stalling progress until ~90% of the transition before a single step produced a large-enough pre-gamma value to clear the gamma threshold. Result: dark for the first 9s of a 10s fade, then jump on in the final 1s. Detect uniform start state in start() and take a cheap math-only lerp path when true, so the stored byte advances through each gamma threshold as smoothed_progress crosses it. Falls back to the existing per-LED read-back algorithm when the buffer is non-uniform (e.g. when transitioning out of an addressable effect).
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
601 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
