Skip to content

Berry make Leds animate calls reentrant#22643

Merged
s-hadinger merged 1 commit into
arendst:developmentfrom
s-hadinger:berry_leds_reentrant
Dec 14, 2024
Merged

Berry make Leds animate calls reentrant#22643
s-hadinger merged 1 commit into
arendst:developmentfrom
s-hadinger:berry_leds_reentrant

Conversation

@s-hadinger
Copy link
Copy Markdown
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
@Noschvie
Copy link
Copy Markdown
Contributor

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

@s-hadinger
Copy link
Copy Markdown
Collaborator Author

What is the garage door animation ?

@Noschvie
Copy link
Copy Markdown
Contributor

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

@s-hadinger
Copy link
Copy Markdown
Collaborator Author

It should be now doable with some Berry glue

@s-hadinger s-hadinger deleted the berry_leds_reentrant branch January 6, 2025 14:21
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