Commit Graph
31 Commits
Author SHA1 Message Date
J. Nick Koston c7b4ee5c60 fix when on_boot at 800 2026-04-13 22:40:17 -10:00
J. Nick Koston 12b55f176f [light] Clearer uniformity scan + note edge case in uniform path 2026-04-13 14:56:48 -10:00
J. Nick Koston 93893e02a7 Revert: raw-byte uniformity check (didn't help inlining) 2026-04-13 14:35:23 -10:00
J. Nick Koston 6edadaa33b [light] Use raw byte compare for uniformity scan to keep apply() hot path inlinable 2026-04-13 14:31:42 -10:00
J. Nick Koston 4e8f98e767 [light] Collapse uniform-start flag+Color into optional<Color> 2026-04-13 14:22:13 -10:00
J. Nick Koston 3f56e0255a [light] Avoid addressable transition stall at low gamma-corrected values
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).
2026-04-13 14:17:21 -10:00
J. Nick Koston 45c994e4de [light] Modernize namespace declarations to C++17 syntax (#11986) 2025-11-18 21:56:23 -06:00
Jeff Brown d37eb59fd7 [light] Eliminate dimming undershoot during addressable light transition (#11471) 2025-10-22 08:22:33 +00:00
Jeff BrownandJ. Nick Koston 8e8a2bde95 [light] Decouple AddressableLight and Light transition classes (#11166)
Co-authored-by: J. Nick Koston <nick@koston.org>
2025-10-21 10:37:29 -10:00
Paul Monigatti 867fecd157 Fix: Light flash not restoring previous LightState (#2383)
* Update light state when transformer has finished

* Revert writing direct to output

* Correct handling of zero-length light transformers

* Allow transformers to handle zero-length transitions, and check more boundary conditions when transitioning back to start state

* Removed log.h

* Fixed race condition between LightFlashTransformer.apply() and is_finished()

* clang-format

* Step progress from 0.0f to 1.0f at t=start_time for zero-length transforms to avoid divide-by-zero
2021-10-13 21:59:52 +02:00
Oxan van Leeuwen 50da630811 Apply color brightness to addressable light effects (#2321) 2021-09-19 18:46:26 +02:00
Oxan van Leeuwen 68d547595e Light transition fixes (#2320) 2021-09-19 18:31:20 +02:00
Oxan van Leeuwen 518c271eba Fix addressable light control without transitions & effects with transitions (#2187) 2021-08-23 20:44:24 +12:00
Oxan van Leeuwen 2f33cd2db5 Remove double scheduling from addressable lights (#1963) 2021-08-23 20:00:38 +12:00
Maurice MakaayandMaurice Makaay 607e1f823d Minor code cleanup in light components (#2162)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-08-17 20:12:29 +12:00
Oxan van Leeuwen 46f17bea66 Modular light transformers (#2124) 2021-08-11 16:51:35 +12:00
Oxan van Leeuwen 1652914d39 Make light.addressable_set color parameters behave as documented & consistent with elsewhere (#2009) 2021-07-28 19:49:43 +02:00
Oxan van Leeuwen fc0deb642a Fix white value transition for addressable lights (#2045) 2021-07-21 08:42:03 +12:00
Oxan van Leeuwen f9797825ad Change color model to fix white channel issues (#1895) 2021-07-08 21:37:47 +12:00
Oxan van Leeuwen 0efc1f06f2 Split files in light component (#1893) 2021-06-14 18:01:56 +02:00
Stefan Agner 501f88ca86 Avoid non-const globals and enable clang-tidy check (#1892) 2021-06-11 08:19:44 +12:00
Otto Winter 360effcb72 Activate some clang-tidy checks (#1884) 2021-06-10 13:04:40 +02:00
SenexCrenshaw ac25b138f5 Migrate ESPColor to Color (#1551)
* Migrate ESPColor to Color

* color.h constructor fix

* Updated componets to use Color
Added a using for ESPColor

* Lint fixes

* Fixed value error

* Update display components to use colorutil

* Updated to latest PR comments

* Fixed COLOR_WHITE

* Moved esp_scale to color_utils

* Rename color_utils to display_color_utils
2021-03-02 11:08:57 -03:00
Otto Winter 95a74a7f19 Addressable light transition (#750)
* Improve addressable light transition behavior

Fixes https://github.com/esphome/issues/issues/555

* Improve addressable flicker effect

See also https://github.com/esphome/feature-requests/issues/348

* Update addressable_light_effect.h

* Refactor

* Format

* Prevent divide by zero

* Fixes
2019-10-18 16:27:36 +02:00
Otto Winter e15071228e Fix addressable light fade to black function (#752)
Fixes https://github.com/esphome/issues/issues/517
2019-10-17 16:53:55 +02:00
Otto Winter 36f47ade70 Add Captive Portal (#624)
* WIP: Captive Portal

* Updates

* Updates

* Lint

* Fixes
2019-06-09 17:03:51 +02:00
Otto Winter 2642750466 Fix color wipe effect (#599) 2019-06-03 09:05:20 +02:00
Otto Winter f921997ee6 Fix addressable effects (#590) 2019-06-01 12:00:00 +02:00
Otto Winter a72c3ea9d7 Fix light partition (#584)
* Fix light partition

Fixes https://github.com/esphome/issues/issues/365

* Lint
2019-05-31 13:38:56 +02:00
Otto Winter 595dfe7e24 Addressable updates 2019-04-25 10:36:55 +02:00
Otto Winter 766f6c045d Updates 2019-04-24 23:49:02 +02:00