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:
2026-01-27 00:42:33 +13:00
parent a999b9054e
commit a75d71d9f4
8 changed files with 40 additions and 40 deletions

View File

@@ -24,7 +24,7 @@ def main():
# Test 1: Simple two-color transition
print("Test 1: Two-color transition (red <-> blue, delay=1000)")
p.add("transition1", {
p.edit("transition1", {
"pattern": "transition",
"brightness": 255,
"delay": 1000, # transition duration
@@ -36,7 +36,7 @@ def main():
# Test 2: Multi-color transition
print("Test 2: Multi-color transition (red -> green -> blue -> white)")
p.add("transition2", {
p.edit("transition2", {
"pattern": "transition",
"delay": 800,
"colors": [(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 255)],
@@ -47,7 +47,7 @@ def main():
# Test 3: One-shot transition (auto=False)
print("Test 3: One-shot transition (auto=False)")
p.add("transition3", {
p.edit("transition3", {
"pattern": "transition",
"delay": 1000,
"colors": [(255, 0, 0), (0, 255, 0)],
@@ -59,7 +59,7 @@ def main():
# Test 4: Single-color behavior (should just stay on)
print("Test 4: Single-color transition (should hold color)")
p.add("transition4", {
p.edit("transition4", {
"pattern": "transition",
"colors": [(0, 0, 255)],
"delay": 500,
@@ -70,7 +70,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)