Ship the portal FastAPI controller with presets, sequences, and live audio.
Move the app under src/, add ring-spanning patterns with shared fonts and beat-driven motion, and wire global audio settings into the web UI. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Solid fill cycling through declared colours."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from leds.pattern import Color, Pattern, run_cli
|
||||
|
||||
|
||||
class Solid(Pattern):
|
||||
id = "solid"
|
||||
label = "Solid"
|
||||
fps = 1
|
||||
colors = {
|
||||
"a": Color("#ff0000"),
|
||||
"b": Color("#00ff00"),
|
||||
"c": Color("#0000ff"),
|
||||
}
|
||||
|
||||
def draw(self, surface, t, params):
|
||||
palette = list(params["colors"].values()) or [(255, 0, 0)]
|
||||
frame = int(t * self.fps)
|
||||
surface.fill(palette[frame % len(palette)])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
run_cli(Solid)
|
||||
Reference in New Issue
Block a user