feat: device groups, combined brightness and beat-driven sequences from main
Groups (registry of driver MACs, optionally scoped to a profile) become
the drivers' group membership, alongside z<zone id> for zones that still
name drivers. Zones play to their group_ids. Group and device routes for
driver config, brightness (global x groups x device x zone) and identify.
The push path takes main's message shape: select as a list, groups as a
filter (one GROUP_CMD per group, or JSON when a preset has a background),
short keys so JSON fits a frame.
Sequences follow main: lanes of {preset_id, beats} steps played to each
lane's groups, advanced by the mic's beats or a clock at
audio_simulated_bpm; a switch waits for the next beat or downbeat; sync-
phase, stop (clears the zone's drivers) and status. This replaces the
time-based per-zone sequencer and scene playback, as in main.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
19fea0b0a1
commit
04b56c6ef2
12 files changed
+1922
-579
No files matched your search
@@ -34,10 +34,23 @@ bool api_id(const cJSON *v, char *buf, size_t len);
|
||||
// Add rec under the collection's next id (with an "id" field when rec is an object); id gets the key
|
||||
void api_add(const char *coll, cJSON *rec, char *id, size_t len);
|
||||
|
||||
// "aa:bb:..", "AA-BB-.." or "aabb.." -> lowercase 12-hex MAC; false when not a MAC
|
||||
bool api_mac(const cJSON *v, char out[13]);
|
||||
// device_config from the fields a request may set (name, num_leds, color_order, startup_mode); NULL when
|
||||
// none is valid. Caller owns the result.
|
||||
cJSON *api_driver_config(const cJSON *name, const cJSON *num_leds, const cJSON *color_order, const cJSON *startup);
|
||||
// Combined 0..255 brightness for a driver: global x its groups x device [x zone_b when >= 0]
|
||||
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);
|
||||
|
||||
// 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);
|
||||
|
||||
// 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 profiles_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
|
||||
@@ -45,6 +58,7 @@ 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);
|
||||
bool palettes_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
|
||||
bool sequences_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
|
||||
bool groups_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
|
||||
bool devices_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
|
||||
bool patterns_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
|
||||
bool outputs_route(httpd_req_t *req, int n, api_seg_t seg, esp_err_t *ret);
|
||||
Reference in new issue
Block a user