Berry animation update tests (#23963)
This commit is contained in:
parent
0db260a242
commit
194124a26f
@ -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()
|
||||
|
||||
|
||||
@ -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..."
|
||||
|
||||
@ -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()
|
||||
|
||||
|
||||
@ -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()
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user