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:
@@ -24,7 +24,7 @@ def main():
|
||||
|
||||
# Test 1: Simple single-color pulse
|
||||
print("Test 1: Single-color pulse (attack=500, hold=500, decay=500, delay=500)")
|
||||
p.add("pulse1", {
|
||||
p.edit("pulse1", {
|
||||
"pattern": "pulse",
|
||||
"brightness": 255,
|
||||
"colors": [(255, 0, 0)],
|
||||
@@ -39,7 +39,7 @@ def main():
|
||||
|
||||
# Test 2: Faster pulse
|
||||
print("Test 2: Fast pulse (attack=100, hold=100, decay=100, delay=100)")
|
||||
p.add("pulse2", {
|
||||
p.edit("pulse2", {
|
||||
"pattern": "pulse",
|
||||
"n1": 100,
|
||||
"n2": 100,
|
||||
@@ -52,7 +52,7 @@ def main():
|
||||
|
||||
# Test 3: Multi-color pulse cycle
|
||||
print("Test 3: Multi-color pulse (red -> green -> blue)")
|
||||
p.add("pulse3", {
|
||||
p.edit("pulse3", {
|
||||
"pattern": "pulse",
|
||||
"n1": 300,
|
||||
"n2": 300,
|
||||
@@ -66,7 +66,7 @@ def main():
|
||||
|
||||
# Test 4: One-shot pulse (auto=False)
|
||||
print("Test 4: Single pulse, auto=False")
|
||||
p.add("pulse4", {
|
||||
p.edit("pulse4", {
|
||||
"pattern": "pulse",
|
||||
"n1": 400,
|
||||
"n2": 0,
|
||||
@@ -81,7 +81,7 @@ def main():
|
||||
|
||||
# Cleanup
|
||||
print("Test complete, turning off")
|
||||
p.add("cleanup_off", {"pattern": "off"})
|
||||
p.edit("cleanup_off", {"pattern": "off"})
|
||||
p.select("cleanup_off")
|
||||
run_for(p, wdt, 200)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user