diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/cylon_generic.be b/lib/libesp32/berry_animation/anim_examples/compiled/cylon_generic.be index 29cbce583..286c8ad8e 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/cylon_generic.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/cylon_generic.be @@ -8,9 +8,6 @@ import animation # Cylon Red Eye # Automatically adapts to the length of the strip -# Auto-generated strip initialization (using Tasmota configuration) -var engine = animation.init_strip() - # Template function: cylon_effect def cylon_effect_template(engine, eye_color_, back_color_, duration_) var strip_len_ = animation.strip_length(engine) @@ -32,6 +29,9 @@ end animation.register_user_function('cylon_effect', cylon_effect_template) +# Auto-generated strip initialization (using Tasmota configuration) +var engine = animation.init_strip() + cylon_effect_template(engine, 0xFFFF0000, 0x00000000, 3000) engine.run() diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/run_tests.sh b/lib/libesp32/berry_animation/anim_examples/compiled/run_tests.sh index a30875117..134420da2 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/run_tests.sh +++ b/lib/libesp32/berry_animation/anim_examples/compiled/run_tests.sh @@ -4,7 +4,7 @@ set -e -BERRY_CMD="./berry -s -g -m lib/libesp32/berry_animation/src -e 'import tasmota def log(x) print(x) end '" +BERRY_CMD="./berry -s -g -m lib/libesp32/berry_animation/src -e 'import tasmota def log(x,l) tasmota.log(x,l) end '" COMPILED_DIR="lib/libesp32/berry_animation/anim_examples/compiled" echo "Running compiled DSL examples..." diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/test_template_simple.be b/lib/libesp32/berry_animation/anim_examples/compiled/test_template_simple.be index da6626d05..0800325bc 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/test_template_simple.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/test_template_simple.be @@ -8,9 +8,6 @@ import animation # Test template functionality # Define a simple template -# Auto-generated strip initialization (using Tasmota configuration) -var engine = animation.init_strip() - # Template function: pulse_effect def pulse_effect_template(engine, base_color_, duration_, brightness_) var pulse_ = animation.pulsating_animation(engine) @@ -23,6 +20,9 @@ end animation.register_user_function('pulse_effect', pulse_effect_template) # Use the template - templates add animations directly to engine and run them +# Auto-generated strip initialization (using Tasmota configuration) +var engine = animation.init_strip() + pulse_effect_template(engine, 0xFFFF0000, 2000, 204) engine.run() diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/test_template_simple_reusable.be b/lib/libesp32/berry_animation/anim_examples/compiled/test_template_simple_reusable.be index 24b3616d5..68569077f 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/test_template_simple_reusable.be +++ b/lib/libesp32/berry_animation/anim_examples/compiled/test_template_simple_reusable.be @@ -8,9 +8,6 @@ import animation # Test template functionality # Define a simple template -# Auto-generated strip initialization (using Tasmota configuration) -var engine = animation.init_strip() - # Template function: pulse_effect def pulse_effect_template(engine, base_color_, duration_, brightness_) var pulse_ = animation.pulsating_animation(engine) @@ -23,6 +20,9 @@ end animation.register_user_function('pulse_effect', pulse_effect_template) # Use the template - templates add animations directly to engine and run them +# Auto-generated strip initialization (using Tasmota configuration) +var engine = animation.init_strip() + pulse_effect_template(engine, 0xFFFF0000, 2000, 204) engine.run() diff --git a/lib/libesp32/berry_animation/src/tests/dsl_compilation_test.be b/lib/libesp32/berry_animation/src/tests/dsl_compilation_test.be index a0b50fc84..aea62927a 100644 --- a/lib/libesp32/berry_animation/src/tests/dsl_compilation_test.be +++ b/lib/libesp32/berry_animation/src/tests/dsl_compilation_test.be @@ -2,7 +2,7 @@ # Tests for DSL compilation with both successful and failing cases # # Command to run test is: -# ./berry -s -g -m lib/libesp32/berry_animation/src -e "import tasmota def log(x) print(x) end import animation import animation_dsl " lib/libesp32/berry_animation/src/tests/dsl_compilation_test.be +# ./berry -s -g -m lib/libesp32/berry_animation/src -e "import tasmota def log(x,l) tasmota.log(x,l) end import animation import animation_dsl " lib/libesp32/berry_animation/src/tests/dsl_compilation_test.be import animation import animation_dsl 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 ed584880c..169f1ca7c 100644 --- a/lib/libesp32/berry_animation/src/tests/dsl_restart_test.be +++ b/lib/libesp32/berry_animation/src/tests/dsl_restart_test.be @@ -2,7 +2,7 @@ # Tests for restart functionality in sequences # # Command to run test is: -# ./berry -s -g -m lib/libesp32/berry_animation/src -e "import tasmota def log(x) print(x) end" lib/libesp32/berry_animation/src/tests/dsl_reset_restart_test.be +# ./berry -s -g -m lib/libesp32/berry_animation/src -e "import tasmota def log(x,l) tasmota.log(x,l) end" lib/libesp32/berry_animation/src/tests/dsl_reset_restart_test.be import animation import animation_dsl diff --git a/lib/libesp32/berry_animation/src/tests/symbol_table_test.be b/lib/libesp32/berry_animation/src/tests/symbol_table_test.be index 8bb74f1f5..74ff4b221 100644 --- a/lib/libesp32/berry_animation/src/tests/symbol_table_test.be +++ b/lib/libesp32/berry_animation/src/tests/symbol_table_test.be @@ -2,7 +2,7 @@ # Tests for the SymbolEntry and SymbolTable classes # # Command to run test is: -# ./berry -s -g -m lib/libesp32/berry_animation/src -e "import tasmota def log(x) print(x) end" lib/libesp32/berry_animation/src/tests/symbol_table_test.be +# ./berry -s -g -m lib/libesp32/berry_animation/src -e "import tasmota def log(x,l) tasmota.log(x,l) end" lib/libesp32/berry_animation/src/tests/symbol_table_test.be import animation import animation_dsl diff --git a/lib/libesp32/berry_animation/src/tests/test_all.be b/lib/libesp32/berry_animation/src/tests/test_all.be index 8f5272661..a999db58c 100644 --- a/lib/libesp32/berry_animation/src/tests/test_all.be +++ b/lib/libesp32/berry_animation/src/tests/test_all.be @@ -6,6 +6,8 @@ import global import tasmota +def log(x,l) tasmota.log(x,l) end + # Import the animation module import animation import user_functions