feat: main's import/export, zones, audio API and web UI
Profiles, presets and sequences export and import as main's bundles. Zones carry group_ids, preset_group_ids, sequence_ids, content_kind and brightness; profiles seed rainbow as colour_cycle, and deleting a profile also deletes its sequences. Groups, zones and sequences written by older versions are migrated at boot. /api/audio (status, event stream, start/stop, reset, anchor-bar, devices) maps main's audio detector onto the mic's beat detector. Audio start/stop picks whether mic beats or the BPM clock time sequences; the clock's beats also go to the drivers while the mic is off. /ws now greets from a post-handshake callback (httpd does not call the handler for the upgrade). The web UI is main's, plus v2's outputs editor, list search and hostname/static IP settings; the bridge, Wi-Fi AP and led-tool parts are gone. API tests follow main's behaviour (119 pass on the board). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
04b56c6ef2
commit
bfeeb958df
44 files changed
+8709
-2338
No files matched your search
@@ -118,3 +118,21 @@ def test_play_and_stop(c, zone):
|
||||
resp = c.post(f"/zones/{zone}/stop")
|
||||
assert resp.status_code == 200
|
||||
assert resp.json()["stopped"] is True
|
||||
|
||||
|
||||
def test_new_zone_has_main_fields(c, zone):
|
||||
rec = c.get(f"/zones/{zone}").json()
|
||||
assert rec["group_ids"] == [] and rec["preset_group_ids"] == {} and rec["sequence_ids"] == []
|
||||
assert rec["brightness"] == 255
|
||||
|
||||
|
||||
def test_zone_with_groups(c, profile):
|
||||
# main's test_zone_content_kind: presets and sequences coexist; group ids are kept as strings
|
||||
resp = c.post("/zones", json={"name": unique("pytest-zone"), "group_ids": [7], "content_kind": "sequences"})
|
||||
zid = new_id(resp)
|
||||
rec = resp.json()[zid]
|
||||
assert rec["group_ids"] == ["7"] and rec["content_kind"] == "sequences"
|
||||
c.put(f"/zones/{zid}", json={"presets": [["1"]], "sequence_ids": ["1"]})
|
||||
rec = c.get(f"/zones/{zid}").json()
|
||||
assert rec["presets"] == [["1"]] and rec["sequence_ids"] == ["1"]
|
||||
c.delete(f"/zones/{zid}")
|
||||
Reference in new issue
Block a user