I have been playing around with a Wipe In / Wipe Out effect, but somehow the Wipe Out effect takes 3-4 seconds before actually executing. The Wipe In is instant.
I have tried several Wipe Out effects I could find, but they all have the same issue.
light:
- platform: fastled_clockless
chipset: WS2812
id: fastled1
pin: 5
num_leds: 239
rgb_order: BRG
name: "$long_devicename - boven"
effects:
- addressable_lambda:
name: "Wipe Out"
update_interval: 1ms
lambda: |-
static int x = 0;
if (initial_run) {
x = it.size();
}
if (x > 0) {
x -= 1;
it[x] = ESPColor(0,0,0);
}
- addressable_lambda:
name: "Wipe In"
update_interval: 1ms
lambda: |-
if (initial_run) {
it.all() = ESPColor::BLACK;
return;
}
for (int i = it.size() - 1; i > 0; i--) {
it[i] = it[i - 1].get();
}
for (int i = it.size() - 1; i > 0; i--) {
it[i] = it[i - 1].get();
}
it[0] = current_color;
I See the ‘Wipe Out’ in the logs instantly after selecting it
Your Wipe Out effect will only set led Led colors if initial_run is true. Otherwise x is 0.
Try removing the if (initial_run) statement and change static int x = 0 to static x = it.size()
effects:
- addressable_lambda:
name: "Wipe Out"
update_interval: 1ms
lambda: |-
static x = it.size()
if (x > 0) {
x -= 1;
it[x] = ESPColor(0,0,0);
}
Then I get:
Compiling /data/esp32-et-al01-kantoor/.pioenvs/esp32-et-al01-kantoor/src/main.cpp.o
/config/esphome/esp32-et-al01-kantoor.yaml: In lambda function:
/config/esphome/esp32-et-al01-kantoor.yaml:68:14: error: 'x' does not name a type
static x = it.size()
^
*** [/data/esp32-et-al01-kantoor/.pioenvs/esp32-et-al01-kantoor/src/main.cpp.o] Error 1
========================== [FAILED] Took 3.15 seconds ==========================