Files
jimmyandClaude Opus 5.5 bfeeb958df 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>
2026-11-03 20:34:22 +13:00

31 lines
1.0 KiB
Python

def test_get_settings(c):
resp = c.get("/settings")
assert resp.status_code == 200
assert "wifi_channel" in resp.json()
def test_wifi_channel(c):
assert c.put("/settings/settings", json={"wifi_channel": 11}).status_code == 200
assert c.get("/settings").json()["wifi_channel"] == 11
def test_wifi_channel_out_of_range(c):
assert c.put("/settings/settings", json={"wifi_channel": 12}).status_code == 400
def test_global_brightness(c):
assert c.put("/settings/settings", json={"global_brightness": 42}).status_code == 200
assert c.get("/settings").json().get("global_brightness") == 42
def test_global_brightness_out_of_range(c):
assert c.put("/settings/settings", json={"global_brightness": 300}).status_code == 400
def test_put_settings_root(c):
# main's UI writes PUT /settings
assert c.put("/settings", json={"audio_beat_phase_ms": 40}).status_code == 200
assert c.get("/settings").json()["audio_beat_phase_ms"] == 40
assert c.put("/settings", json={"audio_beat_phase_ms": 900}).status_code == 400