5 Commits
Author SHA1 Message Date
jimmyandClaude Sonnet 5.5 38162d4b89 feat: faster, correct preset editor; default presets use their own pattern
- Editing a preset can change its pattern (the dropdown was disabled).
- on, off and rainbow are built-in patterns and are always listed, so the
  editor no longer falls back to the first pattern (aurora) for them.
- The editor loads the pattern names once and only the selected pattern's
  definition (new GET /patterns/names and GET /patterns/<name>).
- A shared GET cache (fetch_cache.js) reuses profile, palette, zone, preset,
  group and pattern lookups; any write clears it and entries expire at 30 s.
- The seeded rainbow preset uses the rainbow pattern.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 01:46:11 +13:00
jimmyandClaude Opus 5.5 24d3c1149d test(api): share one profile() fixture in conftest
Six test files each defined the same profile() fixture. It now lives once
in conftest.py, with test_profiles.py's 201 check on create.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 01:35:56 +13:00
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
jimmyandClaude Opus 5.5 57182188ba feat: port the remaining v1 API to the v2 controller
Profiles seed presets, a default zone and a palette, and clone with their
own copies; deleting a profile removes what it owned. Zones get the v1
list shape, set-current, current, clone and content-fragment. Devices are
keyed by MAC with v1 validation and identify. Patterns: definitions, OTA
file and manifest, upload, driver, and send over ESP-NOW (the led-driver
pattern sources are embedded in the firmware). Pixel outputs get v1
validation and a DDP/Art-Net/sACN test pattern. Sequences, palettes and
settings follow v1 replies and validation, and /ws forwards browser
messages to the drivers.

The resource handlers move out of api.c into res_*.c, patterns.c and
outputs.c. cJSON now allocates from PSRAM: the store had grown enough to
starve internal RAM and abort the mic at boot. /status reports
free_internal.

The Wi-Fi AP and led-tool routes are left out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 09:58:17 +13:00
jimmyandClaude Opus 5.5 4b42391a46 test: port the v1 endpoint and browser tests to v2
HTTP tests against a running controller (make test-api HOST=ip). They
snapshot every collection through /db and restore it afterwards. v1
behaviour v2 does not have yet is marked as a strict xfail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 01:33:08 +13:00