esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

Setting default_transition_length to 0s makes fastled_clockless misbehave #6066

Open samueltardieu opened 1 month ago

samueltardieu commented 1 month ago

The problem

The default_transition_length for the fastled_clockless platform is set to 1s by default. It is marked as Optional but since it has a default (inherited from the light platform) it is always present.

Setting it to 0s (or to a low value such as 1ms) makes it ignore changes until the next command is sent. Instead, the change should take place immediately.

Incidentally, even a command to another led strip using the same platform seems to be enough for the previous (unapplied) change to take place, possibly at the same time as the new change as well. The behaviour looks erratic.

Which version of ESPHome has the issue?

2024.6.6

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

ESP32

Board

Custom board

Component causing the issue

fastled_clockless

Example YAML snippet

power_supply:
  - id: ledstripen1
    pin: GPIO25
    keep_on_time: 5s
  - id: ledstripen2
    pin: GPIO26
    keep_on_time: 5s

light:
  - platform: fastled_clockless
    chipset: ws2812b
    pin: GPIO23
    num_leds: 38
    rgb_order: RGB
    default_transition_length: 0s  # This doesn't work well
    name: "Led strip 1"
    power_supply: ledstripen1
  - platform: fastled_clockless
    chipset: ws2812b
    pin: GPIO22
    num_leds: 38
    rgb_order: RGB
    default_transition_length: 0s  # This doesn't work well
    name: "Led strip 2"
    power_supply: ledstripen2

Anything in the logs that might be useful for us?

No response

Additional information

I have kept the power_supply entries to match my existing configuration, but note that the power_supply pins are to a power circuit which connects the led strip power to an external power source. The external power source is always on, powering the leds does not require any time, and the problem exists even if the power is kept turned on.

samueltardieu commented 1 month ago

More precisely, with a 0s default transition length, it looks like every second command is ignored. For example, using only one led strip, starting with it being lit in white: