Channel 11 defaults, ESP-NOW driver config and rig/desktop updates
Moves the controller, bridge and led-driver default ESP-NOW channel to 11 and updates the led-driver and led-tool submodule pointers. Includes the rest of the working tree: web UI, desktop and sim-controller changes, API and bridge code, graphify output, and the .gitea and fixture-driver folders. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
35207a868a
commit
edf35e9c71
280 files changed
+24043
-1756
No files matched your search
@@ -12,12 +12,17 @@ BEAT_S = 0.3
|
||||
|
||||
@pytest.fixture
|
||||
def clock(c):
|
||||
"""Beats from the clock at 200 BPM; mic timing is restored afterwards."""
|
||||
"""Beats from the clock at 200 BPM (the simulated input); the input and mic timing are restored afterwards."""
|
||||
was = c.get("/api/audio/status").json()["status"]["running"]
|
||||
device = c.get("/settings").json().get("audio_device_select")
|
||||
c.post("/api/audio/stop")
|
||||
c.put("/settings", json={"audio_simulated_bpm": 200})
|
||||
# The clock beats only while the simulated input is selected
|
||||
c.put("/settings", json={"audio_simulated_bpm": 200, "audio_device_select": "simulated"})
|
||||
yield
|
||||
c.post("/sequences/stop")
|
||||
c.post("/sequences/preview/stop")
|
||||
if device is not None:
|
||||
c.put("/settings", json={"audio_device_select": device})
|
||||
if was:
|
||||
c.post("/api/audio/start")
|
||||
|
||||
@@ -356,3 +361,68 @@ def test_window_is_kept(c, profile):
|
||||
assert rec["window_beats"] == 8
|
||||
assert rec["window_seconds"] == 2.4
|
||||
assert c.delete(f"/sequences/{sid}").status_code == 200
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- preview (simulated drivers only)
|
||||
|
||||
|
||||
def test_preview_runs_beside_the_live_sequence(c, zone, clock):
|
||||
a, b = presets(c, 2)
|
||||
live = make(c, lanes=[[{"preset_id": a, "beats": 1}]])
|
||||
prev = make(c, lanes=[[{"preset_id": b, "beats": 1}, {"preset_id": a, "beats": 1}]])
|
||||
c.post(f"/sequences/{live}/play", json={"zone_id": zone})
|
||||
resp = c.post(f"/sequences/{prev}/preview", json={"zone_id": zone})
|
||||
assert resp.status_code == 200
|
||||
st = c.get("/sequences/status").json()
|
||||
assert st["active"] is True and st["sequence_id"] == live
|
||||
assert st["preview"]["active"] is True
|
||||
assert st["preview"]["sequence_id"] == prev
|
||||
assert st["preview"]["loop"] is True
|
||||
st = wait_for(c, lambda s: s["preview"]["active"] and s["preview"]["lanes"][0]["step"] == 1)
|
||||
assert st["preview"]["lanes"][0]["step"] == 1 # it steps on the clock
|
||||
assert c.post("/sequences/preview/stop").status_code == 200
|
||||
st = c.get("/sequences/status").json()
|
||||
assert st["preview"]["active"] is False
|
||||
assert st["active"] is True and st["sequence_id"] == live
|
||||
|
||||
|
||||
def test_live_stop_leaves_the_preview(c, zone, clock):
|
||||
a, = presets(c, 1)
|
||||
live = make(c, lanes=[[{"preset_id": a, "beats": 1}]])
|
||||
prev = make(c, lanes=[[{"preset_id": a, "beats": 1}]])
|
||||
c.post(f"/sequences/{live}/play", json={"zone_id": zone})
|
||||
c.post(f"/sequences/{prev}/preview", json={"zone_id": zone})
|
||||
c.post("/sequences/stop")
|
||||
st = c.get("/sequences/status").json()
|
||||
assert st["active"] is False
|
||||
assert st["preview"]["active"] is True
|
||||
c.post("/sequences/preview/stop")
|
||||
|
||||
|
||||
def test_editing_stops_the_preview_not_the_live_sequence(c, zone, clock):
|
||||
a, = presets(c, 1)
|
||||
live = make(c, lanes=[[{"preset_id": a, "beats": 1}]])
|
||||
prev = make(c, lanes=[[{"preset_id": a, "beats": 1}]])
|
||||
c.post(f"/sequences/{live}/play", json={"zone_id": zone})
|
||||
c.post(f"/sequences/{prev}/preview", json={"zone_id": zone})
|
||||
c.put(f"/sequences/{prev}", json={"name": "edited"})
|
||||
st = c.get("/sequences/status").json()
|
||||
assert st["preview"]["active"] is False
|
||||
assert st["active"] is True and st["sequence_id"] == live
|
||||
|
||||
|
||||
def test_one_shot_preview_plays_once(c, zone, clock):
|
||||
a, = presets(c, 1)
|
||||
sid = make(c, loop=False, lanes=[[{"preset_id": a, "seconds": 0.3}]])
|
||||
c.post(f"/sequences/{sid}/preview", json={"zone_id": zone})
|
||||
st = c.get("/sequences/status").json()
|
||||
assert st["preview"]["active"] is True and st["preview"]["loop"] is False
|
||||
st = wait_for(c, lambda s: not s["preview"]["active"], beats=8)
|
||||
assert st["preview"]["active"] is False
|
||||
|
||||
|
||||
def test_preview_errors(c, zone, clock):
|
||||
empty = make(c)
|
||||
assert c.post("/sequences/nope/preview", json={"zone_id": zone}).status_code == 404
|
||||
assert c.post(f"/sequences/{empty}/preview", json={"zone_id": zone}).status_code == 400
|
||||
assert c.post(f"/sequences/{empty}/preview", json={"zone_id": "no-such-zone"}).status_code == 400
|
||||
Reference in new issue
Block a user