mirror of
https://github.com/arendst/Tasmota.git
synced 2025-11-21 16:57:30 +00:00
160 lines
5.2 KiB
Plaintext
160 lines
5.2 KiB
Plaintext
# Generated Berry code from Animation DSL
|
|
# Source: plasma_wave.anim
|
|
#
|
|
# This file was automatically generated by compile_all_examples.sh
|
|
# Do not edit manually - changes will be overwritten
|
|
|
|
import animation
|
|
|
|
# Plasma Wave - Smooth flowing plasma colors
|
|
# Continuous color waves like plasma display
|
|
#strip length 60
|
|
# Define plasma color palette with smooth transitions
|
|
# Auto-generated strip initialization (using Tasmota configuration)
|
|
var engine = animation.init_strip()
|
|
|
|
var plasma_colors_ = bytes(
|
|
"00FF0080" # Magenta
|
|
"33FF8000" # Orange
|
|
"66FFFF00" # Yellow
|
|
"9980FF00" # Yellow-green
|
|
"CC00FF80" # Cyan-green
|
|
"FF0080FF" # Blue
|
|
)
|
|
# Base plasma animation with medium speed
|
|
var plasma_base_ = animation.rich_palette_animation(engine)
|
|
plasma_base_.palette = plasma_colors_
|
|
plasma_base_.cycle_period = 6000
|
|
plasma_base_.transition_type = animation.SINE
|
|
plasma_base_.brightness = 200
|
|
# Add multiple wave layers for complexity
|
|
var wave1_pattern_ = animation.rich_palette(engine)
|
|
wave1_pattern_.palette = plasma_colors_
|
|
wave1_pattern_.cycle_period = 4000
|
|
wave1_pattern_.transition_type = animation.SINE
|
|
wave1_pattern_.brightness = 255
|
|
var plasma_wave1_ = animation.beacon_animation(engine)
|
|
plasma_wave1_.color = wave1_pattern_ # color source
|
|
plasma_wave1_.pos = 0 # initial position
|
|
plasma_wave1_.beacon_size = 20 # wide wave
|
|
plasma_wave1_.slew_size = 10 # very smooth
|
|
plasma_wave1_.priority = 10
|
|
plasma_wave1_.pos = (def (engine)
|
|
var provider = animation.smooth(engine)
|
|
provider.min_value = 0
|
|
provider.max_value = 40
|
|
provider.duration = 8000
|
|
return provider
|
|
end)(engine)
|
|
var wave2_pattern_ = animation.rich_palette(engine)
|
|
wave2_pattern_.palette = plasma_colors_
|
|
wave2_pattern_.cycle_period = 5000
|
|
wave2_pattern_.transition_type = animation.SINE
|
|
wave2_pattern_.brightness = 180
|
|
var plasma_wave2_ = animation.beacon_animation(engine)
|
|
plasma_wave2_.color = wave2_pattern_ # color source
|
|
plasma_wave2_.pos = 45 # initial position
|
|
plasma_wave2_.beacon_size = 15 # medium wave
|
|
plasma_wave2_.slew_size = 8 # smooth
|
|
plasma_wave2_.priority = 8
|
|
plasma_wave2_.pos = (def (engine)
|
|
var provider = animation.smooth(engine)
|
|
provider.min_value = 45
|
|
provider.max_value = 15
|
|
provider.duration = 10000
|
|
return provider
|
|
end)(engine) # Opposite direction
|
|
var wave3_pattern_ = animation.rich_palette(engine)
|
|
wave3_pattern_.palette = plasma_colors_
|
|
wave3_pattern_.cycle_period = 3000
|
|
wave3_pattern_.transition_type = animation.SINE
|
|
wave3_pattern_.brightness = 220
|
|
var plasma_wave3_ = animation.beacon_animation(engine)
|
|
plasma_wave3_.color = wave3_pattern_ # color source
|
|
plasma_wave3_.pos = 20 # initial position
|
|
plasma_wave3_.beacon_size = 12 # smaller wave
|
|
plasma_wave3_.slew_size = 6 # smooth
|
|
plasma_wave3_.priority = 12
|
|
plasma_wave3_.pos = (def (engine)
|
|
var provider = animation.smooth(engine)
|
|
provider.min_value = 20
|
|
provider.max_value = 50
|
|
provider.duration = 6000
|
|
return provider
|
|
end)(engine) # Different speed
|
|
# Add subtle intensity variation
|
|
plasma_base_.opacity = (def (engine)
|
|
var provider = animation.smooth(engine)
|
|
provider.min_value = 150
|
|
provider.max_value = 255
|
|
provider.duration = 12000
|
|
return provider
|
|
end)(engine)
|
|
# Start all animations
|
|
engine.add(plasma_base_)
|
|
engine.add(plasma_wave1_)
|
|
engine.add(plasma_wave2_)
|
|
engine.add(plasma_wave3_)
|
|
engine.run()
|
|
|
|
|
|
#- Original DSL source:
|
|
# Plasma Wave - Smooth flowing plasma colors
|
|
# Continuous color waves like plasma display
|
|
|
|
#strip length 60
|
|
|
|
# Define plasma color palette with smooth transitions
|
|
palette plasma_colors = [
|
|
(0, 0xFF0080), # Magenta
|
|
(51, 0xFF8000), # Orange
|
|
(102, 0xFFFF00), # Yellow
|
|
(153, 0x80FF00), # Yellow-green
|
|
(204, 0x00FF80), # Cyan-green
|
|
(255, 0x0080FF) # Blue
|
|
]
|
|
|
|
# Base plasma animation with medium speed
|
|
animation plasma_base = rich_palette_animation(palette=plasma_colors, cycle_period=6s, transition_type=SINE, brightness=200)
|
|
|
|
# Add multiple wave layers for complexity
|
|
color wave1_pattern = rich_palette(palette=plasma_colors, cycle_period=4s, transition_type=SINE, brightness=255)
|
|
animation plasma_wave1 = beacon_animation(
|
|
color=wave1_pattern # color source
|
|
pos=0 # initial position
|
|
beacon_size=20 # wide wave
|
|
slew_size=10 # very smooth
|
|
)
|
|
plasma_wave1.priority = 10
|
|
plasma_wave1.pos = smooth(min_value=0, max_value=40, duration=8s)
|
|
|
|
color wave2_pattern = rich_palette(palette=plasma_colors, cycle_period=5s, transition_type=SINE, brightness=180)
|
|
animation plasma_wave2 = beacon_animation(
|
|
color=wave2_pattern # color source
|
|
pos=45 # initial position
|
|
beacon_size=15 # medium wave
|
|
slew_size=8 # smooth
|
|
)
|
|
plasma_wave2.priority = 8
|
|
plasma_wave2.pos = smooth(min_value=45, max_value=15, duration=10s) # Opposite direction
|
|
|
|
color wave3_pattern = rich_palette(palette=plasma_colors, cycle_period=3s, transition_type=SINE, brightness=220)
|
|
animation plasma_wave3 = beacon_animation(
|
|
color=wave3_pattern # color source
|
|
pos=20 # initial position
|
|
beacon_size=12 # smaller wave
|
|
slew_size=6 # smooth
|
|
)
|
|
plasma_wave3.priority = 12
|
|
plasma_wave3.pos = smooth(min_value=20, max_value=50, duration=6s) # Different speed
|
|
|
|
# Add subtle intensity variation
|
|
plasma_base.opacity = smooth(min_value=150, max_value=255, duration=12s)
|
|
|
|
# Start all animations
|
|
run plasma_base
|
|
run plasma_wave1
|
|
run plasma_wave2
|
|
run plasma_wave3
|
|
-#
|