Rename patterns module to presets

Rename the driver module and update imports so tests and main entry use the new presets naming, while moving Preset to its own file.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-02-07 11:40:04 +13:00
parent f35d8f7084
commit 43957adb28
14 changed files with 253 additions and 225 deletions

View File

@@ -2,7 +2,7 @@
import utime
from machine import WDT
from settings import Settings
from patterns import Patterns
from presets import Presets
def main():
@@ -10,15 +10,15 @@ def main():
pin = s.get("led_pin", 10)
num = s.get("num_leds", 30)
p = Patterns(pin=pin, num_leds=num)
p = Presets(pin=pin, num_leds=num)
wdt = WDT(timeout=10000)
# Create blink preset
# Create blink preset (use short-key fields: p=pattern, b=brightness, d=delay, c=colors)
p.edit("test_blink", {
"pattern": "blink",
"brightness": 64,
"delay": 200,
"colors": [(255, 0, 0), (0, 0, 255)]
"p": "blink",
"b": 64,
"d": 200,
"c": [(255, 0, 0), (0, 0, 255)],
})
p.select("test_blink")