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:
jimmyandClaude Opus 5.5 committed 2026-11-03 20:34:22 +13:00
1 parent 04b56c6ef2
commit bfeeb958df
44 files changed
+8709 -2338

No files matched your search

+7
View File
@@ -44,15 +44,22 @@ int api_effective_brightness(const char *mac, int zone_b);
// Blink every member of a group, then "off"
esp_err_t api_identify_group(const char *group_id);
// New records with every field set (callers merge in the request)
cJSON *api_preset_defaults(const char *profile_id);
cJSON *api_sequence_defaults(void);
// Current profile id (settings.current_profile_id, else the first profile), or NULL
const char *api_current_profile(void);
bool api_preset_in_profile(const cJSON *rec);
// Bring records written by older versions into the current shape (at boot)
void api_migrate_sequences(void);
void api_migrate_zones(void);
void api_migrate_groups(void);
// Resource handlers, called with the store locked. Each returns true when it answered the request
// (its result in *ret); false hands the request to the generic collection CRUD.
bool bundles_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
bool profiles_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
bool zones_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
bool presets_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);