Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Berry make Leds animate calls reentrant #22643

Merged
merged 1 commit into from
Dec 14, 2024

Conversation

s-hadinger
Copy link
Collaborator

Description:

Since the new TasmotaLED driver, it was not possible to apply multiple times the same animation code because resources were exclusive. Now automagic is done so that previous Led and animate are reused or stopped.

Ex, you can enter mulitple times the following code:

import animate

#var strip = Leds(5*5, gpio.pin(gpio.WS2812, 1), Leds.WS2812_GRB, Leds.SPI)
var strip = Leds(5*5, gpio.pin(gpio.WS2812, 1))
#var strip = Leds()
var anim = animate.core(strip)
anim.set_back_color(0x000022)
var pulse = animate.pulse(0xFF0000, 3, 2)
var osc1 = animate.oscillator(0, 5*5, 5000, animate.TRIANGLE)
osc1.set_cb(pulse, pulse.set_pos)

anim.start()

Checklist:

  • The pull request is done against the latest development branch
  • Only relevant files were touched
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • The code change is tested and works with Tasmota core ESP8266 V.2.7.8
  • The code change is tested and works with Tasmota core ESP32 V.3.1.0.241206
  • I accept the CLA.

NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass

@s-hadinger s-hadinger merged commit 67ae7c2 into arendst:development Dec 14, 2024
59 checks passed
@Noschvie
Copy link
Contributor

It would be a cool thing to recreate the WLED garage door animation with Tasmota and Berry :-)

@s-hadinger
Copy link
Collaborator Author

What is the garage door animation ?

@Noschvie
Copy link
Contributor

Watch the linked video :-)
garage lintel lighting with WLED

@s-hadinger
Copy link
Collaborator Author

It should be now doable with some Berry glue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants