Update pattern tests for new preset-based API
- Replace add() calls with edit() for preset creation - Update tests to work with merged patterns.py - Ensure all tests use new Preset object structure
This commit is contained in:
@@ -28,7 +28,7 @@ def main():
|
||||
|
||||
# Test 1: Rainbow in AUTO mode (continuous)
|
||||
print("\nTest 1: Rainbow pattern in AUTO mode (should run continuously)")
|
||||
p.add("rainbow_auto", {
|
||||
p.edit("rainbow_auto", {
|
||||
"pattern": "rainbow",
|
||||
"brightness": 128,
|
||||
"delay": 50,
|
||||
@@ -42,7 +42,7 @@ def main():
|
||||
|
||||
# Test 2: Rainbow in MANUAL mode (one step per tick)
|
||||
print("\nTest 2: Rainbow pattern in MANUAL mode (one step per tick)")
|
||||
p.add("rainbow_manual", {
|
||||
p.edit("rainbow_manual", {
|
||||
"pattern": "rainbow",
|
||||
"brightness": 128,
|
||||
"delay": 50,
|
||||
@@ -64,7 +64,7 @@ def main():
|
||||
|
||||
# Test 3: Pulse in AUTO mode (continuous cycles)
|
||||
print("\nTest 3: Pulse pattern in AUTO mode (should pulse continuously)")
|
||||
p.add("pulse_auto", {
|
||||
p.edit("pulse_auto", {
|
||||
"pattern": "pulse",
|
||||
"brightness": 128,
|
||||
"delay": 100,
|
||||
@@ -81,7 +81,7 @@ def main():
|
||||
|
||||
# Test 4: Pulse in MANUAL mode (one cycle then stop)
|
||||
print("\nTest 4: Pulse pattern in MANUAL mode (one cycle then stop)")
|
||||
p.add("pulse_manual", {
|
||||
p.edit("pulse_manual", {
|
||||
"pattern": "pulse",
|
||||
"brightness": 128,
|
||||
"delay": 100,
|
||||
@@ -107,7 +107,7 @@ def main():
|
||||
|
||||
# Test 5: Transition in AUTO mode (continuous transitions)
|
||||
print("\nTest 5: Transition pattern in AUTO mode (continuous transitions)")
|
||||
p.add("transition_auto", {
|
||||
p.edit("transition_auto", {
|
||||
"pattern": "transition",
|
||||
"brightness": 128,
|
||||
"delay": 500,
|
||||
@@ -121,7 +121,7 @@ def main():
|
||||
|
||||
# Test 6: Transition in MANUAL mode (one transition then stop)
|
||||
print("\nTest 6: Transition pattern in MANUAL mode (one transition then stop)")
|
||||
p.add("transition_manual", {
|
||||
p.edit("transition_manual", {
|
||||
"pattern": "transition",
|
||||
"brightness": 128,
|
||||
"delay": 500,
|
||||
@@ -144,7 +144,7 @@ def main():
|
||||
|
||||
# Test 7: Switching between auto and manual modes
|
||||
print("\nTest 7: Switching between auto and manual modes")
|
||||
p.add("switch_test", {
|
||||
p.edit("switch_test", {
|
||||
"pattern": "rainbow",
|
||||
"brightness": 128,
|
||||
"delay": 50,
|
||||
@@ -176,7 +176,7 @@ def main():
|
||||
|
||||
# Cleanup
|
||||
print("\nCleaning up...")
|
||||
p.add("cleanup_off", {"pattern": "off"})
|
||||
p.edit("cleanup_off", {"pattern": "off"})
|
||||
p.select("cleanup_off")
|
||||
p.tick()
|
||||
utime.sleep_ms(100)
|
||||
|
||||
Reference in New Issue
Block a user