From 7a0c639bd46129c7498d78231248f977eafe02af Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Fri, 26 Dec 2025 11:21:40 +0100 Subject: [PATCH] Berry animation rename cycle_period to period (#24260) --- lib/libesp32/berry_animation/README.md | 2 +- .../anim_examples/breathing_colors.anim | 2 +- .../anim_examples/christmas_tree.anim | 4 +- .../compiled/breathing_colors.be | 4 +- .../anim_examples/compiled/christmas_tree.be | 8 +-- .../anim_examples/compiled/cylon_rainbow.be | 4 +- .../compiled/demo_shutter_rainbow2.be | 8 +-- .../compiled/demo_shutter_rainbow_bidir.be | 8 +-- .../compiled/demo_shutter_rainbow_central.be | 8 +-- .../demo_shutter_rainbow_leftright.be | 8 +-- .../anim_examples/compiled/disco_strobe.be | 12 ++--- .../anim_examples/compiled/fire_flicker.be | 8 +-- .../anim_examples/compiled/lava_lamp.be | 20 ++++---- .../anim_examples/compiled/lightning_storm.be | 4 +- .../anim_examples/compiled/matrix_rain.be | 12 ++--- .../anim_examples/compiled/neon_glow.be | 8 +-- .../anim_examples/compiled/ocean_waves.be | 12 ++--- .../anim_examples/compiled/palette_demo.be | 8 +-- .../compiled/palette_showcase.be | 16 +++--- .../anim_examples/compiled/plasma_wave.be | 16 +++--- .../anim_examples/compiled/rainbow_cycle.be | 4 +- .../compiled/sequence_assignments_demo.be | 4 +- .../anim_examples/compiled/simple_palette.be | 4 +- .../anim_examples/compiled/sunrise_sunset.be | 4 +- .../anim_examples/compiled/swipe_rainbow.be | 4 +- .../compiled/test_complex_template.be | 4 +- .../compiled/test_shutter_rainbow_bidir.be | 8 +-- .../compiled/test_shutter_rainbow_central.be | 8 +-- .../compiled/test_template_animation.be | 8 +-- .../anim_examples/cylon_rainbow.anim | 2 +- .../anim_examples/demo_shutter_rainbow2.anim | 4 +- .../demo_shutter_rainbow_bidir.anim | 4 +- .../demo_shutter_rainbow_central.anim | 4 +- .../demo_shutter_rainbow_leftright.anim | 4 +- .../anim_examples/disco_strobe.anim | 6 +-- .../anim_examples/fire_flicker.anim | 4 +- .../anim_examples/lava_lamp.anim | 10 ++-- .../anim_examples/lightning_storm.anim | 2 +- .../anim_examples/matrix_rain.anim | 6 +-- .../anim_examples/neon_glow.anim | 4 +- .../anim_examples/ocean_waves.anim | 6 +-- .../anim_examples/palette_demo.anim | 4 +- .../anim_examples/palette_showcase.anim | 8 +-- .../anim_examples/plasma_wave.anim | 8 +-- .../anim_examples/rainbow_cycle.anim | 2 +- .../sequence_assignments_demo.anim | 2 +- .../anim_examples/simple_palette.anim | 2 +- .../anim_examples/sunrise_sunset.anim | 2 +- .../anim_examples/swipe_rainbow.anim | 2 +- .../anim_examples/test_complex_template.anim | 2 +- .../test_shutter_rainbow_bidir.anim | 4 +- .../test_shutter_rainbow_central.anim | 4 +- .../test_template_animation.anim | 4 +- .../chap_2_10_palette_rotation.anim | 2 +- .../chap_2_20_palette_rotation.anim | 2 +- .../chap_3_10_color_transition.anim | 2 +- .../chap_3_20_color_transition_palette.anim | 2 +- .../chap_4_10_color_pattern.anim | 4 +- .../chap_4_12_color_pattern_spatial_2.anim | 4 +- .../chap_4_15_color_pattern_spatial_osc.anim | 4 +- ...hap_4_18_color_pattern_spatial_rotate.anim | 4 +- .../chap_4_30_color_pattern_meter.anim | 2 +- .../chap_4_35_color_pattern_meter_random.anim | 2 +- .../chap_5_40_cylon_rainbow.anim | 2 +- .../chap_6_20_shutter_rotating_colors.anim | 4 +- ..._6_30_shutter_central_rotating_colors.anim | 4 +- .../chap_6_40_shutter_central_inoutin.anim | 4 +- .../chap_7_40_crenel_colors.anim | 2 +- .../chap_7_50_crenel_opacity.anim | 2 +- .../chap_8_10_template_cylon_simple.anim | 2 +- .../chap_8_20_template_color_cycle.anim | 8 +-- ...hap_8_30_template_shutter_bidir_flags.anim | 4 +- .../ANIMATION_CLASS_HIERARCHY.md | 42 ++++++++-------- .../ANIMATION_DEVELOPMENT.md | 2 +- .../berry_animation_docs/DSL_REFERENCE.md | 14 +++--- .../berry_animation_docs/DSL_TRANSPILATION.md | 6 +-- .../berry_animation_docs/EXAMPLES.md | 12 ++--- .../berry_animation_docs/QUICK_START.md | 14 +++--- .../TRANSPILER_ARCHITECTURE.md | 2 +- .../berry_animation_docs/USER_FUNCTIONS.md | 14 +++--- .../berry_animation/src/animations/fire.be | 2 +- .../berry_animation/src/animations/noise.be | 8 +-- .../src/animations/rich_palette_animation.be | 4 +- .../berry_animation/src/animations/wave.be | 2 +- .../src/animations_future/plasma.be | 4 +- .../src/animations_future/sparkle.be | 2 +- .../providers/color_cycle_color_provider.be | 16 +++--- .../providers/rich_palette_color_provider.be | 24 ++++----- .../src/solidify/solidified_animation.h | 32 ++++++------ .../src/tests/color_cycle_animation_test.be | 14 +++--- .../src/tests/color_cycle_bytes_test.be | 4 +- .../src/tests/crenel_position_color_test.be | 2 +- .../tests/demo_shutter_infinite_loop_test.be | 10 ++-- .../src/tests/dsl_newline_syntax_test.be | 8 +-- .../src/tests/dsl_restart_test.be | 2 +- .../src/tests/dsl_template_animation_test.be | 14 +++--- .../src/tests/dsl_transpiler_test.be | 2 +- .../dsl_value_provider_validation_test.be | 2 +- .../src/tests/filled_animation_test.be | 6 +-- .../src/tests/fire_animation_test.be | 2 +- .../tests/gradient_lut_integration_test.be | 2 +- .../src/tests/palette_dsl_test.be | 2 +- .../rich_palette_animation_class_test.be | 28 +++++------ .../src/tests/rich_palette_animation_test.be | 34 ++++++------- .../src/tests/rich_palette_breathing_demo.be | 2 +- .../rich_palette_dynamic_brightness_test.be | 4 +- .../src/tests/rich_palette_lut_test.be | 4 +- .../tests/sequence_manager_layering_test.be | 2 +- .../src/tests/sequence_manager_test.be | 4 +- .../tests/value_provider_integration_test.be | 2 +- .../tasmota.animation-dsl-1.2.1/CHANGELOG.md | 2 +- .../tasmota.animation-dsl-1.2.1/README.md | 50 ------------------- .../syntaxes/animation-dsl.tmLanguage.json | 2 +- 113 files changed, 367 insertions(+), 417 deletions(-) diff --git a/lib/libesp32/berry_animation/README.md b/lib/libesp32/berry_animation/README.md index 6f9385f53..a4bc9abe5 100644 --- a/lib/libesp32/berry_animation/README.md +++ b/lib/libesp32/berry_animation/README.md @@ -56,7 +56,7 @@ run pulse ### Rainbow Smooth Color Cycling ```berry -animation rainbow = rich_palette_animation(palette=PALETTE_RAINBOW) +animation rainbow = rich_palette_animation(colors=PALETTE_RAINBOW) run rainbow ``` diff --git a/lib/libesp32/berry_animation/anim_examples/breathing_colors.anim b/lib/libesp32/berry_animation/anim_examples/breathing_colors.anim index 393824200..7ad381e56 100644 --- a/lib/libesp32/berry_animation/anim_examples/breathing_colors.anim +++ b/lib/libesp32/berry_animation/anim_examples/breathing_colors.anim @@ -23,7 +23,7 @@ palette breathe_palette = [ # Create a rich palette color provider color palette_pattern = rich_palette( colors=breathe_palette # palette - cycle_period=15s # cycle period (defaults: smooth transition, 255 brightness) + period=15s # cycle period (defaults: smooth transition, 255 brightness) ) # Create breathing animation using the palette diff --git a/lib/libesp32/berry_animation/anim_examples/christmas_tree.anim b/lib/libesp32/berry_animation/anim_examples/christmas_tree.anim index 53a81eac6..7a4fe5f25 100644 --- a/lib/libesp32/berry_animation/anim_examples/christmas_tree.anim +++ b/lib/libesp32/berry_animation/anim_examples/christmas_tree.anim @@ -17,7 +17,7 @@ palette ornament_colors = [ ] # Colorful ornaments as twinkling lights -color ornament_pattern = rich_palette(colors=ornament_colors, cycle_period=3s, transition_type=LINEAR, brightness=255) +color ornament_pattern = rich_palette(colors=ornament_colors, period=3s, transition_type=LINEAR, brightness=255) animation ornaments = twinkle_animation( color=ornament_pattern # color source density=15 # density (many ornaments) @@ -44,7 +44,7 @@ animation snow_sparkles = twinkle_animation( snow_sparkles.priority = 15 # Garland effect - moving colored lights -color garland_pattern = rich_palette(colors=ornament_colors, cycle_period=2s, transition_type=LINEAR, brightness=200) +color garland_pattern = rich_palette(colors=ornament_colors, period=2s, transition_type=LINEAR, brightness=200) animation garland = comet_animation( color=garland_pattern # color source tail_length=6 # garland length (tail length) diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/breathing_colors.be b/lib/libesp32/berry_animation/anim_examples/compiled/breathing_colors.be index 3373a1deb..fb46cb89f 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/breathing_colors.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/breathing_colors.be @@ -30,7 +30,7 @@ var breathe_palette_ = bytes( # Create a rich palette color provider var palette_pattern_ = animation.rich_palette(engine) palette_pattern_.colors = breathe_palette_ # palette -palette_pattern_.cycle_period = 15000 # cycle period (defaults: smooth transition, 255 brightness) +palette_pattern_.period = 15000 # cycle period (defaults: smooth transition, 255 brightness) # Create breathing animation using the palette var breathing_ = animation.breathe_animation(engine) breathing_.color = palette_pattern_ # base animation @@ -76,7 +76,7 @@ palette breathe_palette = [ # Create a rich palette color provider color palette_pattern = rich_palette( colors=breathe_palette # palette - cycle_period=15s # cycle period (defaults: smooth transition, 255 brightness) + period=15s # cycle period (defaults: smooth transition, 255 brightness) ) # Create breathing animation using the palette diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/christmas_tree.be b/lib/libesp32/berry_animation/anim_examples/compiled/christmas_tree.be index 307d8bbdc..da2dc6c5d 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/christmas_tree.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/christmas_tree.be @@ -27,7 +27,7 @@ var ornament_colors_ = bytes( # Colorful ornaments as twinkling lights var ornament_pattern_ = animation.rich_palette(engine) ornament_pattern_.colors = ornament_colors_ -ornament_pattern_.cycle_period = 3000 +ornament_pattern_.period = 3000 ornament_pattern_.transition_type = animation.LINEAR ornament_pattern_.brightness = 255 var ornaments_ = animation.twinkle_animation(engine) @@ -58,7 +58,7 @@ snow_sparkles_.priority = 15 # Garland effect - moving colored lights var garland_pattern_ = animation.rich_palette(engine) garland_pattern_.colors = ornament_colors_ -garland_pattern_.cycle_period = 2000 +garland_pattern_.period = 2000 garland_pattern_.transition_type = animation.LINEAR garland_pattern_.brightness = 200 var garland_ = animation.comet_animation(engine) @@ -95,7 +95,7 @@ palette ornament_colors = [ ] # Colorful ornaments as twinkling lights -color ornament_pattern = rich_palette(colors=ornament_colors, cycle_period=3s, transition_type=LINEAR, brightness=255) +color ornament_pattern = rich_palette(colors=ornament_colors, period=3s, transition_type=LINEAR, brightness=255) animation ornaments = twinkle_animation( color=ornament_pattern # color source density=15 # density (many ornaments) @@ -122,7 +122,7 @@ animation snow_sparkles = twinkle_animation( snow_sparkles.priority = 15 # Garland effect - moving colored lights -color garland_pattern = rich_palette(colors=ornament_colors, cycle_period=2s, transition_type=LINEAR, brightness=200) +color garland_pattern = rich_palette(colors=ornament_colors, period=2s, transition_type=LINEAR, brightness=200) animation garland = comet_animation( color=garland_pattern # color source tail_length=6 # garland length (tail length) diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/cylon_rainbow.be b/lib/libesp32/berry_animation/anim_examples/compiled/cylon_rainbow.be index 07fec5f03..bd6b66c5e 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/cylon_rainbow.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/cylon_rainbow.be @@ -16,7 +16,7 @@ var eye_duration_ = 5000 # duration for a cylon eye cycle var eye_palette_ = bytes("FFFF0000" "FFFFFF00" "FF008000" "FFEE82EE") var eye_color_ = animation.color_cycle(engine) eye_color_.colors = eye_palette_ -eye_color_.cycle_period = 0 +eye_color_.period = 0 var cosine_val_ = (def (engine) var provider = animation.cosine_osc(engine) provider.min_value = 0 @@ -58,7 +58,7 @@ set eye_duration = 5s # duration for a cylon eye cycle palette eye_palette = [ red, yellow, green, violet ] -color eye_color = color_cycle(colors=eye_palette, cycle_period=0) +color eye_color = color_cycle(colors=eye_palette, period=0) set cosine_val = cosine_osc(min_value = 0, max_value = strip_len - 2, duration = eye_duration) set triangle_val = triangle(min_value = 0, max_value = strip_len - 2, duration = eye_duration) diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow2.be b/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow2.be index 1e6d0105a..1a8523dc2 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow2.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow2.be @@ -23,10 +23,10 @@ var shutter_size_ = (def (engine) end)(engine) var col1_ = animation.color_cycle(engine) col1_.colors = animation.PALETTE_RAINBOW -col1_.cycle_period = 0 +col1_.period = 0 var col2_ = animation.color_cycle(engine) col2_.colors = animation.PALETTE_RAINBOW -col2_.cycle_period = 0 +col2_.period = 0 col2_.next = 1 var shutter_animation_ = animation.beacon_animation(engine) shutter_animation_.color = col1_ @@ -57,8 +57,8 @@ set duration = 3s set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = duration) - color col1 = color_cycle(colors=PALETTE_RAINBOW, cycle_period=0) - color col2 = color_cycle(colors=PALETTE_RAINBOW, cycle_period=0) + color col1 = color_cycle(colors=PALETTE_RAINBOW, period=0) + color col2 = color_cycle(colors=PALETTE_RAINBOW, period=0) col2.next = 1 animation shutter_animation = beacon_animation( diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_bidir.be b/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_bidir.be index 044378f8d..467926104 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_bidir.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_bidir.be @@ -30,10 +30,10 @@ class shutter_bidir_animation : animation.engine_proxy end)(engine) var col1_ = animation.color_cycle(engine) col1_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col1_.cycle_period = 0 + col1_.period = 0 var col2_ = animation.color_cycle(engine) col2_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col2_.cycle_period = 0 + col2_.period = 0 col2_.next = 1 # shutter moving from left to right var shutter_lr_animation_ = animation.beacon_animation(engine) @@ -100,8 +100,8 @@ template animation shutter_bidir { set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving from left to right diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_central.be b/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_central.be index 387a4d90a..eb2ff75e6 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_central.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_central.be @@ -31,10 +31,10 @@ class shutter_central_animation : animation.engine_proxy end)(engine) var col1_ = animation.color_cycle(engine) col1_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col1_.cycle_period = 0 + col1_.period = 0 var col2_ = animation.color_cycle(engine) col2_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col2_.cycle_period = 0 + col2_.period = 0 col2_.next = 1 # shutter moving in to out var shutter_inout_animation_ = animation.beacon_animation(engine) @@ -101,8 +101,8 @@ template animation shutter_central { set strip_len2 = (strip_len + 1) / 2 set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving in to out diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_leftright.be b/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_leftright.be index f0b74f27e..c7554697c 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_leftright.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/demo_shutter_rainbow_leftright.be @@ -30,10 +30,10 @@ class shutter_lr_animation : animation.engine_proxy end)(engine) var col1_ = animation.color_cycle(engine) col1_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col1_.cycle_period = 0 + col1_.period = 0 var col2_ = animation.color_cycle(engine) col2_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col2_.cycle_period = 0 + col2_.period = 0 col2_.next = 1 # shutter moving from left to right var shutter_lr_animation_ = animation.beacon_animation(engine) @@ -83,8 +83,8 @@ template animation shutter_lr { set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving from left to right diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/disco_strobe.be b/lib/libesp32/berry_animation/anim_examples/compiled/disco_strobe.be index a5a84e4d0..54a8fd8a8 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/disco_strobe.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/disco_strobe.be @@ -25,7 +25,7 @@ var disco_colors_ = bytes( # Fast color cycling base var disco_rich_color_ = animation.rich_palette(engine) disco_rich_color_.colors = disco_colors_ -disco_rich_color_.cycle_period = 1000 +disco_rich_color_.period = 1000 disco_rich_color_.transition_type = animation.LINEAR disco_rich_color_.brightness = 255 var disco_base_ = animation.solid(engine) @@ -54,7 +54,7 @@ white_flash_.priority = 20 # Add colored sparkles var sparkle_pattern_ = animation.rich_palette(engine) sparkle_pattern_.colors = disco_colors_ -sparkle_pattern_.cycle_period = 500 +sparkle_pattern_.period = 500 sparkle_pattern_.transition_type = animation.LINEAR sparkle_pattern_.brightness = 255 var disco_sparkles_ = animation.twinkle_animation(engine) @@ -65,7 +65,7 @@ disco_sparkles_.priority = 15 # Add moving pulse for extra effect var pulse_pattern_ = animation.rich_palette(engine) pulse_pattern_.colors = disco_colors_ -pulse_pattern_.cycle_period = 800 +pulse_pattern_.period = 800 pulse_pattern_.transition_type = animation.LINEAR pulse_pattern_.brightness = 255 var disco_pulse_ = animation.beacon_animation(engine) @@ -107,7 +107,7 @@ palette disco_colors = [ ] # Fast color cycling base -color disco_rich_color = rich_palette(colors=disco_colors, cycle_period=1s, transition_type=LINEAR, brightness=255) +color disco_rich_color = rich_palette(colors=disco_colors, period=1s, transition_type=LINEAR, brightness=255) animation disco_base = solid(color=disco_rich_color) # Add strobe effect @@ -119,7 +119,7 @@ white_flash.opacity = square(min_value=0, max_value=255, duration=50ms, duty_cyc white_flash.priority = 20 # Add colored sparkles -color sparkle_pattern = rich_palette(colors=disco_colors, cycle_period=500ms, transition_type=LINEAR, brightness=255) +color sparkle_pattern = rich_palette(colors=disco_colors, period=500ms, transition_type=LINEAR, brightness=255) animation disco_sparkles = twinkle_animation( color=sparkle_pattern # color source density=12 # density (many sparkles) @@ -128,7 +128,7 @@ animation disco_sparkles = twinkle_animation( disco_sparkles.priority = 15 # Add moving pulse for extra effect -color pulse_pattern = rich_palette(colors=disco_colors, cycle_period=800ms, transition_type=LINEAR, brightness=255) +color pulse_pattern = rich_palette(colors=disco_colors, period=800ms, transition_type=LINEAR, brightness=255) animation disco_pulse = beacon_animation( color=pulse_pattern # color source pos=4 # initial position diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/fire_flicker.be b/lib/libesp32/berry_animation/anim_examples/compiled/fire_flicker.be index 5360c79d9..3555f863c 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/fire_flicker.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/fire_flicker.be @@ -23,7 +23,7 @@ var fire_colors_ = bytes( # Create base fire animation with palette var fire_base_color_ = animation.rich_palette(engine) fire_base_color_.colors = fire_colors_ -fire_base_color_.cycle_period = 3000 +fire_base_color_.period = 3000 fire_base_color_.transition_type = animation.LINEAR fire_base_color_.brightness = 255 var fire_base_ = animation.solid(engine) @@ -39,7 +39,7 @@ end)(engine) # Add subtle position variation for more realism var flicker_pattern_ = animation.rich_palette(engine) flicker_pattern_.colors = fire_colors_ -flicker_pattern_.cycle_period = 2000 +flicker_pattern_.period = 2000 flicker_pattern_.transition_type = animation.LINEAR flicker_pattern_.brightness = 255 var fire_flicker_ = animation.twinkle_animation(engine) @@ -69,14 +69,14 @@ palette fire_colors = [ ] # Create base fire animation with palette -color fire_base_color = rich_palette(colors=fire_colors, cycle_period=3s, transition_type=LINEAR, brightness=255) +color fire_base_color = rich_palette(colors=fire_colors, period=3s, transition_type=LINEAR, brightness=255) animation fire_base = solid(color=fire_base_color) # Add flickering effect with random intensity changes fire_base.opacity = smooth(min_value=180, max_value=255, duration=800ms) # Add subtle position variation for more realism -color flicker_pattern = rich_palette(colors=fire_colors, cycle_period=2s, transition_type=LINEAR, brightness=255) +color flicker_pattern = rich_palette(colors=fire_colors, period=2s, transition_type=LINEAR, brightness=255) animation fire_flicker = twinkle_animation( color=flicker_pattern # color source density=12 # density (number of flickers) diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/lava_lamp.be b/lib/libesp32/berry_animation/anim_examples/compiled/lava_lamp.be index 4e5005930..bb1c5a41a 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/lava_lamp.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/lava_lamp.be @@ -23,13 +23,13 @@ var lava_colors_ = bytes( # Base lava animation - very slow color changes var lava_base_ = animation.rich_palette_animation(engine) lava_base_.colors = lava_colors_ -lava_base_.cycle_period = 15000 +lava_base_.period = 15000 lava_base_.transition_type = animation.SINE lava_base_.brightness = 180 # Add slow-moving lava blobs var blob1_pattern_ = animation.rich_palette(engine) blob1_pattern_.colors = lava_colors_ -blob1_pattern_.cycle_period = 12000 +blob1_pattern_.period = 12000 blob1_pattern_.transition_type = animation.SINE blob1_pattern_.brightness = 255 var lava_blob1_ = animation.beacon_animation(engine) @@ -47,7 +47,7 @@ lava_blob1_.pos = (def (engine) end)(engine) # Very slow movement var blob2_pattern_ = animation.rich_palette(engine) blob2_pattern_.colors = lava_colors_ -blob2_pattern_.cycle_period = 10000 +blob2_pattern_.period = 10000 blob2_pattern_.transition_type = animation.SINE blob2_pattern_.brightness = 220 var lava_blob2_ = animation.beacon_animation(engine) @@ -65,7 +65,7 @@ lava_blob2_.pos = (def (engine) end)(engine) # Opposite direction, slower var blob3_pattern_ = animation.rich_palette(engine) blob3_pattern_.colors = lava_colors_ -blob3_pattern_.cycle_period = 8000 +blob3_pattern_.period = 8000 blob3_pattern_.transition_type = animation.SINE blob3_pattern_.brightness = 200 var lava_blob3_ = animation.beacon_animation(engine) @@ -84,7 +84,7 @@ end)(engine) # Small movement range # Add subtle heat shimmer effect var shimmer_pattern_ = animation.rich_palette(engine) shimmer_pattern_.colors = lava_colors_ -shimmer_pattern_.cycle_period = 6000 +shimmer_pattern_.period = 6000 shimmer_pattern_.transition_type = animation.SINE shimmer_pattern_.brightness = 255 var heat_shimmer_ = animation.twinkle_animation(engine) @@ -117,10 +117,10 @@ palette lava_colors = [ ] # Base lava animation - very slow color changes -animation lava_base = rich_palette_animation(colors=lava_colors, cycle_period=15s, transition_type=SINE, brightness=180) +animation lava_base = rich_palette_animation(colors=lava_colors, period=15s, transition_type=SINE, brightness=180) # Add slow-moving lava blobs -color blob1_pattern = rich_palette(colors=lava_colors, cycle_period=12s, transition_type=SINE, brightness=255) +color blob1_pattern = rich_palette(colors=lava_colors, period=12s, transition_type=SINE, brightness=255) animation lava_blob1 = beacon_animation( color=blob1_pattern # color source pos=9 # initial position @@ -130,7 +130,7 @@ animation lava_blob1 = beacon_animation( lava_blob1.priority = 10 lava_blob1.pos = smooth(min_value=9, max_value=51, duration=20s) # Very slow movement -color blob2_pattern = rich_palette(colors=lava_colors, cycle_period=10s, transition_type=SINE, brightness=220) +color blob2_pattern = rich_palette(colors=lava_colors, period=10s, transition_type=SINE, brightness=220) animation lava_blob2 = beacon_animation( color=blob2_pattern # color source pos=46 # initial position @@ -140,7 +140,7 @@ animation lava_blob2 = beacon_animation( lava_blob2.priority = 8 lava_blob2.pos = smooth(min_value=46, max_value=14, duration=25s) # Opposite direction, slower -color blob3_pattern = rich_palette(colors=lava_colors, cycle_period=8s, transition_type=SINE, brightness=200) +color blob3_pattern = rich_palette(colors=lava_colors, period=8s, transition_type=SINE, brightness=200) animation lava_blob3 = beacon_animation( color=blob3_pattern # color source pos=25 # initial position @@ -151,7 +151,7 @@ lava_blob3.priority = 6 lava_blob3.pos = smooth(min_value=25, max_value=35, duration=18s) # Small movement range # Add subtle heat shimmer effect -color shimmer_pattern = rich_palette(colors=lava_colors, cycle_period=6s, transition_type=SINE, brightness=255) +color shimmer_pattern = rich_palette(colors=lava_colors, period=6s, transition_type=SINE, brightness=255) animation heat_shimmer = twinkle_animation( color=shimmer_pattern # color source density=6 # density (shimmer points) diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/lightning_storm.be b/lib/libesp32/berry_animation/anim_examples/compiled/lightning_storm.be index e88cdf49e..4d0ca29da 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/lightning_storm.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/lightning_storm.be @@ -20,7 +20,7 @@ var storm_colors_ = bytes( ) var storm_bg_ = animation.rich_palette_animation(engine) storm_bg_.colors = storm_colors_ -storm_bg_.cycle_period = 12000 +storm_bg_.period = 12000 storm_bg_.transition_type = animation.SINE storm_bg_.brightness = 100 # Random lightning flashes - full strip @@ -92,7 +92,7 @@ palette storm_colors = [ (255, 0x220033) # Slightly lighter purple ] -animation storm_bg = rich_palette_animation(colors=storm_colors, cycle_period=12s, transition_type=SINE, brightness=100) +animation storm_bg = rich_palette_animation(colors=storm_colors, period=12s, transition_type=SINE, brightness=100) # Random lightning flashes - full strip animation lightning_main = solid(color=0xFFFFFF) # Bright white diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/matrix_rain.be b/lib/libesp32/berry_animation/anim_examples/compiled/matrix_rain.be index 02b712484..c85caf813 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/matrix_rain.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/matrix_rain.be @@ -28,7 +28,7 @@ var matrix_greens_ = bytes( # Create multiple cascading streams var stream1_pattern_ = animation.rich_palette(engine) stream1_pattern_.colors = matrix_greens_ -stream1_pattern_.cycle_period = 2000 +stream1_pattern_.period = 2000 stream1_pattern_.transition_type = animation.LINEAR stream1_pattern_.brightness = 255 var stream1_ = animation.comet_animation(engine) @@ -38,7 +38,7 @@ stream1_.speed = 1500 # speed stream1_.priority = 10 var stream2_pattern_ = animation.rich_palette(engine) stream2_pattern_.colors = matrix_greens_ -stream2_pattern_.cycle_period = 1800 +stream2_pattern_.period = 1800 stream2_pattern_.transition_type = animation.LINEAR stream2_pattern_.brightness = 200 var stream2_ = animation.comet_animation(engine) @@ -48,7 +48,7 @@ stream2_.speed = 2200 # different speed stream2_.priority = 8 var stream3_pattern_ = animation.rich_palette(engine) stream3_pattern_.colors = matrix_greens_ -stream3_pattern_.cycle_period = 2500 +stream3_pattern_.period = 2500 stream3_pattern_.transition_type = animation.LINEAR stream3_pattern_.brightness = 180 var stream3_ = animation.comet_animation(engine) @@ -91,7 +91,7 @@ palette matrix_greens = [ ] # Create multiple cascading streams -color stream1_pattern = rich_palette(colors=matrix_greens, cycle_period=2s, transition_type=LINEAR, brightness=255) +color stream1_pattern = rich_palette(colors=matrix_greens, period=2s, transition_type=LINEAR, brightness=255) animation stream1 = comet_animation( color=stream1_pattern # color source tail_length=15 # long tail @@ -100,7 +100,7 @@ animation stream1 = comet_animation( ) -color stream2_pattern = rich_palette(colors=matrix_greens, cycle_period=1.8s, transition_type=LINEAR, brightness=200) +color stream2_pattern = rich_palette(colors=matrix_greens, period=1.8s, transition_type=LINEAR, brightness=200) animation stream2 = comet_animation( color=stream2_pattern # color source tail_length=12 # medium tail @@ -108,7 +108,7 @@ animation stream2 = comet_animation( priority = 8 ) -color stream3_pattern = rich_palette(colors=matrix_greens, cycle_period=2.5s, transition_type=LINEAR, brightness=180) +color stream3_pattern = rich_palette(colors=matrix_greens, period=2.5s, transition_type=LINEAR, brightness=180) animation stream3 = comet_animation( color=stream3_pattern # color source tail_length=10 # shorter tail diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/neon_glow.be b/lib/libesp32/berry_animation/anim_examples/compiled/neon_glow.be index 27cdd1ac1..14c661d14 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/neon_glow.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/neon_glow.be @@ -22,7 +22,7 @@ var neon_colors_ = bytes( # Main neon glow with color cycling var neon_main_ = animation.rich_palette_animation(engine) neon_main_.colors = neon_colors_ -neon_main_.cycle_period = 4000 +neon_main_.period = 4000 neon_main_.transition_type = animation.LINEAR neon_main_.brightness = 255 # Add electrical flickering @@ -49,7 +49,7 @@ neon_surge_.priority = 20 # Add neon tube segments with gaps var segment_pattern_ = animation.rich_palette(engine) segment_pattern_.colors = neon_colors_ -segment_pattern_.cycle_period = 4000 +segment_pattern_.period = 4000 segment_pattern_.transition_type = animation.LINEAR segment_pattern_.brightness = 255 var segment1_ = animation.beacon_animation(engine) @@ -101,7 +101,7 @@ palette neon_colors = [ ] # Main neon glow with color cycling -animation neon_main = rich_palette_animation(colors=neon_colors, cycle_period=4s, transition_type=LINEAR, brightness=255) +animation neon_main = rich_palette_animation(colors=neon_colors, period=4s, transition_type=LINEAR, brightness=255) # Add electrical flickering neon_main.opacity = smooth(min_value=220, max_value=255, duration=200ms) @@ -112,7 +112,7 @@ neon_surge.opacity = square(min_value=0, max_value=255, duration=50ms, duty_cycl neon_surge.priority = 20 # Add neon tube segments with gaps -color segment_pattern = rich_palette(colors=neon_colors, cycle_period=4s, transition_type=LINEAR, brightness=255) +color segment_pattern = rich_palette(colors=neon_colors, period=4s, transition_type=LINEAR, brightness=255) animation segment1 = beacon_animation( color=segment_pattern # color source pos=6 # position diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/ocean_waves.be b/lib/libesp32/berry_animation/anim_examples/compiled/ocean_waves.be index 206426e5d..7251309d3 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/ocean_waves.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/ocean_waves.be @@ -23,13 +23,13 @@ var ocean_colors_ = bytes( # Base ocean animation with slow color cycling var ocean_base_ = animation.rich_palette_animation(engine) ocean_base_.colors = ocean_colors_ -ocean_base_.cycle_period = 8000 +ocean_base_.period = 8000 ocean_base_.transition_type = animation.SINE ocean_base_.brightness = 200 # Add wave motion with moving pulses var wave1_pattern_ = animation.rich_palette(engine) wave1_pattern_.colors = ocean_colors_ -wave1_pattern_.cycle_period = 6000 +wave1_pattern_.period = 6000 wave1_pattern_.transition_type = animation.SINE wave1_pattern_.brightness = 255 var wave1_ = animation.beacon_animation(engine) @@ -47,7 +47,7 @@ wave1_.pos = (def (engine) end)(engine) # 60-12 = 48 var wave2_pattern_ = animation.rich_palette(engine) wave2_pattern_.colors = ocean_colors_ -wave2_pattern_.cycle_period = 4000 +wave2_pattern_.period = 4000 wave2_pattern_.transition_type = animation.SINE wave2_pattern_.brightness = 180 var wave2_ = animation.beacon_animation(engine) @@ -93,10 +93,10 @@ palette ocean_colors = [ ] # Base ocean animation with slow color cycling -animation ocean_base = rich_palette_animation(colors=ocean_colors, cycle_period=8s, transition_type=SINE, brightness=200) +animation ocean_base = rich_palette_animation(colors=ocean_colors, period=8s, transition_type=SINE, brightness=200) # Add wave motion with moving pulses -color wave1_pattern = rich_palette(colors=ocean_colors, cycle_period=6s, transition_type=SINE, brightness=255) +color wave1_pattern = rich_palette(colors=ocean_colors, period=6s, transition_type=SINE, brightness=255) animation wave1 = beacon_animation( color=wave1_pattern # color source pos=0 # initial position @@ -106,7 +106,7 @@ animation wave1 = beacon_animation( wave1.priority = 10 wave1.pos = sawtooth(min_value=0, max_value=48, duration=5s) # 60-12 = 48 -color wave2_pattern = rich_palette(colors=ocean_colors, cycle_period=4s, transition_type=SINE, brightness=180) +color wave2_pattern = rich_palette(colors=ocean_colors, period=4s, transition_type=SINE, brightness=180) animation wave2 = beacon_animation( color=wave2_pattern # color source pos=52 # initial position diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/palette_demo.be b/lib/libesp32/berry_animation/anim_examples/compiled/palette_demo.be index e91c8f0d3..3e604a47c 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/palette_demo.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/palette_demo.be @@ -25,10 +25,10 @@ var ocean_colors_ = bytes( # Create animations using the palettes var fire_anim_ = animation.rich_palette_animation(engine) fire_anim_.colors = fire_colors_ -fire_anim_.cycle_period = 5000 +fire_anim_.period = 5000 var ocean_anim_ = animation.rich_palette_animation(engine) ocean_anim_.colors = ocean_colors_ -ocean_anim_.cycle_period = 8000 +ocean_anim_.period = 8000 # Sequence to show both palettes var palette_demo_ = animation.sequence_manager(engine) .push_play_step(fire_anim_, 10000) @@ -62,9 +62,9 @@ palette ocean_colors = [ ] # Create animations using the palettes -animation fire_anim = rich_palette_animation(colors=fire_colors, cycle_period=5s) +animation fire_anim = rich_palette_animation(colors=fire_colors, period=5s) -animation ocean_anim = rich_palette_animation(colors=ocean_colors, cycle_period=8s) +animation ocean_anim = rich_palette_animation(colors=ocean_colors, period=8s) # Sequence to show both palettes sequence palette_demo { diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/palette_showcase.be b/lib/libesp32/berry_animation/anim_examples/compiled/palette_showcase.be index 4dace9ce6..8adfc27b0 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/palette_showcase.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/palette_showcase.be @@ -53,22 +53,22 @@ var fire_effect_ = animation.solid(engine) fire_effect_.color = (def (engine) var provider = animation.rich_palette(engine) provider.colors = fire_gradient_ - provider.cycle_period = 3000 + provider.period = 3000 return provider end)(engine) var ocean_waves_ = animation.rich_palette_animation(engine) ocean_waves_.colors = ocean_depths_ -ocean_waves_.cycle_period = 8000 +ocean_waves_.period = 8000 ocean_waves_.transition_type = animation.SINE ocean_waves_.brightness = 200 var aurora_lights_ = animation.rich_palette_animation(engine) aurora_lights_.colors = aurora_borealis_ -aurora_lights_.cycle_period = 12000 +aurora_lights_.period = 12000 aurora_lights_.transition_type = animation.SINE aurora_lights_.brightness = 180 var sunset_glow_ = animation.rich_palette_animation(engine) sunset_glow_.colors = sunset_sky_ -sunset_glow_.cycle_period = 6000 +sunset_glow_.period = 6000 sunset_glow_.transition_type = animation.SINE sunset_glow_.brightness = 220 # Sequence to showcase all palettes @@ -143,13 +143,13 @@ palette sunset_sky = [ ] # Create animations using each palette -animation fire_effect = solid(color=rich_palette(colors=fire_gradient, cycle_period=3s)) +animation fire_effect = solid(color=rich_palette(colors=fire_gradient, period=3s)) -animation ocean_waves = rich_palette_animation(colors=ocean_depths, cycle_period=8s, transition_type=SINE, brightness=200) +animation ocean_waves = rich_palette_animation(colors=ocean_depths, period=8s, transition_type=SINE, brightness=200) -animation aurora_lights = rich_palette_animation(colors=aurora_borealis, cycle_period=12s, transition_type=SINE, brightness=180) +animation aurora_lights = rich_palette_animation(colors=aurora_borealis, period=12s, transition_type=SINE, brightness=180) -animation sunset_glow = rich_palette_animation(colors=sunset_sky, cycle_period=6s, transition_type=SINE, brightness=220) +animation sunset_glow = rich_palette_animation(colors=sunset_sky, period=6s, transition_type=SINE, brightness=220) # Sequence to showcase all palettes sequence palette_showcase { diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/plasma_wave.be b/lib/libesp32/berry_animation/anim_examples/compiled/plasma_wave.be index 19372d7f8..2f77525f9 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/plasma_wave.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/plasma_wave.be @@ -24,13 +24,13 @@ var plasma_colors_ = bytes( # Base plasma animation with medium speed var plasma_base_ = animation.rich_palette_animation(engine) plasma_base_.colors = plasma_colors_ -plasma_base_.cycle_period = 6000 +plasma_base_.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_.colors = plasma_colors_ -wave1_pattern_.cycle_period = 4000 +wave1_pattern_.period = 4000 wave1_pattern_.transition_type = animation.SINE wave1_pattern_.brightness = 255 var plasma_wave1_ = animation.beacon_animation(engine) @@ -48,7 +48,7 @@ plasma_wave1_.pos = (def (engine) end)(engine) var wave2_pattern_ = animation.rich_palette(engine) wave2_pattern_.colors = plasma_colors_ -wave2_pattern_.cycle_period = 5000 +wave2_pattern_.period = 5000 wave2_pattern_.transition_type = animation.SINE wave2_pattern_.brightness = 180 var plasma_wave2_ = animation.beacon_animation(engine) @@ -66,7 +66,7 @@ plasma_wave2_.pos = (def (engine) end)(engine) # Opposite direction var wave3_pattern_ = animation.rich_palette(engine) wave3_pattern_.colors = plasma_colors_ -wave3_pattern_.cycle_period = 3000 +wave3_pattern_.period = 3000 wave3_pattern_.transition_type = animation.SINE wave3_pattern_.brightness = 220 var plasma_wave3_ = animation.beacon_animation(engine) @@ -115,10 +115,10 @@ palette plasma_colors = [ ] # Base plasma animation with medium speed -animation plasma_base = rich_palette_animation(colors=plasma_colors, cycle_period=6s, transition_type=SINE, brightness=200) +animation plasma_base = rich_palette_animation(colors=plasma_colors, period=6s, transition_type=SINE, brightness=200) # Add multiple wave layers for complexity -color wave1_pattern = rich_palette(colors=plasma_colors, cycle_period=4s, transition_type=SINE, brightness=255) +color wave1_pattern = rich_palette(colors=plasma_colors, period=4s, transition_type=SINE, brightness=255) animation plasma_wave1 = beacon_animation( color=wave1_pattern # color source pos=0 # initial position @@ -128,7 +128,7 @@ animation plasma_wave1 = beacon_animation( plasma_wave1.priority = 10 plasma_wave1.pos = smooth(min_value=0, max_value=40, duration=8s) -color wave2_pattern = rich_palette(colors=plasma_colors, cycle_period=5s, transition_type=SINE, brightness=180) +color wave2_pattern = rich_palette(colors=plasma_colors, period=5s, transition_type=SINE, brightness=180) animation plasma_wave2 = beacon_animation( color=wave2_pattern # color source pos=45 # initial position @@ -138,7 +138,7 @@ animation plasma_wave2 = beacon_animation( plasma_wave2.priority = 8 plasma_wave2.pos = smooth(min_value=45, max_value=15, duration=10s) # Opposite direction -color wave3_pattern = rich_palette(colors=plasma_colors, cycle_period=3s, transition_type=SINE, brightness=220) +color wave3_pattern = rich_palette(colors=plasma_colors, period=3s, transition_type=SINE, brightness=220) animation plasma_wave3 = beacon_animation( color=wave3_pattern # color source pos=20 # initial position diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/rainbow_cycle.be b/lib/libesp32/berry_animation/anim_examples/compiled/rainbow_cycle.be index c7568c5ef..1c3719c5a 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/rainbow_cycle.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/rainbow_cycle.be @@ -16,7 +16,7 @@ var rainbow_palette_ = bytes("FFFF0000" "FFFF8000" "FFFFFF00" "FF00FF00" "FF0000 # Create smooth rainbow cycle animation var rainbow_cycle_ = animation.color_cycle(engine) rainbow_cycle_.colors = rainbow_palette_ -rainbow_cycle_.cycle_period = 5000 # cycle period +rainbow_cycle_.period = 5000 # cycle period var rainbow_animation_ = animation.solid(engine) rainbow_animation_.color = rainbow_cycle_ # Start the animation @@ -35,7 +35,7 @@ palette rainbow_palette = [0xFF0000, 0xFF8000, 0xFFFF00, 0x00FF00, 0x0000FF, 0x8 # Create smooth rainbow cycle animation color rainbow_cycle = color_cycle( colors=rainbow_palette - cycle_period=5s # cycle period + period=5s # cycle period ) animation rainbow_animation = solid(color=rainbow_cycle) diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/sequence_assignments_demo.be b/lib/libesp32/berry_animation/anim_examples/compiled/sequence_assignments_demo.be index a35faf3db..0a902bd1e 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/sequence_assignments_demo.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/sequence_assignments_demo.be @@ -33,7 +33,7 @@ var brightness_low_ = 64 var eye_palette_ = bytes("FFFF0000" "FFFFFF00" "FF008000" "FFEE82EE") var eye_color_ = animation.color_cycle(engine) eye_color_.colors = eye_palette_ -eye_color_.cycle_period = 0 +eye_color_.period = 0 # Create animations var red_eye_ = animation.beacon_animation(engine) red_eye_.color = eye_color_ @@ -126,7 +126,7 @@ set brightness_low = 64 # Create color palette and cycling color palette eye_palette = [red, yellow, green, violet] -color eye_color = color_cycle(colors=eye_palette, cycle_period=0) +color eye_color = color_cycle(colors=eye_palette, period=0) # Create animations animation red_eye = beacon_animation( diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/simple_palette.be b/lib/libesp32/berry_animation/anim_examples/compiled/simple_palette.be index f87d1693b..6997b4a79 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/simple_palette.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/simple_palette.be @@ -17,7 +17,7 @@ var rainbow_ = bytes("00FF0000" "40FFA500" "80FFFF00" "C0008000" "FF0000FF") # Create an animation using the palette var rainbow_cycle_ = animation.rich_palette_animation(engine) rainbow_cycle_.colors = rainbow_ -rainbow_cycle_.cycle_period = 3000 +rainbow_cycle_.period = 3000 # Simple sequence var demo_ = animation.sequence_manager(engine) .push_play_step(rainbow_cycle_, 15000) @@ -41,7 +41,7 @@ palette rainbow = [ ] # Create an animation using the palette -animation rainbow_cycle = rich_palette_animation(colors=rainbow, cycle_period=3s) +animation rainbow_cycle = rich_palette_animation(colors=rainbow, period=3s) # Simple sequence sequence demo { diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/sunrise_sunset.be b/lib/libesp32/berry_animation/anim_examples/compiled/sunrise_sunset.be index c311d0f6b..19909f8b0 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/sunrise_sunset.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/sunrise_sunset.be @@ -27,7 +27,7 @@ var daylight_colors_ = bytes( # Main daylight cycle - very slow transition var daylight_cycle_ = animation.rich_palette_animation(engine) daylight_cycle_.colors = daylight_colors_ -daylight_cycle_.cycle_period = 60000 +daylight_cycle_.period = 60000 # Add sun position effect - bright spot that moves var sun_position_ = animation.beacon_animation(engine) sun_position_.color = 0xFFFFFFAA # Bright yellow sun @@ -111,7 +111,7 @@ palette daylight_colors = [ ] # Main daylight cycle - very slow transition -animation daylight_cycle = rich_palette_animation(colors=daylight_colors, cycle_period=60s) +animation daylight_cycle = rich_palette_animation(colors=daylight_colors, period=60s) # Add sun position effect - bright spot that moves animation sun_position = beacon_animation( diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/swipe_rainbow.be b/lib/libesp32/berry_animation/anim_examples/compiled/swipe_rainbow.be index b9b9f4f63..69cbcfe98 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/swipe_rainbow.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/swipe_rainbow.be @@ -14,7 +14,7 @@ var strip_len_ = animation.strip_length(engine) var palette_olivary_ = bytes("FFFF0000" "FFFFA500" "FFFFFF00" "FF008000" "FF0000FF" "FF4B0082" "FFEE82EE" "FFFFFFFF") var olivary_ = animation.color_cycle(engine) olivary_.colors = palette_olivary_ -olivary_.cycle_period = 0 +olivary_.period = 0 var swipe_animation_ = animation.solid(engine) swipe_animation_.color = olivary_ var slide_colors_ = animation.sequence_manager(engine) @@ -40,7 +40,7 @@ palette palette_olivary = [ white ] -color olivary = color_cycle(colors=palette_olivary, cycle_period=0) +color olivary = color_cycle(colors=palette_olivary, period=0) animation swipe_animation = solid( color = olivary diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/test_complex_template.be b/lib/libesp32/berry_animation/anim_examples/compiled/test_complex_template.be index 267f8fe81..f30519cec 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/test_complex_template.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/test_complex_template.be @@ -22,7 +22,7 @@ class rainbow_pulse_animation : animation.engine_proxy var cycle_color_ = animation.color_cycle(engine) cycle_color_.colors = animation.create_closure_value(engine, def (engine) return self.pal1 end) - cycle_color_.cycle_period = animation.create_closure_value(engine, def (engine) return self.period end) + cycle_color_.period = animation.create_closure_value(engine, def (engine) return self.period end) # Create pulsing animation var pulse_ = animation.pulsating_animation(engine) pulse_.color = cycle_color_ @@ -68,7 +68,7 @@ template animation rainbow_pulse { param back_color type color # Create color cycle using first palette - color cycle_color = color_cycle(colors=pal1, cycle_period=period) + color cycle_color = color_cycle(colors=pal1, period=period) # Create pulsing animation animation pulse = pulsating_animation( diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_bidir.be b/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_bidir.be index 57e3ec408..ec109ac82 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_bidir.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_bidir.be @@ -30,10 +30,10 @@ class shutter_bidir_animation : animation.engine_proxy end)(engine) var col1_ = animation.color_cycle(engine) col1_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col1_.cycle_period = 0 + col1_.period = 0 var col2_ = animation.color_cycle(engine) col2_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col2_.cycle_period = 0 + col2_.period = 0 col2_.next = 1 # shutter moving from left to right var shutter_lr_animation_ = animation.beacon_animation(engine) @@ -101,8 +101,8 @@ template animation shutter_bidir { set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len + 0, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving from left to right diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_central.be b/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_central.be index ad9f6f93c..5017d8267 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_central.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_central.be @@ -30,10 +30,10 @@ class shutter_central_animation : animation.engine_proxy end)(engine) var col1_ = animation.color_cycle(engine) col1_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col1_.cycle_period = 0 + col1_.period = 0 var col2_ = animation.color_cycle(engine) col2_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col2_.cycle_period = 0 + col2_.period = 0 col2_.next = 1 # shutter moving from left to right var shutter_central_animation_ = animation.beacon_animation(engine) @@ -83,8 +83,8 @@ template animation shutter_central { set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving from left to right diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/test_template_animation.be b/lib/libesp32/berry_animation/anim_examples/compiled/test_template_animation.be index e8701016a..194bfb260 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/test_template_animation.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/test_template_animation.be @@ -30,10 +30,10 @@ class shutter_central_animation : animation.engine_proxy end)(engine) var col1_ = animation.color_cycle(engine) col1_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col1_.cycle_period = 0 + col1_.period = 0 var col2_ = animation.color_cycle(engine) col2_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) - col2_.cycle_period = 0 + col2_.period = 0 col2_.next = 1 # shutter moving in to out var shutter_inout_animation_ = animation.beacon_animation(engine) @@ -91,8 +91,8 @@ template animation shutter_central { set strip_len2 = (strip_len + 1) / 2 set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving in to out diff --git a/lib/libesp32/berry_animation/anim_examples/cylon_rainbow.anim b/lib/libesp32/berry_animation/anim_examples/cylon_rainbow.anim index 9bcba624e..b7204ab32 100644 --- a/lib/libesp32/berry_animation/anim_examples/cylon_rainbow.anim +++ b/lib/libesp32/berry_animation/anim_examples/cylon_rainbow.anim @@ -7,7 +7,7 @@ set eye_duration = 5s # duration for a cylon eye cycle palette eye_palette = [ red, yellow, green, violet ] -color eye_color = color_cycle(colors=eye_palette, cycle_period=0) +color eye_color = color_cycle(colors=eye_palette, period=0) set cosine_val = cosine_osc(min_value = 0, max_value = strip_len - 2, duration = eye_duration) set triangle_val = triangle(min_value = 0, max_value = strip_len - 2, duration = eye_duration) diff --git a/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow2.anim b/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow2.anim index 6416cb83f..fde841f26 100644 --- a/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow2.anim +++ b/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow2.anim @@ -7,8 +7,8 @@ set duration = 3s set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = duration) - color col1 = color_cycle(colors=PALETTE_RAINBOW, cycle_period=0) - color col2 = color_cycle(colors=PALETTE_RAINBOW, cycle_period=0) + color col1 = color_cycle(colors=PALETTE_RAINBOW, period=0) + color col2 = color_cycle(colors=PALETTE_RAINBOW, period=0) col2.next = 1 animation shutter_animation = beacon_animation( diff --git a/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_bidir.anim b/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_bidir.anim index 7ff471451..6b4ae9fe9 100644 --- a/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_bidir.anim +++ b/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_bidir.anim @@ -9,8 +9,8 @@ template animation shutter_bidir { set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving from left to right diff --git a/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_central.anim b/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_central.anim index 667d0a191..b77e93618 100644 --- a/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_central.anim +++ b/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_central.anim @@ -10,8 +10,8 @@ template animation shutter_central { set strip_len2 = (strip_len + 1) / 2 set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving in to out diff --git a/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_leftright.anim b/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_leftright.anim index 2f9f196c1..eba39e945 100644 --- a/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_leftright.anim +++ b/lib/libesp32/berry_animation/anim_examples/demo_shutter_rainbow_leftright.anim @@ -9,8 +9,8 @@ template animation shutter_lr { set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving from left to right diff --git a/lib/libesp32/berry_animation/anim_examples/disco_strobe.anim b/lib/libesp32/berry_animation/anim_examples/disco_strobe.anim index a96d549e8..9af3eaf74 100644 --- a/lib/libesp32/berry_animation/anim_examples/disco_strobe.anim +++ b/lib/libesp32/berry_animation/anim_examples/disco_strobe.anim @@ -15,7 +15,7 @@ palette disco_colors = [ ] # Fast color cycling base -color disco_rich_color = rich_palette(colors=disco_colors, cycle_period=1s, transition_type=LINEAR, brightness=255) +color disco_rich_color = rich_palette(colors=disco_colors, period=1s, transition_type=LINEAR, brightness=255) animation disco_base = solid(color=disco_rich_color) # Add strobe effect @@ -27,7 +27,7 @@ white_flash.opacity = square(min_value=0, max_value=255, duration=50ms, duty_cyc white_flash.priority = 20 # Add colored sparkles -color sparkle_pattern = rich_palette(colors=disco_colors, cycle_period=500ms, transition_type=LINEAR, brightness=255) +color sparkle_pattern = rich_palette(colors=disco_colors, period=500ms, transition_type=LINEAR, brightness=255) animation disco_sparkles = twinkle_animation( color=sparkle_pattern # color source density=12 # density (many sparkles) @@ -36,7 +36,7 @@ animation disco_sparkles = twinkle_animation( disco_sparkles.priority = 15 # Add moving pulse for extra effect -color pulse_pattern = rich_palette(colors=disco_colors, cycle_period=800ms, transition_type=LINEAR, brightness=255) +color pulse_pattern = rich_palette(colors=disco_colors, period=800ms, transition_type=LINEAR, brightness=255) animation disco_pulse = beacon_animation( color=pulse_pattern # color source pos=4 # initial position diff --git a/lib/libesp32/berry_animation/anim_examples/fire_flicker.anim b/lib/libesp32/berry_animation/anim_examples/fire_flicker.anim index bf40bc80e..0f5aa14e7 100644 --- a/lib/libesp32/berry_animation/anim_examples/fire_flicker.anim +++ b/lib/libesp32/berry_animation/anim_examples/fire_flicker.anim @@ -13,14 +13,14 @@ palette fire_colors = [ ] # Create base fire animation with palette -color fire_base_color = rich_palette(colors=fire_colors, cycle_period=3s, transition_type=LINEAR, brightness=255) +color fire_base_color = rich_palette(colors=fire_colors, period=3s, transition_type=LINEAR, brightness=255) animation fire_base = solid(color=fire_base_color) # Add flickering effect with random intensity changes fire_base.opacity = smooth(min_value=180, max_value=255, duration=800ms) # Add subtle position variation for more realism -color flicker_pattern = rich_palette(colors=fire_colors, cycle_period=2s, transition_type=LINEAR, brightness=255) +color flicker_pattern = rich_palette(colors=fire_colors, period=2s, transition_type=LINEAR, brightness=255) animation fire_flicker = twinkle_animation( color=flicker_pattern # color source density=12 # density (number of flickers) diff --git a/lib/libesp32/berry_animation/anim_examples/lava_lamp.anim b/lib/libesp32/berry_animation/anim_examples/lava_lamp.anim index d867f136b..eaaf71f1e 100644 --- a/lib/libesp32/berry_animation/anim_examples/lava_lamp.anim +++ b/lib/libesp32/berry_animation/anim_examples/lava_lamp.anim @@ -13,10 +13,10 @@ palette lava_colors = [ ] # Base lava animation - very slow color changes -animation lava_base = rich_palette_animation(colors=lava_colors, cycle_period=15s, transition_type=SINE, brightness=180) +animation lava_base = rich_palette_animation(colors=lava_colors, period=15s, transition_type=SINE, brightness=180) # Add slow-moving lava blobs -color blob1_pattern = rich_palette(colors=lava_colors, cycle_period=12s, transition_type=SINE, brightness=255) +color blob1_pattern = rich_palette(colors=lava_colors, period=12s, transition_type=SINE, brightness=255) animation lava_blob1 = beacon_animation( color=blob1_pattern # color source pos=9 # initial position @@ -26,7 +26,7 @@ animation lava_blob1 = beacon_animation( lava_blob1.priority = 10 lava_blob1.pos = smooth(min_value=9, max_value=51, duration=20s) # Very slow movement -color blob2_pattern = rich_palette(colors=lava_colors, cycle_period=10s, transition_type=SINE, brightness=220) +color blob2_pattern = rich_palette(colors=lava_colors, period=10s, transition_type=SINE, brightness=220) animation lava_blob2 = beacon_animation( color=blob2_pattern # color source pos=46 # initial position @@ -36,7 +36,7 @@ animation lava_blob2 = beacon_animation( lava_blob2.priority = 8 lava_blob2.pos = smooth(min_value=46, max_value=14, duration=25s) # Opposite direction, slower -color blob3_pattern = rich_palette(colors=lava_colors, cycle_period=8s, transition_type=SINE, brightness=200) +color blob3_pattern = rich_palette(colors=lava_colors, period=8s, transition_type=SINE, brightness=200) animation lava_blob3 = beacon_animation( color=blob3_pattern # color source pos=25 # initial position @@ -47,7 +47,7 @@ lava_blob3.priority = 6 lava_blob3.pos = smooth(min_value=25, max_value=35, duration=18s) # Small movement range # Add subtle heat shimmer effect -color shimmer_pattern = rich_palette(colors=lava_colors, cycle_period=6s, transition_type=SINE, brightness=255) +color shimmer_pattern = rich_palette(colors=lava_colors, period=6s, transition_type=SINE, brightness=255) animation heat_shimmer = twinkle_animation( color=shimmer_pattern # color source density=6 # density (shimmer points) diff --git a/lib/libesp32/berry_animation/anim_examples/lightning_storm.anim b/lib/libesp32/berry_animation/anim_examples/lightning_storm.anim index bf564972a..d2efbfd47 100644 --- a/lib/libesp32/berry_animation/anim_examples/lightning_storm.anim +++ b/lib/libesp32/berry_animation/anim_examples/lightning_storm.anim @@ -10,7 +10,7 @@ palette storm_colors = [ (255, 0x220033) # Slightly lighter purple ] -animation storm_bg = rich_palette_animation(colors=storm_colors, cycle_period=12s, transition_type=SINE, brightness=100) +animation storm_bg = rich_palette_animation(colors=storm_colors, period=12s, transition_type=SINE, brightness=100) # Random lightning flashes - full strip animation lightning_main = solid(color=0xFFFFFF) # Bright white diff --git a/lib/libesp32/berry_animation/anim_examples/matrix_rain.anim b/lib/libesp32/berry_animation/anim_examples/matrix_rain.anim index f2a5481a6..6528f2f93 100644 --- a/lib/libesp32/berry_animation/anim_examples/matrix_rain.anim +++ b/lib/libesp32/berry_animation/anim_examples/matrix_rain.anim @@ -17,7 +17,7 @@ palette matrix_greens = [ ] # Create multiple cascading streams -color stream1_pattern = rich_palette(colors=matrix_greens, cycle_period=2s, transition_type=LINEAR, brightness=255) +color stream1_pattern = rich_palette(colors=matrix_greens, period=2s, transition_type=LINEAR, brightness=255) animation stream1 = comet_animation( color=stream1_pattern # color source tail_length=15 # long tail @@ -26,7 +26,7 @@ animation stream1 = comet_animation( ) -color stream2_pattern = rich_palette(colors=matrix_greens, cycle_period=1.8s, transition_type=LINEAR, brightness=200) +color stream2_pattern = rich_palette(colors=matrix_greens, period=1.8s, transition_type=LINEAR, brightness=200) animation stream2 = comet_animation( color=stream2_pattern # color source tail_length=12 # medium tail @@ -34,7 +34,7 @@ animation stream2 = comet_animation( priority = 8 ) -color stream3_pattern = rich_palette(colors=matrix_greens, cycle_period=2.5s, transition_type=LINEAR, brightness=180) +color stream3_pattern = rich_palette(colors=matrix_greens, period=2.5s, transition_type=LINEAR, brightness=180) animation stream3 = comet_animation( color=stream3_pattern # color source tail_length=10 # shorter tail diff --git a/lib/libesp32/berry_animation/anim_examples/neon_glow.anim b/lib/libesp32/berry_animation/anim_examples/neon_glow.anim index 1481808d3..ea8db3669 100644 --- a/lib/libesp32/berry_animation/anim_examples/neon_glow.anim +++ b/lib/libesp32/berry_animation/anim_examples/neon_glow.anim @@ -12,7 +12,7 @@ palette neon_colors = [ ] # Main neon glow with color cycling -animation neon_main = rich_palette_animation(colors=neon_colors, cycle_period=4s, transition_type=LINEAR, brightness=255) +animation neon_main = rich_palette_animation(colors=neon_colors, period=4s, transition_type=LINEAR, brightness=255) # Add electrical flickering neon_main.opacity = smooth(min_value=220, max_value=255, duration=200ms) @@ -23,7 +23,7 @@ neon_surge.opacity = square(min_value=0, max_value=255, duration=50ms, duty_cycl neon_surge.priority = 20 # Add neon tube segments with gaps -color segment_pattern = rich_palette(colors=neon_colors, cycle_period=4s, transition_type=LINEAR, brightness=255) +color segment_pattern = rich_palette(colors=neon_colors, period=4s, transition_type=LINEAR, brightness=255) animation segment1 = beacon_animation( color=segment_pattern # color source pos=6 # position diff --git a/lib/libesp32/berry_animation/anim_examples/ocean_waves.anim b/lib/libesp32/berry_animation/anim_examples/ocean_waves.anim index 012a9ff42..3af00afb8 100644 --- a/lib/libesp32/berry_animation/anim_examples/ocean_waves.anim +++ b/lib/libesp32/berry_animation/anim_examples/ocean_waves.anim @@ -13,10 +13,10 @@ palette ocean_colors = [ ] # Base ocean animation with slow color cycling -animation ocean_base = rich_palette_animation(colors=ocean_colors, cycle_period=8s, transition_type=SINE, brightness=200) +animation ocean_base = rich_palette_animation(colors=ocean_colors, period=8s, transition_type=SINE, brightness=200) # Add wave motion with moving pulses -color wave1_pattern = rich_palette(colors=ocean_colors, cycle_period=6s, transition_type=SINE, brightness=255) +color wave1_pattern = rich_palette(colors=ocean_colors, period=6s, transition_type=SINE, brightness=255) animation wave1 = beacon_animation( color=wave1_pattern # color source pos=0 # initial position @@ -26,7 +26,7 @@ animation wave1 = beacon_animation( wave1.priority = 10 wave1.pos = sawtooth(min_value=0, max_value=48, duration=5s) # 60-12 = 48 -color wave2_pattern = rich_palette(colors=ocean_colors, cycle_period=4s, transition_type=SINE, brightness=180) +color wave2_pattern = rich_palette(colors=ocean_colors, period=4s, transition_type=SINE, brightness=180) animation wave2 = beacon_animation( color=wave2_pattern # color source pos=52 # initial position diff --git a/lib/libesp32/berry_animation/anim_examples/palette_demo.anim b/lib/libesp32/berry_animation/anim_examples/palette_demo.anim index b73105bb3..e0f29af69 100644 --- a/lib/libesp32/berry_animation/anim_examples/palette_demo.anim +++ b/lib/libesp32/berry_animation/anim_examples/palette_demo.anim @@ -16,9 +16,9 @@ palette ocean_colors = [ ] # Create animations using the palettes -animation fire_anim = rich_palette_animation(colors=fire_colors, cycle_period=5s) +animation fire_anim = rich_palette_animation(colors=fire_colors, period=5s) -animation ocean_anim = rich_palette_animation(colors=ocean_colors, cycle_period=8s) +animation ocean_anim = rich_palette_animation(colors=ocean_colors, period=8s) # Sequence to show both palettes sequence palette_demo { diff --git a/lib/libesp32/berry_animation/anim_examples/palette_showcase.anim b/lib/libesp32/berry_animation/anim_examples/palette_showcase.anim index 8a345598a..e8e521a00 100644 --- a/lib/libesp32/berry_animation/anim_examples/palette_showcase.anim +++ b/lib/libesp32/berry_animation/anim_examples/palette_showcase.anim @@ -44,13 +44,13 @@ palette sunset_sky = [ ] # Create animations using each palette -animation fire_effect = solid(color=rich_palette(colors=fire_gradient, cycle_period=3s)) +animation fire_effect = solid(color=rich_palette(colors=fire_gradient, period=3s)) -animation ocean_waves = rich_palette_animation(colors=ocean_depths, cycle_period=8s, transition_type=SINE, brightness=200) +animation ocean_waves = rich_palette_animation(colors=ocean_depths, period=8s, transition_type=SINE, brightness=200) -animation aurora_lights = rich_palette_animation(colors=aurora_borealis, cycle_period=12s, transition_type=SINE, brightness=180) +animation aurora_lights = rich_palette_animation(colors=aurora_borealis, period=12s, transition_type=SINE, brightness=180) -animation sunset_glow = rich_palette_animation(colors=sunset_sky, cycle_period=6s, transition_type=SINE, brightness=220) +animation sunset_glow = rich_palette_animation(colors=sunset_sky, period=6s, transition_type=SINE, brightness=220) # Sequence to showcase all palettes sequence palette_showcase { diff --git a/lib/libesp32/berry_animation/anim_examples/plasma_wave.anim b/lib/libesp32/berry_animation/anim_examples/plasma_wave.anim index d1182e3d3..0325952d0 100644 --- a/lib/libesp32/berry_animation/anim_examples/plasma_wave.anim +++ b/lib/libesp32/berry_animation/anim_examples/plasma_wave.anim @@ -14,10 +14,10 @@ palette plasma_colors = [ ] # Base plasma animation with medium speed -animation plasma_base = rich_palette_animation(colors=plasma_colors, cycle_period=6s, transition_type=SINE, brightness=200) +animation plasma_base = rich_palette_animation(colors=plasma_colors, period=6s, transition_type=SINE, brightness=200) # Add multiple wave layers for complexity -color wave1_pattern = rich_palette(colors=plasma_colors, cycle_period=4s, transition_type=SINE, brightness=255) +color wave1_pattern = rich_palette(colors=plasma_colors, period=4s, transition_type=SINE, brightness=255) animation plasma_wave1 = beacon_animation( color=wave1_pattern # color source pos=0 # initial position @@ -27,7 +27,7 @@ animation plasma_wave1 = beacon_animation( plasma_wave1.priority = 10 plasma_wave1.pos = smooth(min_value=0, max_value=40, duration=8s) -color wave2_pattern = rich_palette(colors=plasma_colors, cycle_period=5s, transition_type=SINE, brightness=180) +color wave2_pattern = rich_palette(colors=plasma_colors, period=5s, transition_type=SINE, brightness=180) animation plasma_wave2 = beacon_animation( color=wave2_pattern # color source pos=45 # initial position @@ -37,7 +37,7 @@ animation plasma_wave2 = beacon_animation( plasma_wave2.priority = 8 plasma_wave2.pos = smooth(min_value=45, max_value=15, duration=10s) # Opposite direction -color wave3_pattern = rich_palette(colors=plasma_colors, cycle_period=3s, transition_type=SINE, brightness=220) +color wave3_pattern = rich_palette(colors=plasma_colors, period=3s, transition_type=SINE, brightness=220) animation plasma_wave3 = beacon_animation( color=wave3_pattern # color source pos=20 # initial position diff --git a/lib/libesp32/berry_animation/anim_examples/rainbow_cycle.anim b/lib/libesp32/berry_animation/anim_examples/rainbow_cycle.anim index 5facbe56a..ad292f7ee 100644 --- a/lib/libesp32/berry_animation/anim_examples/rainbow_cycle.anim +++ b/lib/libesp32/berry_animation/anim_examples/rainbow_cycle.anim @@ -8,7 +8,7 @@ palette rainbow_palette = [0xFF0000, 0xFF8000, 0xFFFF00, 0x00FF00, 0x0000FF, 0x8 # Create smooth rainbow cycle animation color rainbow_cycle = color_cycle( colors=rainbow_palette - cycle_period=5s # cycle period + period=5s # cycle period ) animation rainbow_animation = solid(color=rainbow_cycle) diff --git a/lib/libesp32/berry_animation/anim_examples/sequence_assignments_demo.anim b/lib/libesp32/berry_animation/anim_examples/sequence_assignments_demo.anim index 7cdc3932a..dc0c0f5d6 100644 --- a/lib/libesp32/berry_animation/anim_examples/sequence_assignments_demo.anim +++ b/lib/libesp32/berry_animation/anim_examples/sequence_assignments_demo.anim @@ -10,7 +10,7 @@ set brightness_low = 64 # Create color palette and cycling color palette eye_palette = [red, yellow, green, violet] -color eye_color = color_cycle(colors=eye_palette, cycle_period=0) +color eye_color = color_cycle(colors=eye_palette, period=0) # Create animations animation red_eye = beacon_animation( diff --git a/lib/libesp32/berry_animation/anim_examples/simple_palette.anim b/lib/libesp32/berry_animation/anim_examples/simple_palette.anim index fc6b5e677..a299dfb39 100644 --- a/lib/libesp32/berry_animation/anim_examples/simple_palette.anim +++ b/lib/libesp32/berry_animation/anim_examples/simple_palette.anim @@ -13,7 +13,7 @@ palette rainbow = [ ] # Create an animation using the palette -animation rainbow_cycle = rich_palette_animation(colors=rainbow, cycle_period=3s) +animation rainbow_cycle = rich_palette_animation(colors=rainbow, period=3s) # Simple sequence sequence demo { diff --git a/lib/libesp32/berry_animation/anim_examples/sunrise_sunset.anim b/lib/libesp32/berry_animation/anim_examples/sunrise_sunset.anim index c9efc0eee..d68a51e34 100644 --- a/lib/libesp32/berry_animation/anim_examples/sunrise_sunset.anim +++ b/lib/libesp32/berry_animation/anim_examples/sunrise_sunset.anim @@ -17,7 +17,7 @@ palette daylight_colors = [ ] # Main daylight cycle - very slow transition -animation daylight_cycle = rich_palette_animation(colors=daylight_colors, cycle_period=60s) +animation daylight_cycle = rich_palette_animation(colors=daylight_colors, period=60s) # Add sun position effect - bright spot that moves animation sun_position = beacon_animation( diff --git a/lib/libesp32/berry_animation/anim_examples/swipe_rainbow.anim b/lib/libesp32/berry_animation/anim_examples/swipe_rainbow.anim index 09ca8c971..31062f5d4 100644 --- a/lib/libesp32/berry_animation/anim_examples/swipe_rainbow.anim +++ b/lib/libesp32/berry_animation/anim_examples/swipe_rainbow.anim @@ -13,7 +13,7 @@ palette palette_olivary = [ white ] -color olivary = color_cycle(colors=palette_olivary, cycle_period=0) +color olivary = color_cycle(colors=palette_olivary, period=0) animation swipe_animation = solid( color = olivary diff --git a/lib/libesp32/berry_animation/anim_examples/test_complex_template.anim b/lib/libesp32/berry_animation/anim_examples/test_complex_template.anim index 8587405b4..5da5d8ad9 100644 --- a/lib/libesp32/berry_animation/anim_examples/test_complex_template.anim +++ b/lib/libesp32/berry_animation/anim_examples/test_complex_template.anim @@ -7,7 +7,7 @@ template animation rainbow_pulse { param back_color type color # Create color cycle using first palette - color cycle_color = color_cycle(colors=pal1, cycle_period=period) + color cycle_color = color_cycle(colors=pal1, period=period) # Create pulsing animation animation pulse = pulsating_animation( diff --git a/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_bidir.anim b/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_bidir.anim index b88d98db5..cb369d662 100644 --- a/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_bidir.anim +++ b/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_bidir.anim @@ -9,8 +9,8 @@ template animation shutter_bidir { set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len + 0, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving from left to right diff --git a/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_central.anim b/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_central.anim index 700727160..b17487698 100644 --- a/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_central.anim +++ b/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_central.anim @@ -9,8 +9,8 @@ template animation shutter_central { set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving from left to right diff --git a/lib/libesp32/berry_animation/anim_examples/test_template_animation.anim b/lib/libesp32/berry_animation/anim_examples/test_template_animation.anim index e99a9420c..a0b20e828 100644 --- a/lib/libesp32/berry_animation/anim_examples/test_template_animation.anim +++ b/lib/libesp32/berry_animation/anim_examples/test_template_animation.anim @@ -9,8 +9,8 @@ template animation shutter_central { set strip_len2 = (strip_len + 1) / 2 set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # shutter moving in to out diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_2_10_palette_rotation.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_2_10_palette_rotation.anim index e442b1aff..781ceea9d 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_2_10_palette_rotation.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_2_10_palette_rotation.anim @@ -3,6 +3,6 @@ # Define a color attribute that cycles over time, cycle is 5 seconds # PALETTE_RAINBOW defines 7 rainbow colors at roughly the same brightness # PALETTE_RAINBOW_W adds 8th color white -color rainbow_color = color_cycle(colors=PALETTE_RAINBOW_W, cycle_period=5s) +color rainbow_color = color_cycle(colors=PALETTE_RAINBOW_W, period=5s) animation back = solid(color=rainbow_color) run back \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_2_20_palette_rotation.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_2_20_palette_rotation.anim index bd7194b6f..7e9ff590f 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_2_20_palette_rotation.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_2_20_palette_rotation.anim @@ -14,7 +14,7 @@ palette rainbow_with_white = [ ] # Define a color attribute that cycles over time, cycle is 5 seconds -color rainbow_color = color_cycle(colors=rainbow_with_white, cycle_period=5s) +color rainbow_color = color_cycle(colors=rainbow_with_white, period=5s) # Define a solid background with this dynamic color animation back = solid(color=rainbow_color) diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_3_10_color_transition.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_3_10_color_transition.anim index 7d20e8244..99ddffe40 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_3_10_color_transition.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_3_10_color_transition.anim @@ -2,6 +2,6 @@ animation back = rich_palette_animation() # Equivalent to -# animation back = rich_palette_animation(colors=PALETTE_PALETTE_RAINBOW, cycle_period=5s, +# animation back = rich_palette_animation(colors=PALETTE_PALETTE_RAINBOW, period=5s, # transition_type=SINE, brightness=100%) run back \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_3_20_color_transition_palette.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_3_20_color_transition_palette.anim index 38e057998..229d60f42 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_3_20_color_transition_palette.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_3_20_color_transition_palette.anim @@ -15,7 +15,7 @@ palette rainbow_with_white = [ ] # Define a color attribute that cycles over time, cycle is 10 seconds -color rainbow_color_rollover = rich_palette(cycle_period=10s) +color rainbow_color_rollover = rich_palette(period=10s) # Use the dynamic color in a simple 'solid' animation animation back = solid(color=rainbow_color_rollover) diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_4_10_color_pattern.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_4_10_color_pattern.anim index 3d3b4743c..b9005f7c4 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_4_10_color_pattern.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_4_10_color_pattern.anim @@ -1,8 +1,8 @@ # @desc Rainbow pattern # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) -# 'cycle_period = 0' means that the colors don't change in time, only spatial change -color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, cycle_period=0) +# 'period = 0' means that the colors don't change in time, only spatial change +color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) # Define a gradient across the whole strip animation back_pattern = palette_gradient_animation(color_source = rainbow_rich_color) diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_4_12_color_pattern_spatial_2.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_4_12_color_pattern_spatial_2.anim index 2b0593347..fe8cc5591 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_4_12_color_pattern_spatial_2.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_4_12_color_pattern_spatial_2.anim @@ -2,8 +2,8 @@ # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) -# 'cycle_period = 0' means that the colors don't change in time, only spatial change -color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, cycle_period=0) +# 'period = 0' means that the colors don't change in time, only spatial change +color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) # Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas set strip_len = strip_length() diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_4_15_color_pattern_spatial_osc.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_4_15_color_pattern_spatial_osc.anim index 2f8a3412a..1beebfd74 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_4_15_color_pattern_spatial_osc.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_4_15_color_pattern_spatial_osc.anim @@ -1,8 +1,8 @@ # @desc Rainbow gradient with oscillating spatial period between 100% and 50% # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) -# 'cycle_period = 0' means that the colors don't change in time, only spatial change -color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, cycle_period=0) +# 'period = 0' means that the colors don't change in time, only spatial change +color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) # Because strip_length is dynamic, we need to map it to a variable and can't use the function directly in formulas set strip_len = strip_length() diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_4_18_color_pattern_spatial_rotate.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_4_18_color_pattern_spatial_rotate.anim index ea9df22fa..2057b87d3 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_4_18_color_pattern_spatial_rotate.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_4_18_color_pattern_spatial_rotate.anim @@ -1,8 +1,8 @@ # @desc Rainbow gradient rotating along the strip over 5 seconds # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) -# 'cycle_period = 0' means that the colors don't change in time, only spatial change -color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, cycle_period=0) +# 'period = 0' means that the colors don't change in time, only spatial change +color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) # define a gradient across the whole strip animation back = palette_gradient_animation(color_source = rainbow_rich_color, shift_period = 5s) diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_4_30_color_pattern_meter.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_4_30_color_pattern_meter.anim index a14ffec65..da1d7ddb4 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_4_30_color_pattern_meter.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_4_30_color_pattern_meter.anim @@ -13,7 +13,7 @@ palette vue_meter_palette = [ ] # Define a color palette pattern for 'vue_meter_palette' -color rainbow_rich_color = rich_palette(colors=vue_meter_palette, cycle_period=0, transition_type=LINEAR) +color rainbow_rich_color = rich_palette(colors=vue_meter_palette, period=0, transition_type=LINEAR) # Define a sawtooth value from 0% to 100% set level = sawtooth(min_value = 0%, max_value=100%, duration = 2s) diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_4_35_color_pattern_meter_random.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_4_35_color_pattern_meter_random.anim index c8a3e2676..25e3bd8d0 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_4_35_color_pattern_meter_random.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_4_35_color_pattern_meter_random.anim @@ -24,7 +24,7 @@ palette vue_meter_palette = [ ] # Define a color palette pattern for 'vue_meter_palette' -color rainbow_rich_color = rich_palette(colors=vue_meter_palette, cycle_period=0, transition_type=LINEAR) +color rainbow_rich_color = rich_palette(colors=vue_meter_palette, period=0, transition_type=LINEAR) # Define a vue-meter based on all elements above animation back = palette_meter_animation(color_source = rainbow_rich_color, level = rand_meter()) diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_5_40_cylon_rainbow.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_5_40_cylon_rainbow.anim index d8c303423..7bad2f0fb 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_5_40_cylon_rainbow.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_5_40_cylon_rainbow.anim @@ -16,7 +16,7 @@ run stars # We can combine a dynamic 'pos' value with a dynamic 'color' animation back = beacon_animation( - color = rich_palette(colors=PALETTE_RAINBOW_W2, cycle_period=5s) + color = rich_palette(colors=PALETTE_RAINBOW_W2, period=5s) pos = cosine_osc(min_value = -1, max_value = strip_len - 2, duration = 5s) beacon_size = 3 # small 3 pixels eye slew_size = 2 # with 2 pixel shading around diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_6_20_shutter_rotating_colors.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_6_20_shutter_rotating_colors.anim index cfd6f1a3a..d51e87ca9 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_6_20_shutter_rotating_colors.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_6_20_shutter_rotating_colors.anim @@ -12,8 +12,8 @@ set shutter_size = sawtooth(min_value = 0, max_value = strip_len, # Define 2 color providers cycling through palette rainbow with white # 'col2' is shifted by 1 color from 'col1' -color col1 = color_cycle(colors=PALETTE_RAINBOW_W, cycle_period=0) -color col2 = color_cycle(colors=PALETTE_RAINBOW_W, cycle_period=0) +color col1 = color_cycle(colors=PALETTE_RAINBOW_W, period=0) +color col2 = color_cycle(colors=PALETTE_RAINBOW_W, period=0) col2.next = 1 # Writing 1 to 'next' actually advances the color # Using beacon_animation to move a shutter from left to right diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_6_30_shutter_central_rotating_colors.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_6_30_shutter_central_rotating_colors.anim index 4fca327c4..9f23ca636 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_6_30_shutter_central_rotating_colors.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_6_30_shutter_central_rotating_colors.anim @@ -13,8 +13,8 @@ set shutter_size = sawtooth(min_value = 0, max_value = strip_len, # Define 2 color providers cycling through palette rainbow with white # 'col2' is shifted by 1 color from 'col1' -color col1 = color_cycle(colors=PALETTE_RAINBOW_W, cycle_period=0) -color col2 = color_cycle(colors=PALETTE_RAINBOW_W, cycle_period=0) +color col1 = color_cycle(colors=PALETTE_RAINBOW_W, period=0) +color col2 = color_cycle(colors=PALETTE_RAINBOW_W, period=0) col2.next = 1 # Writing 1 to 'next' actually advances the color # Using beacon_animation to move a shutter from in to out diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_6_40_shutter_central_inoutin.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_6_40_shutter_central_inoutin.anim index 9eb25cfac..99a487c37 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_6_40_shutter_central_inoutin.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_6_40_shutter_central_inoutin.anim @@ -13,8 +13,8 @@ set shutter_size = sawtooth(min_value = 0, max_value = strip_len, # Define 2 color providers cycling through palette rainbow with white # 'col2' is shifted by 1 color from 'col1' -color col1 = color_cycle(colors=PALETTE_RAINBOW_W, cycle_period=0) -color col2 = color_cycle(colors=PALETTE_RAINBOW_W, cycle_period=0) +color col1 = color_cycle(colors=PALETTE_RAINBOW_W, period=0) +color col2 = color_cycle(colors=PALETTE_RAINBOW_W, period=0) col2.next = 1 # Writing 1 to 'next' actually advances the color # Using beacon_animation to move a shutter from in to out diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_7_40_crenel_colors.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_7_40_crenel_colors.anim index 95cc99b21..783bd2f0e 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_7_40_crenel_colors.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_7_40_crenel_colors.anim @@ -1,7 +1,7 @@ # @desc Crenel static with variable color # Define a color attribute that cycles over time, cycle is 5 seconds -color rainbow_color = rich_palette(colors=PALETTE_RAINBOW_W2, cycle_period=5s) +color rainbow_color = rich_palette(colors=PALETTE_RAINBOW_W2, period=5s) # Define a simple crenel 2+2 animation back = crenel_animation( diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_7_50_crenel_opacity.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_7_50_crenel_opacity.anim index 0a8fd8ece..4cee7a34e 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_7_50_crenel_opacity.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_7_50_crenel_opacity.anim @@ -13,7 +13,7 @@ animation mask = crenel_animation( ) # Define a smooth palette using PALETTE_RAINBOW_W (7 colors + white) -color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, cycle_period=0) +color rainbow_rich_color = rich_palette(colors=PALETTE_RAINBOW_W, period=0) # Define a gradient across the whole strip and use crenel as opacity mask animation pattern = palette_gradient_animation( color_source = rainbow_rich_color # use the rainow pattern diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_8_10_template_cylon_simple.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_8_10_template_cylon_simple.anim index 9606891f8..e7c6e68e8 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_8_10_template_cylon_simple.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_8_10_template_cylon_simple.anim @@ -1,4 +1,4 @@ -# @desc Template example fir Cylon-style scanning eye +# @desc Template example for Cylon-style scanning eye # Define a full template with parameters: eye_color, back_color, period, priority template animation cylon_eye { diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_8_20_template_color_cycle.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_8_20_template_color_cycle.anim index 07b14638f..6a1f0db7d 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_8_20_template_color_cycle.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_8_20_template_color_cycle.anim @@ -1,12 +1,12 @@ # @desc Rainbow colors cycling with custom palette -# Define a full template with parameters: colors, cycle_period +# Define a full template with parameters: colors, period template animation color_cycle2 { param colors type palette - param cycle_period default 5s + param period default 5s # Define a color attribute that cycles over time, cycle is 5 seconds - color rainbow_color = color_cycle(colors=colors, cycle_period=cycle_period) + color rainbow_color = color_cycle(colors=colors, period=period) # Define a solid background with this dynamic color animation back = solid(color=rainbow_color) @@ -19,5 +19,5 @@ palette rgb = [ 0x0080FF # Blue ] -animation main = color_cycle2(colors = rgb, cycle_period = 2s) +animation main = color_cycle2(colors = rgb, period = 2s) run main \ No newline at end of file diff --git a/lib/libesp32/berry_animation/anim_tutorials/chap_8_30_template_shutter_bidir_flags.anim b/lib/libesp32/berry_animation/anim_tutorials/chap_8_30_template_shutter_bidir_flags.anim index 7f050e7ab..0593b5659 100644 --- a/lib/libesp32/berry_animation/anim_tutorials/chap_8_30_template_shutter_bidir_flags.anim +++ b/lib/libesp32/berry_animation/anim_tutorials/chap_8_30_template_shutter_bidir_flags.anim @@ -15,8 +15,8 @@ template animation shutter_bidir { set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = period) # Define two rotating palettes, shifted by one color - color col1 = color_cycle(colors=colors, cycle_period=0) - color col2 = color_cycle(colors=colors, cycle_period=0) + color col1 = color_cycle(colors=colors, period=0) + color col2 = color_cycle(colors=colors, period=0) col2.next = 1 # move 'col2' to the next color so it's shifte by one compared to 'col1' # Shutter moving in in-out diff --git a/lib/libesp32/berry_animation/berry_animation_docs/ANIMATION_CLASS_HIERARCHY.md b/lib/libesp32/berry_animation/berry_animation_docs/ANIMATION_CLASS_HIERARCHY.md index e07eeed40..e5bf20db5 100644 --- a/lib/libesp32/berry_animation/berry_animation_docs/ANIMATION_CLASS_HIERARCHY.md +++ b/lib/libesp32/berry_animation/berry_animation_docs/ANIMATION_CLASS_HIERARCHY.md @@ -175,7 +175,7 @@ template animation fade_effect { # 'duration' is implicit - no need to declare set oscillator = sawtooth(min_value=0, max_value=255, duration=duration) - color col = color_cycle(palette=colors, cycle_period=0) + color col = color_cycle(colors=colors, period=0) animation test = solid(color=col) test.opacity = oscillator # 'opacity' is also implicit @@ -386,35 +386,35 @@ Cycles through a palette of colors with brutal switching. Inherits from `ColorPr | Parameter | Type | Default | Constraints | Description | |-----------|------|---------|-------------|-------------| -| `palette` | bytes | default palette | - | Palette bytes in AARRGGBB format | -| `cycle_period` | int | 5000 | min: 0 | Cycle time in ms (0 = manual only) | +| `colors` | bytes | default palette | - | Palette bytes in AARRGGBB format | +| `period` | int | 5000 | min: 0 | Cycle time in ms (0 = manual only) | | `next` | int | 0 | - | Write 1 to move to next color manually, or any number to go forward or backwards by `n` colors | | `palette_size` | int | 3 | read-only | Number of colors in the palette (automatically updated when palette changes) | | *(inherits brightness from ColorProvider)* | | | | | **Note**: The `get_color_for_value()` method accepts values in the 0-255 range for value-based color mapping. -**Modes**: Auto-cycle (`cycle_period > 0`) or Manual-only (`cycle_period = 0`) +**Modes**: Auto-cycle (`period > 0`) or Manual-only (`period = 0`) #### Usage Examples ```berry # RGB cycle with brutal switching color rgb_cycle = color_cycle( - palette=bytes("FF0000FF" "FF00FF00" "FFFF0000"), - cycle_period=4s + colors=bytes("FF0000FF" "FF00FF00" "FFFF0000"), + period=4s ) # Custom warm colors color warm_cycle = color_cycle( - palette=bytes("FF4500FF" "FF8C00FF" "FFFF00"), - cycle_period=3s + colors=bytes("FF4500FF" "FF8C00FF" "FFFF00"), + period=3s ) # Mixed colors in AARRGGBB format color mixed_cycle = color_cycle( - palette=bytes("FFFF0000" "FF00FF00" "FF0000FF"), - cycle_period=2s + colors=bytes("FFFF0000" "FF00FF00" "FF0000FF"), + period=2s ) ``` @@ -424,8 +424,8 @@ Generates colors from predefined palettes with smooth transitions and profession | Parameter | Type | Default | Constraints | Description | |-----------|------|---------|-------------|-------------| -| `palette` | bytes | rainbow palette | - | Palette bytes or predefined palette constant | -| `cycle_period` | int | 5000 | min: 0 | Cycle time in ms (0 = value-based only) | +| `colors` | bytes | rainbow palette | - | Palette bytes or predefined palette constant | +| `period` | int | 5000 | min: 0 | Cycle time in ms (0 = value-based only) | | `transition_type` | int | animation.LINEAR | enum: [animation.LINEAR, animation.SINE] | LINEAR=constant speed, SINE=smooth ease-in/ease-out | | *(inherits brightness from ColorProvider)* | | | | | @@ -442,16 +442,16 @@ Generates colors from predefined palettes with smooth transitions and profession ```berry # Rainbow palette with smooth ease-in/ease-out transitions color rainbow_colors = rich_palette( - palette=PALETTE_RAINBOW, - cycle_period=5s, + colors=PALETTE_RAINBOW, + period=5s, transition_type=SINE, brightness=255 ) # Fire effect with linear (constant speed) transitions color fire_colors = rich_palette( - palette=PALETTE_FIRE, - cycle_period=3s, + colors=PALETTE_FIRE, + period=3s, transition_type=LINEAR, brightness=200 ) @@ -509,7 +509,7 @@ color deep_breath = breathe_color( ) # Using dynamic base color -color rainbow_cycle = color_cycle(palette=bytes("FF0000FF" "FF00FF00" "FFFF0000"), cycle_period=5s) +color rainbow_cycle = color_cycle(colors=bytes("FF0000FF" "FF00FF00" "FFFF0000"), period=5s) color breathing_rainbow = breathe_color( base_color=rainbow_cycle, min_brightness=30, @@ -634,7 +634,7 @@ meter.color_source = rainbow meter.level = 128 # Meter with peak hold (1 second) -color fire_colors = rich_palette(palette=PALETTE_FIRE) +color fire_colors = rich_palette(colors=PALETTE_FIRE) animation vu_meter = gradient_meter_animation(peak_hold=1000) vu_meter.color_source = fire_colors @@ -962,14 +962,14 @@ Creates smooth color transitions using rich palette data with direct parameter a | Parameter | Type | Default | Constraints | Description | |-----------|------|---------|-------------|-------------| -| `palette` | bytes | rainbow palette | - | Palette bytes or predefined palette | -| `cycle_period` | int | 5000 | min: 0 | Cycle time in ms (0 = value-based only) | +| `colors` | bytes | rainbow palette | - | Palette bytes or predefined palette | +| `period` | int | 5000 | min: 0 | Cycle time in ms (0 = value-based only) | | `transition_type` | int | animation.LINEAR | enum: [animation.LINEAR, animation.SINE] | LINEAR=constant speed, SINE=smooth ease-in/ease-out | | `brightness` | int | 255 | 0-255 | Overall brightness scaling | | *(inherits all Animation parameters)* | | | | | **Special Features**: -- Direct parameter access (set `anim.palette` instead of `anim.color.palette`) +- Direct parameter access (set `anim.colors` instead of `anim.color.colors`) - Parameters are automatically forwarded to internal `RichPaletteColorProvider` - Access to specialized methods via `anim.color_provider.method_name()` diff --git a/lib/libesp32/berry_animation/berry_animation_docs/ANIMATION_DEVELOPMENT.md b/lib/libesp32/berry_animation/berry_animation_docs/ANIMATION_DEVELOPMENT.md index fbae87a28..417c93306 100644 --- a/lib/libesp32/berry_animation/berry_animation_docs/ANIMATION_DEVELOPMENT.md +++ b/lib/libesp32/berry_animation/berry_animation_docs/ANIMATION_DEVELOPMENT.md @@ -233,7 +233,7 @@ class MyColorProvider : animation.color_provider # Mark LUT as dirty when parameters change def on_param_changed(name, value) super(self).on_param_changed(name, value) - if name == "palette" || name == "transition_type" + if name == "colors" || name == "transition_type" self._lut_dirty = true # Inherited from ColorProvider end end diff --git a/lib/libesp32/berry_animation/berry_animation_docs/DSL_REFERENCE.md b/lib/libesp32/berry_animation/berry_animation_docs/DSL_REFERENCE.md index 77c422013..2d6610d03 100644 --- a/lib/libesp32/berry_animation/berry_animation_docs/DSL_REFERENCE.md +++ b/lib/libesp32/berry_animation/berry_animation_docs/DSL_REFERENCE.md @@ -373,8 +373,8 @@ color my_white = white # Reference to predefined color # Color providers for dynamic colors color rainbow_cycle = color_cycle( - palette=bytes("FFFF0000" "FF00FF00" "FF0000FF") - cycle_period=5s + colors=bytes("FFFF0000" "FF00FF00" "FF0000FF") + period=5s ) color breathing_red = breathe_color( base_color=red @@ -485,8 +485,8 @@ animation.register_user_function("custom_palette", create_custom_palette) ```berry # Use in DSL animation dynamic_anim = rich_palette( - palette=custom_palette(0xFF0000, 200) - cycle_period=3s + colors=custom_palette(0xFF0000, 200) + period=3s ) ``` @@ -783,7 +783,7 @@ sequence cylon_eye repeat forever { # Option 3: Parametric repeat count sequence rainbow_cycle repeat palette.size times { play animation for 1s - palette.next = 1 + colors.next = 1 } ``` @@ -1064,7 +1064,7 @@ template animation shutter_effect { set strip_len = strip_length() set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = duration) - color col = color_cycle(palette=colors, cycle_period=0) + color col = color_cycle(colors=colors, period=0) animation shutter = beacon_animation( color = col @@ -1136,7 +1136,7 @@ template animation fade_effect { # 'duration' is an implicit parameter - no need to declare it set oscillator = sawtooth(min_value=0, max_value=255, duration=duration) - color col = color_cycle(palette=colors, cycle_period=0) + color col = color_cycle(colors=colors, period=0) animation test = solid(color=col) # 'opacity' is also implicit diff --git a/lib/libesp32/berry_animation/berry_animation_docs/DSL_TRANSPILATION.md b/lib/libesp32/berry_animation/berry_animation_docs/DSL_TRANSPILATION.md index df710b3a9..ed15d231b 100644 --- a/lib/libesp32/berry_animation/berry_animation_docs/DSL_TRANSPILATION.md +++ b/lib/libesp32/berry_animation/berry_animation_docs/DSL_TRANSPILATION.md @@ -321,7 +321,7 @@ template animation shutter_effect { param duration type time min 0 max 3600 default 5 nillable false set strip_len = strip_length() - color col = color_cycle(palette=colors, cycle_period=0) + color col = color_cycle(colors=colors, period=0) animation shutter = beacon_animation( color = col @@ -351,8 +351,8 @@ class shutter_effect_animation : animation.engine_proxy var strip_len_ = animation.strip_length(engine) var col_ = animation.color_cycle(engine) - col_.palette = animation.create_closure_value(engine, def (engine) return self.colors end) - col_.cycle_period = 0 + col_.colors = animation.create_closure_value(engine, def (engine) return self.colors end) + col_.period = 0 var shutter_ = animation.beacon_animation(engine) shutter_.color = col_ diff --git a/lib/libesp32/berry_animation/berry_animation_docs/EXAMPLES.md b/lib/libesp32/berry_animation/berry_animation_docs/EXAMPLES.md index 1030ad2a9..13a5bdafe 100644 --- a/lib/libesp32/berry_animation/berry_animation_docs/EXAMPLES.md +++ b/lib/libesp32/berry_animation/berry_animation_docs/EXAMPLES.md @@ -54,7 +54,7 @@ palette fire_colors = [ (255, 0xFFFF00) # Yellow ] -animation fire_effect = palette_animation(palette=fire_colors, period=2s, intensity=255) +animation fire_effect = palette_animation(colors=fire_colors, period=2s, intensity=255) run fire_effect ``` @@ -131,7 +131,7 @@ set cosine_val = cosine_osc(min_value=0, max_value=27, duration=5s) # Create color cycle palette eye_palette = [red, yellow, green, violet] -color eye_color = color_cycle(palette=eye_palette, cycle_period=0) +color eye_color = color_cycle(colors=eye_palette, period=0) # Create beacon animation animation red_eye = beacon_animation( @@ -290,7 +290,7 @@ run nested_pattern set triangle_pos = triangle(min_value=0, max_value=29, period=3s) set cosine_pos = cosine_osc(min_value=0, max_value=29, period=3s) -color eye_color = color_cycle(palette=[red, yellow, green, blue], cycle_period=0) +color eye_color = color_cycle(colors=[red, yellow, green, blue], period=0) animation moving_eye = beacon_animation( color=eye_color pos=triangle_pos @@ -445,15 +445,15 @@ template breathing_rainbow { param base_brightness # Create rainbow palette - palette rainbow = [ + colors rainbow = [ (0, red), (42, orange), (85, yellow) (128, green), (170, blue), (213, purple), (255, red) ] # Create cycling rainbow color color rainbow_cycle = color_cycle( - palette=rainbow - cycle_period=cycle_time + colors=rainbow + period=cycle_time ) # Create breathing animation with rainbow colors diff --git a/lib/libesp32/berry_animation/berry_animation_docs/QUICK_START.md b/lib/libesp32/berry_animation/berry_animation_docs/QUICK_START.md index de38dcf89..5e3d37c1e 100644 --- a/lib/libesp32/berry_animation/berry_animation_docs/QUICK_START.md +++ b/lib/libesp32/berry_animation/berry_animation_docs/QUICK_START.md @@ -29,8 +29,8 @@ Create smooth color transitions: ```berry # Use predefined rainbow palette animation rainbow_cycle = rich_palette( - palette=PALETTE_RAINBOW - cycle_period=5s + colors=PALETTE_RAINBOW + period=5s transition_type=1 ) @@ -53,8 +53,8 @@ palette sunset = [ # Create palette animation animation sunset_glow = rich_palette( - palette=sunset - cycle_period=8s + colors=sunset + period=8s transition_type=1 ) @@ -138,8 +138,8 @@ run breathing ### Fire Effect ```berry animation fire = rich_palette( - palette=PALETTE_FIRE - cycle_period=2s + colors=PALETTE_FIRE + period=2s transition_type=1 ) @@ -170,7 +170,7 @@ template animation shutter_effect { param duration type time min 0 max 3600 default 5 nillable false set strip_len = strip_length() - color col = color_cycle(palette=colors, cycle_period=0) + color col = color_cycle(colors=colors, period=0) animation shutter = beacon_animation( color = col diff --git a/lib/libesp32/berry_animation/berry_animation_docs/TRANSPILER_ARCHITECTURE.md b/lib/libesp32/berry_animation/berry_animation_docs/TRANSPILER_ARCHITECTURE.md index 5c4797f85..7ca28eed2 100644 --- a/lib/libesp32/berry_animation/berry_animation_docs/TRANSPILER_ARCHITECTURE.md +++ b/lib/libesp32/berry_animation/berry_animation_docs/TRANSPILER_ARCHITECTURE.md @@ -346,7 +346,7 @@ _detect_and_cache_symbol(name) **Palette Detection:** ```berry -# DSL: animation rainbow = rich_palette_animation(palette=PALETTE_RAINBOW) +# DSL: animation rainbow = rich_palette_animation(colors=PALETTE_RAINBOW) # Detection: PALETTE_RAINBOW exists in animation module, isinstance(obj, bytes) # Result: SymbolEntry("PALETTE_RAINBOW", "palette", bytes_instance, true) # Reference: "animation.PALETTE_RAINBOW" diff --git a/lib/libesp32/berry_animation/berry_animation_docs/USER_FUNCTIONS.md b/lib/libesp32/berry_animation/berry_animation_docs/USER_FUNCTIONS.md index 5a0e9ecea..63e60e641 100644 --- a/lib/libesp32/berry_animation/berry_animation_docs/USER_FUNCTIONS.md +++ b/lib/libesp32/berry_animation/berry_animation_docs/USER_FUNCTIONS.md @@ -164,8 +164,8 @@ dim_blue.opacity = bright(30) ```berry def custom_fire(engine, intensity, speed) var color_provider = animation.rich_palette(engine) - color_provider.palette = animation.PALETTE_FIRE - color_provider.cycle_period = speed + color_provider.colors = animation.PALETTE_FIRE + color_provider.period = speed var fire_anim = animation.filled(engine) fire_anim.color_provider = color_provider @@ -237,8 +237,8 @@ right_pulse.position = pulse_at(25, 3, 2000) def rainbow_twinkle(engine, base_speed, twinkle_density) # Create base rainbow animation var rainbow_provider = animation.rich_palette(engine) - rainbow_provider.palette = animation.PALETTE_RAINBOW - rainbow_provider.cycle_period = base_speed + rainbow_provider.colors = animation.PALETTE_RAINBOW + rainbow_provider.period = base_speed var base_anim = animation.filled(engine) base_anim.color_provider = rainbow_provider @@ -289,10 +289,10 @@ animation.register_user_function("custom_palette", create_custom_palette) ``` ```berry -# Use dynamic palette in DSL +# Use dynamic colors in DSL animation gradient_effect = rich_palette( - palette=custom_palette(0xFF6B35, 5, 255) - cycle_period=4s + colors=custom_palette(0xFF6B35, 5, 255) + period=4s ) run gradient_effect diff --git a/lib/libesp32/berry_animation/src/animations/fire.be b/lib/libesp32/berry_animation/src/animations/fire.be index 5bcc0d08a..005dc7255 100644 --- a/lib/libesp32/berry_animation/src/animations/fire.be +++ b/lib/libesp32/berry_animation/src/animations/fire.be @@ -184,7 +184,7 @@ class FireAnimation : animation.animation # Create default fire palette on demand var fire_provider = animation.rich_palette(self.engine) fire_provider.colors = animation.PALETTE_FIRE - fire_provider.cycle_period = 0 # Use value-based color mapping, not time-based + fire_provider.period = 0 # Use value-based color mapping, not time-based fire_provider.transition_type = 1 # Use sine transition (smooth) fire_provider.brightness = 255 resolved_color = fire_provider diff --git a/lib/libesp32/berry_animation/src/animations/noise.be b/lib/libesp32/berry_animation/src/animations/noise.be index 74cfedc49..d0310efb4 100644 --- a/lib/libesp32/berry_animation/src/animations/noise.be +++ b/lib/libesp32/berry_animation/src/animations/noise.be @@ -47,7 +47,7 @@ class NoiseAnimation : animation.animation if self.color == nil var rainbow_provider = animation.rich_palette(engine) rainbow_provider.colors = animation.PALETTE_RAINBOW - rainbow_provider.cycle_period = 5000 + rainbow_provider.period = 5000 rainbow_provider.transition_type = 1 rainbow_provider.brightness = 255 self.color = rainbow_provider @@ -100,7 +100,7 @@ class NoiseAnimation : animation.animation var gradient_provider = animation.rich_palette(self.engine) gradient_provider.colors = palette - gradient_provider.cycle_period = 5000 + gradient_provider.period = 5000 gradient_provider.transition_type = 1 gradient_provider.brightness = 255 @@ -261,7 +261,7 @@ def noise_rainbow(engine) # Set up rainbow color provider var rainbow_provider = animation.rich_palette(engine) rainbow_provider.colors = animation.PALETTE_RAINBOW - rainbow_provider.cycle_period = 5000 + rainbow_provider.period = 5000 rainbow_provider.transition_type = 1 rainbow_provider.brightness = 255 anim.color = rainbow_provider @@ -288,7 +288,7 @@ def noise_fractal(engine) # Set up rainbow color provider var rainbow_provider = animation.rich_palette(engine) rainbow_provider.colors = animation.PALETTE_RAINBOW - rainbow_provider.cycle_period = 5000 + rainbow_provider.period = 5000 rainbow_provider.transition_type = 1 rainbow_provider.brightness = 255 anim.color = rainbow_provider diff --git a/lib/libesp32/berry_animation/src/animations/rich_palette_animation.be b/lib/libesp32/berry_animation/src/animations/rich_palette_animation.be index 6ce82c702..dbdedd6b4 100644 --- a/lib/libesp32/berry_animation/src/animations/rich_palette_animation.be +++ b/lib/libesp32/berry_animation/src/animations/rich_palette_animation.be @@ -18,7 +18,7 @@ class RichPaletteAnimation : animation.animation static var PARAMS = animation.enc_params({ # RichPaletteColorProvider parameters (forwarded to internal provider) "colors": {"type": "instance", "default": nil}, - "cycle_period": {"min": 0, "default": 5000}, + "period": {"min": 0, "default": 5000}, "transition_type": {"enum": [animation.LINEAR, animation.SINE], "default": animation.SINE}, "brightness": {"min": 0, "max": 255, "default": 255} }) @@ -44,7 +44,7 @@ class RichPaletteAnimation : animation.animation def on_param_changed(name, value) super(self).on_param_changed(name, value) # Forward rich palette parameters to internal color provider - if name == "colors" || name == "cycle_period" || name == "transition_type" || + if name == "colors" || name == "period" || name == "transition_type" || name == "brightness" # Set parameter on internal color provider self.color_provider.set_param(name, value) diff --git a/lib/libesp32/berry_animation/src/animations/wave.be b/lib/libesp32/berry_animation/src/animations/wave.be index a0ac74a5b..2568f4858 100644 --- a/lib/libesp32/berry_animation/src/animations/wave.be +++ b/lib/libesp32/berry_animation/src/animations/wave.be @@ -234,7 +234,7 @@ def wave_rainbow_sine(engine) # Set up rainbow color provider var rainbow_provider = animation.rich_palette(engine) rainbow_provider.colors = animation.PALETTE_RAINBOW - rainbow_provider.cycle_period = 5000 + rainbow_provider.period = 5000 rainbow_provider.transition_type = 1 # sine transition rainbow_provider.brightness = 255 anim.color = rainbow_provider diff --git a/lib/libesp32/berry_animation/src/animations_future/plasma.be b/lib/libesp32/berry_animation/src/animations_future/plasma.be index f46eaf219..4637b28e0 100644 --- a/lib/libesp32/berry_animation/src/animations_future/plasma.be +++ b/lib/libesp32/berry_animation/src/animations_future/plasma.be @@ -71,7 +71,7 @@ class PlasmaAnimation : animation.animation if self.color == nil var rainbow_provider = animation.rich_palette(self.engine) rainbow_provider.colors = animation.PALETTE_RAINBOW - rainbow_provider.cycle_period = 5000 + rainbow_provider.period = 5000 rainbow_provider.transition_type = 1 rainbow_provider.brightness = 255 self.color = rainbow_provider @@ -90,7 +90,7 @@ class PlasmaAnimation : animation.animation # Reset to default rainbow palette when color is set to nil var rainbow_provider = animation.rich_palette(self.engine) rainbow_provider.colors = animation.PALETTE_RAINBOW - rainbow_provider.cycle_period = 5000 + rainbow_provider.period = 5000 rainbow_provider.transition_type = 1 rainbow_provider.brightness = 255 # Set the parameter directly to avoid recursion diff --git a/lib/libesp32/berry_animation/src/animations_future/sparkle.be b/lib/libesp32/berry_animation/src/animations_future/sparkle.be index 85c8d09ba..eb8bb8a0a 100644 --- a/lib/libesp32/berry_animation/src/animations_future/sparkle.be +++ b/lib/libesp32/berry_animation/src/animations_future/sparkle.be @@ -238,7 +238,7 @@ end def sparkle_rainbow(engine) var rainbow_provider = animation.rich_palette(engine) rainbow_provider.colors = animation.PALETTE_RAINBOW - rainbow_provider.cycle_period = 5000 + rainbow_provider.period = 5000 rainbow_provider.transition_type = 1 # sine transition var anim = animation.sparkle_animation(engine) diff --git a/lib/libesp32/berry_animation/src/providers/color_cycle_color_provider.be b/lib/libesp32/berry_animation/src/providers/color_cycle_color_provider.be index 3d9e29935..ef3bd073a 100644 --- a/lib/libesp32/berry_animation/src/providers/color_cycle_color_provider.be +++ b/lib/libesp32/berry_animation/src/providers/color_cycle_color_provider.be @@ -4,8 +4,8 @@ # No transitions or interpolation - just instant color changes. # # Modes: -# - Auto-cycle: cycle_period > 0 - colors change automatically at regular intervals -# - Manual-only: cycle_period = 0 - colors only change when 'next' parameter is set to 1 +# - Auto-cycle: period > 0 - colors change automatically at regular intervals +# - Manual-only: period = 0 - colors only change when 'next' parameter is set to 1 # # Follows the parameterized class specification: # - Constructor takes only 'engine' parameter @@ -21,7 +21,7 @@ class ColorCycleColorProvider : animation.color_provider # Parameter definitions static var PARAMS = animation.enc_params({ "colors": {"type": "bytes", "default":nil}, - "cycle_period": {"min": 0, "default": 5000}, # 0 = manual only, >0 = auto cycle time in ms + "period": {"min": 0, "default": 5000}, # 0 = manual only, >0 = auto cycle time in ms "next": {"default": 0}, # Write `` to move to next colors "palette_size": {"type": "int", "default": 3} # Read-only: number of colors in palette }) @@ -127,12 +127,12 @@ class ColorCycleColorProvider : animation.color_provider # @return int - Color in ARGB format (0xAARRGGBB) def produce_value(name, time_ms) # Get parameter values using virtual member access - var cycle_period = self.cycle_period + var period = self.period # Get the number of colors in the palette var palette_size = self._get_palette_size() - if (palette_size <= 1) || (cycle_period == 0) # no cycling stop here + if (palette_size <= 1) || (period == 0) # no cycling stop here var idx = self.current_index if (idx >= palette_size) idx = palette_size - 1 end if (idx < 0) idx = 0 end @@ -148,8 +148,8 @@ class ColorCycleColorProvider : animation.color_provider end # Auto-cycle mode: calculate which color to show based on time (brutal switching using integer math) - var time_in_cycle = time_ms % cycle_period - var color_index = tasmota.scale_uint(time_in_cycle, 0, cycle_period - 1, 0, palette_size - 1) + var time_in_cycle = time_ms % period + var color_index = tasmota.scale_uint(time_in_cycle, 0, period - 1, 0, palette_size - 1) # Clamp to valid range (safety check) if color_index >= palette_size @@ -217,7 +217,7 @@ class ColorCycleColorProvider : animation.color_provider # String representation of the provider def tostring() - return f"ColorCycleColorProvider(palette_size={self._get_palette_size()}, cycle_period={self.cycle_period}, mode={self.cycle_period ? 'manual' :: 'auto'}, current_index={self.current_index})" + return f"ColorCycleColorProvider(palette_size={self._get_palette_size()}, period={self.period}, mode={self.period ? 'manual' :: 'auto'}, current_index={self.current_index})" end end diff --git a/lib/libesp32/berry_animation/src/providers/rich_palette_color_provider.be b/lib/libesp32/berry_animation/src/providers/rich_palette_color_provider.be index 33efd1cc2..0f5e702b2 100644 --- a/lib/libesp32/berry_animation/src/providers/rich_palette_color_provider.be +++ b/lib/libesp32/berry_animation/src/providers/rich_palette_color_provider.be @@ -33,7 +33,7 @@ import "./core/param_encoder" as encode_constraints #@ solidify:RichPaletteColorProvider,weak class RichPaletteColorProvider : animation.color_provider # Non-parameter instance variables only - var _slots_arr # Constructed array of timestamp slots, based on cycle_period + var _slots_arr # Constructed array of timestamp slots, based on period var _value_arr # Constructed array of value slots (always 0-255 range) var _slots # Number of slots in the palette var _current_color # Current interpolated color (calculated during update) @@ -43,7 +43,7 @@ class RichPaletteColorProvider : animation.color_provider # Parameter definitions static var PARAMS = animation.enc_params({ "colors": {"type": "bytes", "default": nil}, # Palette bytes or predefined palette constant - "cycle_period": {"min": 0, "default": 5000}, # 5 seconds default, 0 = value-based only + "period": {"min": 0, "default": 5000}, # 5 seconds default, 0 = value-based only "transition_type": {"enum": [animation.LINEAR, animation.SINE], "default": animation.LINEAR} # brightness parameter inherited from ColorProvider base class }) @@ -75,7 +75,7 @@ class RichPaletteColorProvider : animation.color_provider # @param value: any - New value of the parameter def on_param_changed(name, value) super(self).on_param_changed(name, value) - if name == "cycle_period" || name == "colors" + if name == "period" || name == "colors" if (self._slots_arr != nil) || (self._value_arr != nil) # only if they were already computed self._recompute_palette() @@ -120,14 +120,14 @@ class RichPaletteColorProvider : animation.color_provider # Recompute palette slots and metadata def _recompute_palette() - # Compute slots_arr based on 'cycle_period' - var cycle_period = self.cycle_period + # Compute slots_arr based on 'period' + var period = self.period var palette_bytes = self._get_palette_bytes() self._slots = size(palette_bytes) / 4 # Recompute palette with new cycle period (only if > 0 for time-based cycling) - if cycle_period > 0 && palette_bytes != nil - self._slots_arr = self._parse_palette(0, cycle_period - 1) + if period > 0 && palette_bytes != nil + self._slots_arr = self._parse_palette(0, period - 1) else self._slots_arr = nil end @@ -271,11 +271,11 @@ class RichPaletteColorProvider : animation.color_provider end # Get parameter values using virtual member access - var cycle_period = self.cycle_period + var period = self.period var brightness = self.brightness - # If cycle_period is 0, return static color (first color in palette) - if cycle_period == 0 + # If period is 0, return static color (first color in palette) + if period == 0 var bgrt0 = palette_bytes.get(0, 4) var r = (bgrt0 >> 8) & 0xFF var g = (bgrt0 >> 16) & 0xFF @@ -295,7 +295,7 @@ class RichPaletteColorProvider : animation.color_provider # Calculate position in cycle using start_time var elapsed = time_ms - self.start_time - var past = elapsed % cycle_period + var past = elapsed % period # Find slot (exact algorithm from Animate_palette) var slots = self._slots @@ -520,7 +520,7 @@ class RichPaletteColorProvider : animation.color_provider # String representation def tostring() try - return f"RichPaletteColorProvider(slots={self._slots}, cycle_period={self.cycle_period})" + return f"RichPaletteColorProvider(slots={self._slots}, period={self.period})" except .. return "RichPaletteColorProvider(uninitialized)" end diff --git a/lib/libesp32/berry_animation/src/solidify/solidified_animation.h b/lib/libesp32/berry_animation/src/solidify/solidified_animation.h index 985e8db83..6dd31c593 100644 --- a/lib/libesp32/berry_animation/src/solidify/solidified_animation.h +++ b/lib/libesp32/berry_animation/src/solidify/solidified_animation.h @@ -315,7 +315,7 @@ static const bvalue be_ktab_class_RichPaletteAnimation[13] = { /* K6 */ be_nested_str_weak(start), /* K7 */ be_nested_str_weak(on_param_changed), /* K8 */ be_nested_str_weak(colors), - /* K9 */ be_nested_str_weak(cycle_period), + /* K9 */ be_nested_str_weak(period), /* K10 */ be_nested_str_weak(transition_type), /* K11 */ be_nested_str_weak(brightness), /* K12 */ be_nested_str_weak(set_param), @@ -463,10 +463,10 @@ be_local_class(RichPaletteAnimation, { be_const_key_weak(PARAMS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(4, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(transition_type, -1), be_const_bytes_instance(1400050200010005) }, + { be_const_key_weak(period, -1), be_const_bytes_instance(050000018813) }, { be_const_key_weak(colors, -1), be_const_bytes_instance(0C0605) }, { be_const_key_weak(brightness, -1), be_const_bytes_instance(07000001FF0001FF00) }, - { be_const_key_weak(cycle_period, 0), be_const_bytes_instance(050000018813) }, + { be_const_key_weak(transition_type, -1), be_const_bytes_instance(1400050200010005) }, })) ) } )) }, { be_const_key_weak(color_provider, -1), be_const_var(0) }, })), @@ -526,7 +526,7 @@ be_local_closure(noise_rainbow, /* name */ /* K2 */ be_nested_str_weak(rich_palette), /* K3 */ be_nested_str_weak(colors), /* K4 */ be_nested_str_weak(PALETTE_RAINBOW), - /* K5 */ be_nested_str_weak(cycle_period), + /* K5 */ be_nested_str_weak(period), /* K6 */ be_nested_str_weak(transition_type), /* K7 */ be_const_int(1), /* K8 */ be_nested_str_weak(brightness), @@ -1768,7 +1768,7 @@ static const bvalue be_ktab_class_FireAnimation[47] = { /* K38 */ be_nested_str_weak(rich_palette), /* K39 */ be_nested_str_weak(colors), /* K40 */ be_nested_str_weak(PALETTE_FIRE), - /* K41 */ be_nested_str_weak(cycle_period), + /* K41 */ be_nested_str_weak(period), /* K42 */ be_nested_str_weak(transition_type), /* K43 */ be_nested_str_weak(brightness), /* K44 */ be_nested_str_weak(is_color_provider), @@ -2401,8 +2401,8 @@ static const bvalue be_ktab_class_RichPaletteColorProvider[58] = { /* K26 */ be_nested_str_weak(_X2C_X23_X2502X_X2502X_X2502X_X20_X25_X2E1f_X25_X25), /* K27 */ be_const_real_hex(0x41200000), /* K28 */ be_nested_str_weak(_X29_X3B), - /* K29 */ be_nested_str_weak(RichPaletteColorProvider_X28slots_X3D_X25s_X2C_X20cycle_period_X3D_X25s_X29), - /* K30 */ be_nested_str_weak(cycle_period), + /* K29 */ be_nested_str_weak(RichPaletteColorProvider_X28slots_X3D_X25s_X2C_X20period_X3D_X25s_X29), + /* K30 */ be_nested_str_weak(period), /* K31 */ be_nested_str_weak(RichPaletteColorProvider_X28uninitialized_X29), /* K32 */ be_nested_str_weak(_current_color), /* K33 */ be_nested_str_weak(_get_color_at_index), @@ -3596,7 +3596,7 @@ be_local_class(RichPaletteColorProvider, { be_const_key_weak(PARAMS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(3, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(cycle_period, 1), be_const_bytes_instance(050000018813) }, + { be_const_key_weak(period, 1), be_const_bytes_instance(050000018813) }, { be_const_key_weak(transition_type, -1), be_const_bytes_instance(1400010200010005) }, { be_const_key_weak(colors, -1), be_const_bytes_instance(0C0602) }, })) ) } )) }, @@ -3722,7 +3722,7 @@ be_local_closure(unregister_event_handler, /* name */ // compact class 'ColorCycleColorProvider' ktab size: 27, total: 54 (saved 216 bytes) static const bvalue be_ktab_class_ColorCycleColorProvider[27] = { - /* K0 */ be_nested_str_weak(cycle_period), + /* K0 */ be_nested_str_weak(period), /* K1 */ be_nested_str_weak(_get_palette_size), /* K2 */ be_const_int(1), /* K3 */ be_const_int(0), @@ -3732,7 +3732,7 @@ static const bvalue be_ktab_class_ColorCycleColorProvider[27] = { /* K7 */ be_nested_str_weak(apply_brightness), /* K8 */ be_nested_str_weak(tasmota), /* K9 */ be_nested_str_weak(scale_uint), - /* K10 */ be_nested_str_weak(ColorCycleColorProvider_X28palette_size_X3D_X25s_X2C_X20cycle_period_X3D_X25s_X2C_X20mode_X3D_X25s_X2C_X20current_index_X3D_X25s_X29), + /* K10 */ be_nested_str_weak(ColorCycleColorProvider_X28palette_size_X3D_X25s_X2C_X20period_X3D_X25s_X2C_X20mode_X3D_X25s_X2C_X20current_index_X3D_X25s_X29), /* K11 */ be_nested_str_weak(manual), /* K12 */ be_nested_str_weak(auto), /* K13 */ be_nested_str_weak(colors), @@ -4205,10 +4205,10 @@ be_local_class(ColorCycleColorProvider, { be_const_key_weak(PARAMS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(4, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(next, 2), be_const_bytes_instance(040000) }, + { be_const_key_weak(period, 2), be_const_bytes_instance(050000018813) }, { be_const_key_weak(colors, -1), be_const_bytes_instance(0C0602) }, - { be_const_key_weak(palette_size, -1), be_const_bytes_instance(0C000300) }, - { be_const_key_weak(cycle_period, -1), be_const_bytes_instance(050000018813) }, + { be_const_key_weak(palette_size, 3), be_const_bytes_instance(0C000300) }, + { be_const_key_weak(next, -1), be_const_bytes_instance(040000) }, })) ) } )) }, { be_const_key_weak(init, -1), be_const_closure(class_ColorCycleColorProvider_init_closure) }, { be_const_key_weak(produce_value, 0), be_const_closure(class_ColorCycleColorProvider_produce_value_closure) }, @@ -7843,7 +7843,7 @@ static const bvalue be_ktab_class_NoiseAnimation[49] = { /* K12 */ be_nested_str_weak(rich_palette), /* K13 */ be_nested_str_weak(colors), /* K14 */ be_nested_str_weak(PALETTE_RAINBOW), - /* K15 */ be_nested_str_weak(cycle_period), + /* K15 */ be_nested_str_weak(period), /* K16 */ be_nested_str_weak(transition_type), /* K17 */ be_nested_str_weak(brightness), /* K18 */ be_nested_str_weak(int), @@ -10610,7 +10610,7 @@ be_local_closure(wave_rainbow_sine, /* name */ /* K2 */ be_nested_str_weak(rich_palette), /* K3 */ be_nested_str_weak(colors), /* K4 */ be_nested_str_weak(PALETTE_RAINBOW), - /* K5 */ be_nested_str_weak(cycle_period), + /* K5 */ be_nested_str_weak(period), /* K6 */ be_nested_str_weak(transition_type), /* K7 */ be_const_int(1), /* K8 */ be_nested_str_weak(brightness), @@ -17956,7 +17956,7 @@ be_local_closure(noise_fractal, /* name */ /* K2 */ be_nested_str_weak(rich_palette), /* K3 */ be_nested_str_weak(colors), /* K4 */ be_nested_str_weak(PALETTE_RAINBOW), - /* K5 */ be_nested_str_weak(cycle_period), + /* K5 */ be_nested_str_weak(period), /* K6 */ be_nested_str_weak(transition_type), /* K7 */ be_const_int(1), /* K8 */ be_nested_str_weak(brightness), diff --git a/lib/libesp32/berry_animation/src/tests/color_cycle_animation_test.be b/lib/libesp32/berry_animation/src/tests/color_cycle_animation_test.be index 0fdb624c8..d1d412eee 100644 --- a/lib/libesp32/berry_animation/src/tests/color_cycle_animation_test.be +++ b/lib/libesp32/berry_animation/src/tests/color_cycle_animation_test.be @@ -71,7 +71,7 @@ class ColorCycleAnimationTest var custom_palette = bytes("FFFF0000FF00FF00") # Red and Green in AARRGGBB format var custom_provider = animation.color_cycle(engine) custom_provider.colors = custom_palette - custom_provider.cycle_period = 2000 + custom_provider.period = 2000 var anim2 = animation.solid(engine) anim2.color = custom_provider @@ -87,7 +87,7 @@ class ColorCycleAnimationTest # Check provider properties self.assert_equal(color_provider2._get_palette_size(), 2, "Custom colors has 2 colors") - self.assert_equal(color_provider2.cycle_period, 2000, "Custom cycle period is 2000ms") + self.assert_equal(color_provider2.period, 2000, "Custom cycle period is 2000ms") end def test_update_and_render() @@ -95,7 +95,7 @@ class ColorCycleAnimationTest var colors = bytes("FFFF0000FF0000FF") # Red and Blue in AARRGGBB format var provider = animation.color_cycle(engine) provider.colors = colors - provider.cycle_period = 1000 # 1 second cycle + provider.period = 1000 # 1 second cycle var anim = animation.solid(engine) anim.color = provider @@ -138,12 +138,12 @@ class ColorCycleAnimationTest end def test_manual_only_mode() - print("Testing manual-only mode (cycle_period = 0)...") + print("Testing manual-only mode (period = 0)...") # Create animation with manual-only color provider var manual_provider = animation.color_cycle(engine) manual_provider.colors = bytes("FF0000FFFF00FF00FFFF0000") # Blue, Green, Red in AARRGGBB format - manual_provider.cycle_period = 0 # Manual-only mode + manual_provider.period = 0 # Manual-only mode var manual_anim = animation.solid(engine) manual_anim.color = manual_provider @@ -192,7 +192,7 @@ class ColorCycleAnimationTest # Test direct creation without factory method (following new parameterized pattern) var provider = animation.color_cycle(engine) provider.colors = bytes("FF0000FFFF00FF00FFFF0000") # Blue, Green, Red in AARRGGBB format - provider.cycle_period = 3000 # 3 second cycle period + provider.period = 3000 # 3 second cycle period var anim = animation.solid(engine) anim.color = provider @@ -209,7 +209,7 @@ class ColorCycleAnimationTest # Check provider properties self.assert_equal(color_provider3._get_palette_size(), 3, "Palette has 3 colors") - self.assert_equal(color_provider3.cycle_period, 3000, "Cycle period is 3000ms") + self.assert_equal(color_provider3.period, 3000, "Cycle period is 3000ms") # Check animation properties self.assert_equal(anim.priority, 10, "Priority is 10") diff --git a/lib/libesp32/berry_animation/src/tests/color_cycle_bytes_test.be b/lib/libesp32/berry_animation/src/tests/color_cycle_bytes_test.be index 60af4b510..d402225c2 100644 --- a/lib/libesp32/berry_animation/src/tests/color_cycle_bytes_test.be +++ b/lib/libesp32/berry_animation/src/tests/color_cycle_bytes_test.be @@ -54,7 +54,7 @@ def test_color_cycle_bytes_format() assert(custom_color3 == 0xFFFFFF00, f"Custom color 3 should be 0xFFFFFF00 (alpha forced), got 0x{custom_color3:08X}") # Test 6: Test auto-cycle mode - provider.cycle_period = 4000 # 4 seconds for 4 colors = 1 second per color + provider.period = 4000 # 4 seconds for 4 colors = 1 second per color # At time 0, should be first color engine.time_ms = 0 @@ -74,7 +74,7 @@ def test_color_cycle_bytes_format() assert(cycle_color3 == custom_color3, f"Cycle color at t=3000 should match fourth color") # Test 7: Test manual mode - provider.cycle_period = 0 # Manual mode + provider.period = 0 # Manual mode provider.current_index = 1 var manual_color = provider.produce_value("color", 5000) diff --git a/lib/libesp32/berry_animation/src/tests/crenel_position_color_test.be b/lib/libesp32/berry_animation/src/tests/crenel_position_color_test.be index 8417da10b..6093c209d 100644 --- a/lib/libesp32/berry_animation/src/tests/crenel_position_color_test.be +++ b/lib/libesp32/berry_animation/src/tests/crenel_position_color_test.be @@ -99,7 +99,7 @@ def test_crenel_with_dynamic_color_provider() # Create a palette color provider that changes over time var palette_provider = animation.color_cycle(engine) palette_provider.colors = bytes("FF0000FFFF00FF00FFFF0000FFFFFF00") # BGRY palette in AARRGGBB format - palette_provider.cycle_period = 2000 # 2 second cycle + palette_provider.period = 2000 # 2 second cycle # Create animation with new parameterized pattern var crenel = animation.crenel_animation(engine) diff --git a/lib/libesp32/berry_animation/src/tests/demo_shutter_infinite_loop_test.be b/lib/libesp32/berry_animation/src/tests/demo_shutter_infinite_loop_test.be index ebe4419a2..f7a90d93f 100644 --- a/lib/libesp32/berry_animation/src/tests/demo_shutter_infinite_loop_test.be +++ b/lib/libesp32/berry_animation/src/tests/demo_shutter_infinite_loop_test.be @@ -17,7 +17,7 @@ def test_demo_shutter_patterns() " param colors type palette\n" + " param duration\n" + " \n" + - " color col1 = color_cycle(palette=colors, cycle_period=0)\n" + + " color col1 = color_cycle(palette=colors, period=0)\n" + " animation test_anim = solid(color=col1)\n" + " \n" + " sequence shutter_seq repeat forever {\n" + @@ -44,7 +44,7 @@ def test_demo_shutter_patterns() # Test 2: The col1.next = 1 pattern print(" Testing color.next assignment...") - var color_next = "color col1 = color_cycle(palette=[red, green], cycle_period=0)\n" + + var color_next = "color col1 = color_cycle(palette=[red, green], period=0)\n" + "col1.next = 1\n" + "animation test_anim = solid(color=col1)\n" + "run test_anim" @@ -87,7 +87,7 @@ def test_demo_shutter_patterns() " set strip_len2 = (strip_len + 1) / 2\n" + " set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = duration)\n" + " \n" + - " color col1 = color_cycle(palette=colors, cycle_period=0)\n" + + " color col1 = color_cycle(palette=colors, period=0)\n" + " \n" + " animation shutter_anim = beacon_animation(\n" + " color = col1\n" + @@ -123,8 +123,8 @@ def test_demo_shutter_patterns() " set strip_len2 = (strip_len + 1) / 2\n" + " set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = duration)\n" + " \n" + - " color col1 = color_cycle(palette=colors, cycle_period=0)\n" + - " color col2 = color_cycle(palette=colors, cycle_period=0)\n" + + " color col1 = color_cycle(palette=colors, period=0)\n" + + " color col2 = color_cycle(palette=colors, period=0)\n" + " col2.next = 1\n" + " \n" + " animation shutter_inout = beacon_animation(\n" + diff --git a/lib/libesp32/berry_animation/src/tests/dsl_newline_syntax_test.be b/lib/libesp32/berry_animation/src/tests/dsl_newline_syntax_test.be index c9320f750..87d0db6b2 100644 --- a/lib/libesp32/berry_animation/src/tests/dsl_newline_syntax_test.be +++ b/lib/libesp32/berry_animation/src/tests/dsl_newline_syntax_test.be @@ -47,7 +47,7 @@ def test_palette_newline_entries() " (192, 0x00AA00)\n" + " (255, 0x00FF00)\n" + "]\n" + - "color stream_color = rich_palette(colors=matrix_greens, cycle_period=2s)\n" + + "color stream_color = rich_palette(colors=matrix_greens, period=2s)\n" + "animation stream = solid(color=stream_color)\n" + "run stream" @@ -113,7 +113,7 @@ def test_color_provider_newline_syntax() "palette test_palette = [(0, 0x000000), (255, 0xFFFFFF)]\n" + "color dynamic_color = rich_palette(\n" + " colors=test_palette\n" + - " cycle_period=2s\n" + + " period=2s\n" + " transition_type=LINEAR\n" + " brightness=255\n" + ")\n" + @@ -125,7 +125,7 @@ def test_color_provider_newline_syntax() assert(berry_code != nil, "Should compile color provider with newline syntax") assert(string.find(berry_code, "var dynamic_color_ = animation.rich_palette(engine)") >= 0, "Should generate color provider creation") assert(string.find(berry_code, "dynamic_color_.colors = test_palette_") >= 0, "Should generate palette assignment") - assert(string.find(berry_code, "dynamic_color_.cycle_period = 2000") >= 0, "Should generate cycle_period assignment") + assert(string.find(berry_code, "dynamic_color_.period = 2000") >= 0, "Should generate period assignment") print("✓ Color provider newline syntax test passed") return true @@ -174,7 +174,7 @@ def test_complex_example() "\n" + "color stream_pattern = rich_palette(\n" + " colors=matrix_greens\n" + - " cycle_period=2s\n" + + " period=2s\n" + " transition_type=LINEAR\n" + " brightness=255\n" + ")\n" + diff --git a/lib/libesp32/berry_animation/src/tests/dsl_restart_test.be b/lib/libesp32/berry_animation/src/tests/dsl_restart_test.be index 7d7421ea8..46c088375 100644 --- a/lib/libesp32/berry_animation/src/tests/dsl_restart_test.be +++ b/lib/libesp32/berry_animation/src/tests/dsl_restart_test.be @@ -253,7 +253,7 @@ def test_complex_scenario() var dsl_source = "# Complex cylon eye with restart functionality\n" + "set strip_len = strip_length()\n" + "palette eye_palette = [ red, yellow, green, violet ]\n" + - "color eye_color = color_cycle(colors=eye_palette, cycle_period=0)\n" + + "color eye_color = color_cycle(colors=eye_palette, period=0)\n" + "set cosine_val = cosine_osc(min_value = 0, max_value = strip_len - 2, duration = 5s)\n" + "set triangle_val = triangle(min_value = 0, max_value = strip_len - 2, duration = 5s)\n" + "\n" + diff --git a/lib/libesp32/berry_animation/src/tests/dsl_template_animation_test.be b/lib/libesp32/berry_animation/src/tests/dsl_template_animation_test.be index 43c30c855..1c38401de 100644 --- a/lib/libesp32/berry_animation/src/tests/dsl_template_animation_test.be +++ b/lib/libesp32/berry_animation/src/tests/dsl_template_animation_test.be @@ -116,7 +116,7 @@ class DSLTemplateAnimationTest " param my_color type palette\n" + " param my_duration type time\n" + " \n" + - " color col = color_cycle(colors=my_color, cycle_period=0)\n" + + " color col = color_cycle(colors=my_color, period=0)\n" + " animation test = pulsating_animation(color=col, period=my_duration)\n" + " run test\n" + "}\n" @@ -170,7 +170,7 @@ class DSLTemplateAnimationTest " param colors type palette\n" + " param duration type time\n" + " \n" + - " color col = color_cycle(colors=colors, cycle_period=0)\n" + + " color col = color_cycle(colors=colors, period=0)\n" + " animation anim = solid(color=col)\n" + " \n" + " sequence seq repeat forever {\n" + @@ -231,7 +231,7 @@ class DSLTemplateAnimationTest " param duration type time min 1 max 10 default 5\n" + " param intensity type number min 0 max 255 default 200\n" + " \n" + - " color col = color_cycle(colors=colors, cycle_period=0)\n" + + " color col = color_cycle(colors=colors, period=0)\n" + " animation test = solid(color=col)\n" + " test.opacity = intensity\n" + " run test\n" + @@ -294,7 +294,7 @@ class DSLTemplateAnimationTest " param colors type palette\n" + " param duration type time\n" + " \n" + - " color col = color_cycle(colors=colors, cycle_period=0)\n" + + " color col = color_cycle(colors=colors, period=0)\n" + " animation test = solid(color=col)\n" + " \n" + " sequence seq repeat forever {\n" + @@ -474,7 +474,7 @@ class DSLTemplateAnimationTest " set strip_len = strip_length()\n" + " set shutter_size = sawtooth(min_value=0, max_value=strip_len, duration=duration)\n" + " \n" + - " color col = color_cycle(colors=colors, cycle_period=0)\n" + + " color col = color_cycle(colors=colors, period=0)\n" + " animation test = beacon_animation(color=col, beacon_size=shutter_size)\n" + " \n" + " sequence seq repeat forever {\n" + @@ -546,8 +546,8 @@ class DSLTemplateAnimationTest " set strip_len2 = (strip_len + 1) / 2\n" + " set shutter_size = sawtooth(min_value=0, max_value=strip_len, duration=duration)\n" + " \n" + - " color col1 = color_cycle(colors=colors, cycle_period=0)\n" + - " color col2 = color_cycle(colors=colors, cycle_period=0)\n" + + " color col1 = color_cycle(colors=colors, period=0)\n" + + " color col2 = color_cycle(colors=colors, period=0)\n" + " col2.next = 1\n" + " \n" + " animation shutter = beacon_animation(\n" + diff --git a/lib/libesp32/berry_animation/src/tests/dsl_transpiler_test.be b/lib/libesp32/berry_animation/src/tests/dsl_transpiler_test.be index ffcba7680..d43c294db 100644 --- a/lib/libesp32/berry_animation/src/tests/dsl_transpiler_test.be +++ b/lib/libesp32/berry_animation/src/tests/dsl_transpiler_test.be @@ -262,7 +262,7 @@ print(repeat_berry_code) # Test complex cylon rainbow example var cylon_dsl = "set strip_len = strip_length()\n" + "palette eye_palette = [ red, yellow, green, violet ]\n" + - "color eye_color = color_cycle(colors=eye_palette, cycle_period=0)\n" + + "color eye_color = color_cycle(colors=eye_palette, period=0)\n" + "set cosine_val = cosine_osc(min_value = 0, max_value = strip_len - 2, duration = 5s)\n" + "set triangle_val = triangle(min_value = 0, max_value = strip_len - 2, duration = 5s)\n" + "\n" + diff --git a/lib/libesp32/berry_animation/src/tests/dsl_value_provider_validation_test.be b/lib/libesp32/berry_animation/src/tests/dsl_value_provider_validation_test.be index 44df748a6..29b01254a 100644 --- a/lib/libesp32/berry_animation/src/tests/dsl_value_provider_validation_test.be +++ b/lib/libesp32/berry_animation/src/tests/dsl_value_provider_validation_test.be @@ -119,7 +119,7 @@ class DSLValueProviderValidationTest def test_nested_value_providers() var dsl_code = "# strip length 30 # TEMPORARILY DISABLED\n" - "animation test = pulsating_animation(color=color_cycle(colors=[0xFF0000FF, 0xFF00FF00], cycle_period=oscillator_value(min_value=1000, bad_param=456)))\n" + "animation test = pulsating_animation(color=color_cycle(colors=[0xFF0000FF, 0xFF00FF00], period=oscillator_value(min_value=1000, bad_param=456)))\n" "run test" var compilation_failed = false diff --git a/lib/libesp32/berry_animation/src/tests/filled_animation_test.be b/lib/libesp32/berry_animation/src/tests/filled_animation_test.be index 2e5cab58f..1011482b9 100644 --- a/lib/libesp32/berry_animation/src/tests/filled_animation_test.be +++ b/lib/libesp32/berry_animation/src/tests/filled_animation_test.be @@ -58,7 +58,7 @@ assert(pixel_color == 0xFF0000FF, f"Expected 0xFF0000FF, got {pixel_color:08X}") print("Test 2: animation.solid with a color cycle provider") var cycle_provider = animation.color_cycle(mock_engine) cycle_provider.colors = bytes("FF0000FFFF00FF00FFFF0000") # BGR colors in AARRGGBB format -cycle_provider.cycle_period = 1000 # 1 second cycle period +cycle_provider.period = 1000 # 1 second cycle period # Note: transition_type removed - now uses "brutal" color switching var cycle_anim = animation.solid(mock_engine) @@ -83,7 +83,7 @@ assert(result, "Render should return true") print("Test 3: animation.solid with a rich palette provider") var rich_provider = animation.rich_palette(mock_engine) rich_provider.colors = animation.PALETTE_RAINBOW # Use the rainbow palette -rich_provider.cycle_period = 1000 # 1 second cycle period +rich_provider.period = 1000 # 1 second cycle period # Note: transition_type removed - rich palette uses smooth transitions rich_provider.brightness = 255 # Full brightness @@ -109,7 +109,7 @@ assert(result, "Render should return true") print("Test 4: animation.solid with a composite provider") var rich_provider2 = animation.rich_palette(mock_engine) rich_provider2.colors = animation.PALETTE_RAINBOW -rich_provider2.cycle_period = 1000 +rich_provider2.period = 1000 # Note: transition_type removed rich_provider2.brightness = 255 diff --git a/lib/libesp32/berry_animation/src/tests/fire_animation_test.be b/lib/libesp32/berry_animation/src/tests/fire_animation_test.be index 3052a7283..bd815fcc6 100644 --- a/lib/libesp32/berry_animation/src/tests/fire_animation_test.be +++ b/lib/libesp32/berry_animation/src/tests/fire_animation_test.be @@ -112,7 +112,7 @@ print("Set to solid red color") # Set back to fire palette var fire_palette = animation.rich_palette(engine) fire_palette.colors = animation.PALETTE_FIRE -fire_palette.cycle_period = 5000 +fire_palette.period = 5000 fire_palette.transition_type = 1 # Use sine transition (smooth) fire_palette.brightness = 255 fire.color = fire_palette diff --git a/lib/libesp32/berry_animation/src/tests/gradient_lut_integration_test.be b/lib/libesp32/berry_animation/src/tests/gradient_lut_integration_test.be index 45802a540..3dce846f8 100644 --- a/lib/libesp32/berry_animation/src/tests/gradient_lut_integration_test.be +++ b/lib/libesp32/berry_animation/src/tests/gradient_lut_integration_test.be @@ -35,7 +35,7 @@ var rainbow_with_white = bytes( # Create a rich palette color provider var rainbow_rich_color = animation.rich_palette(engine) rainbow_rich_color.colors = rainbow_with_white -rainbow_rich_color.cycle_period = 10000 # 10 seconds +rainbow_rich_color.period = 10000 # 10 seconds rainbow_rich_color.transition_type = animation.SINE # Get strip length diff --git a/lib/libesp32/berry_animation/src/tests/palette_dsl_test.be b/lib/libesp32/berry_animation/src/tests/palette_dsl_test.be index c726ec27f..942195bdc 100644 --- a/lib/libesp32/berry_animation/src/tests/palette_dsl_test.be +++ b/lib/libesp32/berry_animation/src/tests/palette_dsl_test.be @@ -608,7 +608,7 @@ def test_alternative_syntax_integration() " 0xFFFF00\n" + "]\n" + "\n" + - "color rich_palette2 = color_cycle(colors=fire_colors, cycle_period=3s)\n" + "color rich_palette2 = color_cycle(colors=fire_colors, period=3s)\n" "animation fire_anim = solid(color=rich_palette2)\n" + "\n" + "run fire_anim\n" diff --git a/lib/libesp32/berry_animation/src/tests/rich_palette_animation_class_test.be b/lib/libesp32/berry_animation/src/tests/rich_palette_animation_class_test.be index a59d17413..3fcf0732d 100644 --- a/lib/libesp32/berry_animation/src/tests/rich_palette_animation_class_test.be +++ b/lib/libesp32/berry_animation/src/tests/rich_palette_animation_class_test.be @@ -25,7 +25,7 @@ print(f"Animation type: {type(anim)}") # Test 2: Set parameters using virtual member assignment (parameter forwarding) anim.colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue -anim.cycle_period = 3000 +anim.period = 3000 anim.transition_type = 1 # sine anim.brightness = 200 @@ -39,7 +39,7 @@ print("Set parameters using virtual member assignment") # Test parameter values (should be forwarded to internal provider) print(f"Palette: {bool(anim.colors)}") -print(f"Cycle period: {anim.cycle_period}") +print(f"Cycle period: {anim.period}") print(f"Transition type: {anim.transition_type}") print(f"Brightness: {anim.brightness}") @@ -50,7 +50,7 @@ print(f"Loop: {anim.loop}") print(f"Opacity: {anim.opacity}") # Test 3: Verify parameter forwarding to internal color provider -print(f"Internal provider cycle period: {anim.color_provider.cycle_period}") +print(f"Internal provider cycle period: {anim.color_provider.period}") print(f"Internal provider brightness: {anim.color_provider.brightness}") print(f"Internal provider transition type: {anim.color_provider.transition_type}") @@ -83,9 +83,9 @@ print(f"Color at t=1500: {color_t1500}") print(f"Color at t=3000: {color_t3000}") # Test 7: Test parameter change propagation -anim.cycle_period = 2000 # Change cycle period -print(f"Changed cycle period to: {anim.cycle_period}") -print(f"Internal provider cycle period: {anim.color_provider.cycle_period}") +anim.period = 2000 # Change cycle period +print(f"Changed cycle period to: {anim.period}") +print(f"Internal provider cycle period: {anim.color_provider.period}") anim.brightness = 100 # Change brightness print(f"Changed brightness to: {anim.brightness}") @@ -105,16 +105,16 @@ var rainbow_palette = bytes( var rainbow_anim = animation.rich_palette_animation(engine) rainbow_anim.colors = rainbow_palette -rainbow_anim.cycle_period = 5000 +rainbow_anim.period = 5000 rainbow_anim.brightness = 255 print("Created rainbow animation with custom palette") -# Test 9: Test static mode (cycle_period = 0) +# Test 9: Test static mode (period = 0) var static_anim = animation.rich_palette_animation(engine) static_anim.colors = rainbow_palette -static_anim.cycle_period = 0 # Static mode +static_anim.period = 0 # Static mode static_anim.brightness = 150 -print("Created static animation (cycle_period = 0)") +print("Created static animation (period = 0)") # Test 10: Test access to internal color provider methods var css_gradient = anim.color_provider.to_css_gradient() @@ -125,9 +125,9 @@ assert(anim != nil, "Rich palette animation should be created") assert(type(anim) == "instance", "Animation should be an instance") # Test parameter forwarding -assert(anim.cycle_period == 2000, "Cycle period should be forwarded") +assert(anim.period == 2000, "Cycle period should be forwarded") assert(anim.brightness == 100, "Brightness should be forwarded") -assert(anim.color_provider.cycle_period == 2000, "Internal provider should receive forwarded cycle period") +assert(anim.color_provider.period == 2000, "Internal provider should receive forwarded cycle period") assert(anim.color_provider.brightness == 100, "Internal provider should receive forwarded brightness") # Test Animation base parameters @@ -152,8 +152,8 @@ assert(color_t3000 != 0, "Should produce valid colors at t=3000") # Test different animations are independent assert(rainbow_anim != nil, "Rainbow animation should be created") assert(static_anim != nil, "Static animation should be created") -assert(rainbow_anim.cycle_period == 5000, "Rainbow animation should have correct cycle period") -assert(static_anim.cycle_period == 0, "Static animation should have cycle period 0") +assert(rainbow_anim.period == 5000, "Rainbow animation should have correct cycle period") +assert(static_anim.period == 0, "Static animation should have cycle period 0") print("All RichPaletteAnimation class tests completed successfully!") return true \ No newline at end of file diff --git a/lib/libesp32/berry_animation/src/tests/rich_palette_animation_test.be b/lib/libesp32/berry_animation/src/tests/rich_palette_animation_test.be index ab3fcd236..8cfbea0a2 100644 --- a/lib/libesp32/berry_animation/src/tests/rich_palette_animation_test.be +++ b/lib/libesp32/berry_animation/src/tests/rich_palette_animation_test.be @@ -95,7 +95,7 @@ class RichPaletteAnimationTest var custom_palette = bytes("00FF0000" "FFFFFF00") var custom_provider = animation.rich_palette(mock_engine) custom_provider.colors = custom_palette - custom_provider.cycle_period = 2000 + custom_provider.period = 2000 custom_provider.transition_type = animation.SINE custom_provider.brightness = 128 @@ -107,7 +107,7 @@ class RichPaletteAnimationTest self.assert_equal(type(anim2.color) == 'int', true, "Custom color is resolved to integer") # Check provider properties directly on the provider object - self.assert_equal(custom_provider.cycle_period, 2000, "Custom cycle period is 2000ms") + self.assert_equal(custom_provider.period, 2000, "Custom cycle period is 2000ms") self.assert_equal(custom_provider.transition_type, animation.SINE, "Custom transition type is sine") self.assert_equal(custom_provider.brightness, 128, "Custom brightness is 128") end @@ -117,7 +117,7 @@ class RichPaletteAnimationTest var colors = bytes("00FF0000" "FF0000FF") # Red to Blue in VRGB format var provider = animation.rich_palette(mock_engine) provider.colors = colors - provider.cycle_period = 1000 # 1 second cycle + provider.period = 1000 # 1 second cycle provider.transition_type = animation.LINEAR # linear transition var anim = animation.solid(mock_engine) @@ -169,10 +169,10 @@ class RichPaletteAnimationTest var colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue var provider = animation.rich_palette(mock_engine) provider.colors = colors - provider.cycle_period = 1000 + provider.period = 1000 # Check basic properties - self.assert_equal(provider.cycle_period, 1000, "Cycle period is 1000ms") + self.assert_equal(provider.period, 1000, "Cycle period is 1000ms") # Value-based colors now always use 0-255 range @@ -198,7 +198,7 @@ class RichPaletteAnimationTest var colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue var provider = animation.rich_palette(mock_engine) provider.colors = colors - provider.cycle_period = 1000 + provider.period = 1000 var css = provider.to_css_gradient() @@ -214,23 +214,23 @@ class RichPaletteAnimationTest end def test_cycle_period_zero() - # Test the new cycle_period = 0 functionality for value-based color mapping + # Test the new period = 0 functionality for value-based color mapping var colors = bytes("00FF0000" "80FFFF00" "FF0000FF") # Red to Yellow to Blue var provider = animation.rich_palette(mock_engine) provider.colors = colors - provider.cycle_period = 0 # Value-based mode + provider.period = 0 # Value-based mode provider.start() provider.update() - # Check that cycle_period can be set to 0 - self.assert_equal(provider.cycle_period, 0, "Cycle period can be set to 0") + # Check that period can be set to 0 + self.assert_equal(provider.period, 0, "Cycle period can be set to 0") - # Test that produce_value returns static color when cycle_period = 0 + # Test that produce_value returns static color when period = 0 var color_t0 = provider.produce_value("color", 0) var color_t1000 = provider.produce_value("color", 1000) var color_t2000 = provider.produce_value("color", 2000) - # All colors should be the same (static) when cycle_period = 0 + # All colors should be the same (static) when period = 0 self.assert_equal(color_t0, color_t1000, "Static color at different times (0 vs 1000)") self.assert_equal(color_t1000, color_t2000, "Static color at different times (1000 vs 2000)") @@ -248,8 +248,8 @@ class RichPaletteAnimationTest self.assert_equal(color_128 != color_255, true, "Value-based colors differ (128 vs 255)") # Test that we can switch back to time-based mode - provider.cycle_period = 1000 - self.assert_equal(provider.cycle_period, 1000, "Can switch back to time-based mode") + provider.period = 1000 + self.assert_equal(provider.period, 1000, "Can switch back to time-based mode") # Start the provider for time-based mode provider.start(0) @@ -269,7 +269,7 @@ class RichPaletteAnimationTest # Create LINEAR provider var provider_linear = animation.rich_palette(mock_engine) provider_linear.colors = colors - provider_linear.cycle_period = 1000 + provider_linear.period = 1000 provider_linear.transition_type = animation.LINEAR provider_linear.brightness = 255 provider_linear.start(0) @@ -277,7 +277,7 @@ class RichPaletteAnimationTest # Create SINE provider var provider_sine = animation.rich_palette(mock_engine) provider_sine.colors = colors - provider_sine.cycle_period = 1000 + provider_sine.period = 1000 provider_sine.transition_type = animation.SINE provider_sine.brightness = 255 provider_sine.start(0) @@ -328,7 +328,7 @@ class RichPaletteAnimationTest var colors = bytes("00FF0000" "FF0000FF") # Red to Blue var provider = animation.rich_palette(mock_engine) provider.colors = colors - provider.cycle_period = 0 # Value-based mode + provider.period = 0 # Value-based mode provider.transition_type = animation.SINE provider.start() provider.update() diff --git a/lib/libesp32/berry_animation/src/tests/rich_palette_breathing_demo.be b/lib/libesp32/berry_animation/src/tests/rich_palette_breathing_demo.be index 26c67edd2..ecca6eb4e 100644 --- a/lib/libesp32/berry_animation/src/tests/rich_palette_breathing_demo.be +++ b/lib/libesp32/berry_animation/src/tests/rich_palette_breathing_demo.be @@ -37,7 +37,7 @@ var rainbow_palette = bytes( # Create the color provider var provider = animation.rich_palette(engine) provider.colors = rainbow_palette -provider.cycle_period = 0 # Value-based mode for gradient +provider.period = 0 # Value-based mode for gradient provider.brightness = 255 # Initialize the provider diff --git a/lib/libesp32/berry_animation/src/tests/rich_palette_dynamic_brightness_test.be b/lib/libesp32/berry_animation/src/tests/rich_palette_dynamic_brightness_test.be index 95fe6a021..bb57ebb4e 100644 --- a/lib/libesp32/berry_animation/src/tests/rich_palette_dynamic_brightness_test.be +++ b/lib/libesp32/berry_animation/src/tests/rich_palette_dynamic_brightness_test.be @@ -30,7 +30,7 @@ var rgb_palette = bytes( var provider = animation.rich_palette(engine) provider.colors = rgb_palette -provider.cycle_period = 0 # Static mode +provider.period = 0 # Static mode # Initialize the provider and build LUT provider.produce_value("color", 0) @@ -144,7 +144,7 @@ log("---------------------------------") # Create a fresh provider var rebuild_provider = animation.rich_palette(engine) rebuild_provider.colors = rgb_palette -rebuild_provider.cycle_period = 0 +rebuild_provider.period = 0 # Force initial build rebuild_provider.get_color_for_value(128, 0) diff --git a/lib/libesp32/berry_animation/src/tests/rich_palette_lut_test.be b/lib/libesp32/berry_animation/src/tests/rich_palette_lut_test.be index 6919dd935..a0aca9b37 100644 --- a/lib/libesp32/berry_animation/src/tests/rich_palette_lut_test.be +++ b/lib/libesp32/berry_animation/src/tests/rich_palette_lut_test.be @@ -43,7 +43,7 @@ log("") var provider = animation.rich_palette(engine) provider.colors = rainbow_palette -provider.cycle_period = 0 # Static mode for testing +provider.period = 0 # Static mode for testing # Trigger initialization by calling produce_value once # This will initialize value_arr and slots @@ -98,7 +98,7 @@ log("-------------------------------") # Create a fresh provider for performance testing var perf_provider = animation.rich_palette(engine) perf_provider.colors = rainbow_palette -perf_provider.cycle_period = 0 +perf_provider.period = 0 # Warm up the LUT perf_provider.get_color_for_value(128, 0) diff --git a/lib/libesp32/berry_animation/src/tests/sequence_manager_layering_test.be b/lib/libesp32/berry_animation/src/tests/sequence_manager_layering_test.be index 5993c000c..47c30f14c 100644 --- a/lib/libesp32/berry_animation/src/tests/sequence_manager_layering_test.be +++ b/lib/libesp32/berry_animation/src/tests/sequence_manager_layering_test.be @@ -455,7 +455,7 @@ def test_dsl_if_statement_dynamic() # Test 2: if with property access (dynamic) var dsl_source2 = "color my_red = 0xFF0000\n" + "color my_blue = 0x0000FF\n" + - "color col1 = color_cycle(cycle_period=0)\n" + + "color col1 = color_cycle(period=0)\n" + "animation solid_red = solid(color=my_red)\n" + "set some_value = 1\n" + "sequence test repeat forever {\n" + diff --git a/lib/libesp32/berry_animation/src/tests/sequence_manager_test.be b/lib/libesp32/berry_animation/src/tests/sequence_manager_test.be index 947f1cb07..c388221da 100644 --- a/lib/libesp32/berry_animation/src/tests/sequence_manager_test.be +++ b/lib/libesp32/berry_animation/src/tests/sequence_manager_test.be @@ -754,7 +754,7 @@ def test_sequence_manager_zero_palette_size() # Create a color cycle with empty palette (palette_size = 0) var col1 = animation.color_cycle(engine) col1.colors = bytes() # Empty palette - col1.cycle_period = 0 + col1.period = 0 # Verify palette size is 0 assert(col1.palette_size == 0, f"Empty palette should have size 0, got {col1.palette_size}") @@ -781,7 +781,7 @@ def test_sequence_manager_zero_palette_size() execution_count = 0 var col2 = animation.color_cycle(engine) col2.colors = bytes("FFFF0000" "FF00FF00" "FF0000FF") # 3 colors - col2.cycle_period = 0 + col2.period = 0 assert(col2.palette_size == 3, f"Palette with 3 colors should have size 3, got {col2.palette_size}") diff --git a/lib/libesp32/berry_animation/src/tests/value_provider_integration_test.be b/lib/libesp32/berry_animation/src/tests/value_provider_integration_test.be index c89cda6b7..3a40d3e9f 100644 --- a/lib/libesp32/berry_animation/src/tests/value_provider_integration_test.be +++ b/lib/libesp32/berry_animation/src/tests/value_provider_integration_test.be @@ -67,7 +67,7 @@ def test_multiple_providers_coordination() var color_cycle = animation.color_cycle(engine) color_cycle.colors = bytes("FFFF0000" "FF00FF00" "FF0000FF") - color_cycle.cycle_period = 5000 + color_cycle.period = 5000 # Create animation using all providers var beacon = animation.beacon_animation(engine) diff --git a/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/CHANGELOG.md b/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/CHANGELOG.md index 8435afae7..5a6a21846 100644 --- a/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/CHANGELOG.md +++ b/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/CHANGELOG.md @@ -27,7 +27,7 @@ All notable changes to the Animation DSL extension will be documented in this fi - Additional value providers: `triangle`, `cosine_osc`, `sawtooth`, `color_cycle`, `strip_length` - Additional easing types: `triangle`, `sine`, `sawtooth`, `elastic`, `bounce` - Support for hexadecimal colors with `0x` prefix (e.g., `0xFF0000`, `0x80FF0000`) -- Additional animation properties: `opacity`, `priority`, `pos`, `beacon_size`, `slew_size`, `direction`, `tail_length`, `speed`, `period`, `cycle_period`, `min_value`, `max_value`, `duration`, `next` +- Additional animation properties: `opacity`, `priority`, `pos`, `beacon_size`, `slew_size`, `direction`, `tail_length`, `speed`, `period`, `period`, `min_value`, `max_value`, `duration`, `next` ### Changed - Updated keyword patterns to match current DSL syntax based on actual examples diff --git a/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/README.md b/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/README.md index 4b2990306..be145503b 100644 --- a/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/README.md +++ b/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/README.md @@ -27,56 +27,6 @@ This extension provides syntax highlighting, snippets, and language support for This extension automatically activates for files with the `.anim` extension. -## Example Usage - -```dsl -# Fire Effect Animation with Templates -import user_functions - -# Define fire palette -palette fire_colors = [ - (0, 0x000000) # Black - (64, 0x800000) # Dark red - (128, 0xFF0000) # Red - (192, 0xFF8000) # Orange - (255, 0xFFFF00) # Yellow -] - -# Template for reusable fire effect -template fire_effect { - param base_palette type palette - param intensity type number - param duration - - animation campfire = rich_palette_animation( - palette=base_palette - cycle_period=duration - ) - - # Use computed values and user functions - campfire.priority = max(5, intensity / 10) - campfire.opacity = user.breathing_effect() - - run campfire -} - -# Use the template -fire_effect(fire_colors, 200, 3s) - -# Sequence with dynamic property changes -sequence fire_demo { - play campfire for 5s - campfire.opacity = abs(strip_length() * 4) - play campfire for 3s - reset campfire - play campfire for 2s -} - -run fire_demo -``` - - - ## Theme Compatibility The extension uses semantic token scopes that work with any VSCode theme: diff --git a/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/syntaxes/animation-dsl.tmLanguage.json b/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/syntaxes/animation-dsl.tmLanguage.json index dd6419cd8..585542f97 100644 --- a/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/syntaxes/animation-dsl.tmLanguage.json +++ b/lib/libesp32/berry_animation/tools/tasmota.animation-dsl-1.2.1/syntaxes/animation-dsl.tmLanguage.json @@ -72,7 +72,7 @@ }, { "name": "keyword.other.animation-dsl", - "match": "\\b(opacity|priority|pos|beacon_size|slew_size|direction|tail_length|speed|period|cycle_period|min_value|max_value|duration|next)\\b" + "match": "\\b(opacity|priority|pos|beacon_size|slew_size|direction|tail_length|speed|period|period|min_value|max_value|duration|next)\\b" }, { "name": "constant.language.boolean.animation-dsl",