feat: seed a default profile at first boot

A store with no profile gets a default one, using the seed POST /profiles already
creates plus a starter palette. db/ now holds those records instead of stored
data, and the unused db/presets/*.bin files are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jimmyandClaude Opus 5.5 committed 2026-11-04 20:47:00 +13:00
1 parent b6aa0635ae
commit 190c8bc982
62 files changed
+51 -124

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ make test-browser HOST=<ip> # Selenium UI tests (needs selenium and chromedriv
- `led-driver/` (submodule): MicroPython firmware for the ESP32 LED drivers. - `led-driver/` (submodule): MicroPython firmware for the ESP32 LED drivers.
- `led-tool/` (submodule): `led-cli`, configures drivers over serial and updates the controller over Ethernet (`led-cli --ota HOST`). - `led-tool/` (submodule): `led-cli`, configures drivers over serial and updates the controller over Ethernet (`led-cli --ota HOST`).
- `led-simulator/` (submodule), `espnow-sender/`: test helpers. - `led-simulator/` (submodule), `espnow-sender/`: test helpers.
- `db/`: stored zones, presets and devices, importable with `PUT /db/<name>`. - `db/`: the records a controller starts with (the `default` profile the firmware seeds at first boot, plus pattern metadata), importable with `PUT /db/<name>`.
- `test/api/`: the API tests (`test/api/README.md`); `test/browser/`: the UI tests. - `test/api/`: the API tests (`test/api/README.md`); `test/browser/`: the UI tests.
## Docs ## Docs
+1 -1
View File
@@ -1 +1 @@
{"e8f60a16e074": {"id": "e8f60a16e074", "name": "mirror", "type": "led", "transport": "wifi", "address": "192.168.1.199", "default_pattern": null, "zones": []}, "e8f60a16d51c": {"id": "e8f60a16d51c", "name": "mirror", "type": "led", "transport": "wifi", "address": "192.168.1.77", "default_pattern": null, "zones": []}, "e8f60a170d68": {"id": "e8f60a170d68", "name": "mirror", "type": "led", "transport": "wifi", "address": "192.168.1.217", "default_pattern": null, "zones": []}, "588c81a1182c": {"id": "588c81a1182c", "name": "dj", "type": "led", "transport": "wifi", "address": "192.168.1.114", "default_pattern": null, "zones": []}, "dcb4d99988c8": {"id": "dcb4d99988c8", "name": "roof", "type": "led", "transport": "wifi", "address": "192.168.1.158", "default_pattern": null, "zones": []}, "48f6ee2097c0": {"id": "48f6ee2097c0", "name": "roof", "type": "led", "transport": "wifi", "address": "192.168.1.246", "default_pattern": null, "zones": []}, "48f6ee211d8c": {"id": "48f6ee211d8c", "name": "roof", "type": "led", "transport": "wifi", "address": "192.168.1.55", "default_pattern": null, "zones": []}, "dcb4d99b0e34": {"id": "dcb4d99b0e34", "name": "roof", "type": "led", "transport": "wifi", "address": "192.168.1.167", "default_pattern": null, "zones": []}, "588c81a337fc": {"id": "588c81a337fc", "name": "inner", "type": "led", "transport": "wifi", "address": "192.168.1.110", "default_pattern": null, "zones": []}, "588c81a32e1c": {"id": "588c81a32e1c", "name": "outer", "type": "led", "transport": "wifi", "address": "192.168.1.250", "default_pattern": null, "zones": []}, "e8f60a16f288": {"id": "e8f60a16f288", "name": "mirror", "type": "led", "transport": "wifi", "address": "192.168.1.249", "default_pattern": null, "zones": []}, "e4b323c53870": {"id": "e4b323c53870", "name": "speaker1", "type": "led", "transport": "wifi", "address": "192.168.1.23", "default_pattern": null, "zones": []}, "e8f60a16eba4": {"id": "e8f60a16eba4", "name": "speaker2", "type": "led", "transport": "wifi", "address": "192.168.1.31", "default_pattern": null, "zones": []}, "e8f60a1707c0": {"id": "e8f60a1707c0", "name": "speaker3", "type": "led", "transport": "wifi", "address": "192.168.1.134", "default_pattern": null, "zones": []}, "e8f60a16fb14": {"id": "e8f60a16fb14", "name": "speaker4", "type": "led", "transport": "wifi", "address": "192.168.1.30", "default_pattern": null, "zones": []}, "e8f60a16e57c": {"id": "e8f60a16e57c", "name": "speaker5", "type": "led", "transport": "wifi", "address": "192.168.1.63", "default_pattern": null, "zones": []}, "e8f60a16f1b4": {"id": "e8f60a16f1b4", "name": "speaker6", "type": "led", "transport": "wifi", "address": "192.168.1.224", "default_pattern": null, "zones": []}, "e4b323c5ad6c": {"id": "e4b323c5ad6c", "name": "speaker7", "type": "led", "transport": "wifi", "address": "192.168.1.94", "default_pattern": null, "zones": []}, "588c81a200d8": {"id": "588c81a200d8", "name": "speaker8", "type": "led", "transport": "wifi", "address": "192.168.1.122", "default_pattern": null, "zones": []}, "a085e34efaec": {"id": "a085e34efaec", "name": "alleyway", "type": "led", "transport": "wifi", "address": "192.168.1.22", "default_pattern": null, "zones": []}, "e8f60a16f94c": {"id": "e8f60a16f94c", "name": "speaker10", "type": "led", "transport": "wifi", "address": "192.168.1.195", "default_pattern": null, "zones": []}, "e8f60a1701a8": {"id": "e8f60a1701a8", "name": "speaker9", "type": "led", "transport": "wifi", "address": "192.168.1.179", "default_pattern": null, "zones": []}} {}
+1 -1
View File
@@ -1 +1 @@
{"1": {"name": "Main Group", "devices": ["1", "2", "3"]}, "2": {"name": "Accent Group", "devices": ["4", "5"]}} {}
+1 -1
View File
@@ -1 +1 @@
{} {}
+1 -1
View File
@@ -1 +1 @@
{"1": ["#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#FF00FF", "#00FFFF", "#FFFFFF", "#000000"], "2": [], "3": [], "4": [], "5": [], "6": [], "7": ["#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#FF00FF", "#00FFFF", "#FFFFFF", "#000000"], "8": [], "9": [], "10": [], "11": [], "12": ["#890b0b", "#0b8935"]} {"1": ["#FF0000", "#00FF00", "#0000FF", "#FFFF00", "#FF00FF", "#00FFFF", "#FFFFFF", "#000000"]}
+1 -1
View File
@@ -1 +1 @@
{"1": {"name": "on", "pattern": "on", "colors": [], "brightness": 32, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": []}, "2": {"name": "off", "pattern": "off", "colors": [], "brightness": 0, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "3": {"name": "rainbow", "pattern": "rainbow", "colors": [], "brightness": 32, "delay": 100, "auto": true, "n1": 2, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": []}, "4": {"name": "transition", "pattern": "transition", "colors": ["#0000FF", "#FF00FF", "#FF0000", "#00FF00", "#FFFF00", "#00FFFF"], "brightness": 32, "delay": 5000, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": [2, 4, 0, 1, 3, 5]}, "5": {"name": "chase", "pattern": "chase", "colors": ["#006b12", "#2b02c0"], "brightness": 66, "delay": 150, "auto": true, "n1": 4, "n2": 4, "n3": 5, "n4": 1, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": [null, null]}, "6": {"name": "pulse", "pattern": "pulse", "colors": ["#f5e400"], "brightness": 255, "delay": 300, "auto": true, "n1": 200, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": [null]}, "7": {"name": "circle", "pattern": "circle", "colors": ["#ffbb00", "#000000"], "brightness": 64, "delay": 10, "auto": true, "n1": 25, "n2": 120, "n3": 27, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": [null, 7]}, "8": {"name": "blink", "pattern": "blink", "colors": ["#FF0000", "#00FF00", "#0000FF", "#FFFF00"], "brightness": 255, "delay": 1000, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "9": {"name": "warm white", "pattern": "on", "colors": ["#FFF5E6"], "brightness": 255, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": [null]}, "10": {"name": "cool white", "pattern": "on", "colors": ["#E6F2FF"], "brightness": 200, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "11": {"name": "red", "pattern": "on", "colors": ["#FF0000"], "brightness": 64, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": [null]}, "12": {"name": "blue", "pattern": "on", "colors": ["#0000FF"], "brightness": 255, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "13": {"name": "rainbow slow", "pattern": "rainbow", "colors": [], "brightness": 255, "delay": 150, "auto": true, "n1": 1, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "14": {"name": "pulse slow", "pattern": "pulse", "colors": ["#FF6600", "#FF00FF", "#FFFF00"], "brightness": 127, "delay": 100, "auto": true, "n1": 2000, "n2": 1000, "n3": 1000, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": [null, 4, 3]}, "15": {"name": "blink red green", "pattern": "blink", "colors": ["#FF0000", "#00FF00"], "brightness": 255, "delay": 500, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "30": {"name": "rainbow slow", "pattern": "rainbow", "colors": [], "brightness": 255, "delay": 150, "auto": true, "n1": 1, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "2"}, "31": {"name": "DJ Rainbow", "pattern": "rainbow", "colors": [], "brightness": 220, "delay": 60, "n1": 12, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "2"}, "32": {"name": "DJ Single Color", "pattern": "on", "colors": ["#ff00ff"], "brightness": 220, "delay": 100, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "2"}, "33": {"name": "DJ Transition", "pattern": "transition", "colors": ["#ff0000", "#00ff00", "#0000ff"], "brightness": 220, "delay": 250, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "2"}, "34": {"name": "DJ Rainbow", "pattern": "rainbow", "colors": [], "brightness": 220, "delay": 60, "n1": 12, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "2"}, "35": {"name": "DJ Single Color", "pattern": "on", "colors": ["#ff00ff"], "brightness": 220, "delay": 100, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "2"}, "36": {"name": "DJ Transition", "pattern": "transition", "colors": ["#ff0000", "#00ff00", "#0000ff"], "brightness": 220, "delay": 250, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "2"}, "37": {"name": "tranistion2", "pattern": "transition", "colors": ["#FF0000", "#FFFF00"], "brightness": 1Line truncated {"1": {"name": "on", "pattern": "on", "colors": ["#FFFFFF"], "brightness": 255, "delay": 100, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "auto": true, "id": "1"}, "2": {"name": "off", "pattern": "off", "colors": [], "brightness": 0, "delay": 100, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "auto": true, "id": "2"}, "3": {"name": "rainbow", "pattern": "colour_cycle", "colors": [], "brightness": 255, "delay": 100, "n1": 2, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "auto": true, "id": "3"}, "4": {"name": "Colour Cycle", "pattern": "colour_cycle", "colors": ["#FF0000", "#00FF00", "#0000FF"], "brightness": 255, "delay": 100, "n1": 1, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "auto": true, "id": "4"}, "5": {"name": "transition", "pattern": "transition", "colors": ["#FF0000", "#00FF00", "#0000FF"], "brightness": 255, "delay": 500, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "auto": true, "id": "5"}, "6": {"name": "flicker", "pattern": "flicker", "colors": ["#FFB84D"], "brightness": 255, "delay": 80, "n1": 30, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "auto": true, "id": "6"}, "7": {"name": "flame", "pattern": "flame", "colors": [], "brightness": 255, "delay": 50, "n1": 35, "n2": 2600, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "auto": true, "id": "7"}, "8": {"name": "twinkle", "pattern": "twinkle", "colors": ["#78C8FF", "#508CFF", "#B478FF", "#64DCE8", "#A0C8FF"], "brightness": 255, "delay": 55, "n1": 72, "n2": 140, "n3": 2, "n4": 6, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "auto": true, "id": "8"}}
BIN
View File
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
PRST1xœ%ÎÁ
Â0Ð_‘ñšCSµJîæ'D$¶«␍ÄÝ’¦ˆˆÿntOovæ²opxz‘´zޱ ¦P
e®µp={I’g¸ÖÇηÞãlpÍñ>¦¹mÓ ” ÎþrXŠÀ•¼�[¸Zq«l”­²S:e¯þLYn1Ñ%õ‹Ï ¥/ï
-2
View File
@@ -1,2 +0,0 @@
PRST1xњ%ОAВ …б»<·,J5\Е4␍К $84SX4Ж»‹eхеНlюШЅ B
‹+…„ЫОЬж#§,+м␍‡@ЖЏIб.сщ*Lk{ЊЖ(xJnѓХГ аjЙ°E*)°†m';ЗО©c:зОҐsЭY$‡�hЋѕuиЅ*Qлљ…В?†kJУчП=5Я
-1
View File
@@ -1 +0,0 @@
PRST1xœ%ÎA л|·, ŠÐK˜ÆP;* ␍……1Þ݉3›—ÿÿf>àø"̹ ÖØU–¢°Ä[É¥nì¬Ü8b2˜kz<Ó&Ãà½ÁB9¾œµ±·‚Ðj'vRñ ì•ƒâ•£rRÎÖZî)Ó5-ò‡Ã÷yÒ-€
-2
View File
@@ -1,2 +0,0 @@
PRST1xœEÎÁ
Â0Ð_‘9ç`«Qɯˆ”Ô®ˆ»e“RDüwsðô˜™Ë¼ÁñIИx”uS²¬p˜c­¤ü¬»J-ç‹Ã¨éþ¨LÅrï½ÃD9¾:¿uˆK„ª 9pg¥Ñ#ØÂ»Æ¾á‡Æ±qú1«ÜR¦!Mö¡Ãç ��1
-2
View File
@@ -1,2 +0,0 @@
PRST1xœ=ÎÝ
!†á[‰¯StK[¼€½‰ˆ°v*ÁTü!"º÷Ü¤Žžá�9˜¼¹4bu™VÙ…¢)…’ÿåVÎÁ…”¡÷XO“RœãÀpJöz+žr[ R2ÌäÌzäœÁÔ KªÄàE;àKõ´èÓæß¶Ð ²£:»Îø%¦p±ŽŽvn? ¼?�¨2ú
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
PRST1xœUÎÁ
Â0ЙsM5Uò+"²µ«â¦lSDÄwiNž³3‡ý@èɈPJ2–fª•Uþn×’‹.ˆ§³Ã¨éþ¨Â‹å>‡‰3½}×9ÐZ bÕ•ÄÛÀè­‘]cß�¡qh7f-·”ù’&ûÁãûF9/.
-2
View File
@@ -1,2 +0,0 @@
PRST1xœEÎÁ
Â0Ð_‘9ç`«Qɯˆ”Ô®ˆ»e“RDüwsðô˜™Ë¼ÁñIИx”uS²¬p˜c­¤ü¬»J-ç‹Ã¨éþ¨LÅrï½ÃD9¾:¿uˆK„ª 9pg¥Ñ#ØÂ»Æ¾á‡Æ±qú1«ÜR¦!Mö¡Çç �“1
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
PRST1xœ%ͽÂ0 àW©Ž5C~•&VÆ
¡@�)uª4K…xwR<}ç»Á° —ks <DjÎ)¦ …É•B™ë–¸ž¯µža;l¼×Ú{Üž9 ïÂ4×Á­ÐSt l«kævÅ[a'ì…ƒpN¦œ|ˆô}ýmðý‡-‰
-1
View File
@@ -1 +0,0 @@
PRST1xœMÎ1! †á¿b¾[=5ÌNÎnÆô@I°\€Åÿ»Å.²<oÚ¼Aîéa±?,ŽÅQ�-f‚ÂìZó…xÓþÇ·œr©°' !h~<´î-Õg…k‰÷G#_ùØ­0ùä^Ü#7-a;FX ka6ÂVØý˜K1ùKœø_Ÿ/ÐM4y
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
PRST1xœ%ͽÂ0 àW©Ž5C~•&VÆ
¡@�)uª4K…xwR<}ç»Á° —ks <DjÎ)¦ …É•B™ë–¸ž¯µža;l¼×Ú{Üž9 ïÂ4×Á­ÐSt l«kævÅ[a'ì…ƒpN¦œ|ˆô}ýmðý‡-‰
-1
View File
@@ -1 +0,0 @@
PRST1xœMÎ1! †á¿b¾[=5ÌNÎnÆô@I°\€Åÿ»Å.²<oÚ¼Aîéa±?,ŽÅQ�-f‚ÂìZó…xÓþÇ·œr©°' !h~<´î-Õg…k‰÷G#_ùØ­0ùä^Ü#7-a;FX ka6ÂVØý˜K1ùKœø_Ÿ/ÐM4y
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
PRST1xœUÎÁ‚0„áw¯=¤jú*†�
[m\[²”ƒ1¾»…ž<}ÉÌåÿ ºÁÂsŸ$P˜]Î$ño'Y`¯88ÒÚ{ô
7 ÷GŽ´”£5Fa"voX£Üšl–•bÛè2ÆvãXé*¦rªœ+—�Y’LC˜JM³·1•ºAÈo5qeî¿?ªð9±
BIN
View File
Binary file not shown.
-4
View File
@@ -1,4 +0,0 @@
PRST1xśMÎÁ‚0„áwŻ=$ű*†�
[%Y[RÚ1ľ»…^<}ÉĚĺ˙Ŕ™7�`ĺPa51rpËäŇ␍tÇĹÚ©×�Â#,ĎWtĽĺŁŞ{…™Ĺě V+�=(†Ä
®5m¶՝ίk@×B[č
·B˛oáq™sMu¶ çş1°=z\ľ?µ¦8>
-2
View File
@@ -1,2 +0,0 @@
PRST1xśmŹÁ‚0 †ßĄ\wČ`ŮMQ^Â2ĄčâÜČ1ĆřînĚ‹‰—~í—?Mű#ďüC™›F 0IďŃ™w¶ÚşÄ˛š7Ľm�ËĺMęveýuUąo<v[şć:'§.Wop
Ć ¨ĺDN)ąx » �<H¤)B2r"˘Śá@–Ć*ˇNŕ+&gGĄ±WC8<_ßĐéŽńpłhMţ”îýŹ!I°
-2
View File
@@ -1,2 +0,0 @@
PRST1xњUЋ;В0птТєp>°WAQґђ5X2Nд8BЬ;©hv¤·SМЃ_BдЙq(,њ’Др·Эg?ЗtEЕЅЦЦж­ТZіf
·иПdНJcЊВ$ћЯ “ЮТ Jq…PѓЪј…t)ПР‚є] ЁАињњw,q¶ОЛи¦\Wп­^rнЕ–є°yЇКѕ?Эh>Ў
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
PRST1xœEÎM
Â0à«Ès›Eÿ¢’ôE$¶£â¤$Ó…ˆww0 góÁ{o1o°„ŠìÊì™)Ã`õ"”Y‹6§˜r�›°ÇFgƒk÷‡0-:k␍Šþ×7~“'y#ná¥Ó™ÒÃ逇Э*ÇÊéÇšÓ-Dº„Eiñù¹L2‡
-3
View File
@@ -1,3 +0,0 @@
PRST1xœ=ŽA‚0E¯B>Û.
*š€KC*ŒØ¤¶¤Æxw�Í{™7‹y!ØÁ€)s5';9
\å1Eï¡°XfJA~mø·1ú˜2ÌußkÙÕZo^ls\®ÉÍw”å¸mµÂDÞ>a:Q»r„á´’Bh¤ Z)aW°/8tÇ‚ÓKŠ7çip“üÙàý)<¡
-3
View File
@@ -1,3 +0,0 @@
PRST1xś-ÎÁ‚0Đ_!õ‡Šdo˝ô'Ś!Ş’”–”ĺ`Ś˙î<˝ÍĚö�čfű•‹!Íž‹qs
‹cö9J·Çý?RHy]QZkŚÖ’•Zc-n
÷<=_ý*“Zk…Ń÷µrşŤ�óćbę„T ␍¨N ŮĹóA{p9čv–śSđý4Ęcľ?6Đ
-2
View File
@@ -1,2 +0,0 @@
PRST1x�5־A‚0…ב«�ַ¶ @Dׂ- —0ֶT©�X[2ֶxwG׳ש&‎»˜‚yXh°M\₪�׀��‚ֹ8…�0[
’ור/חט#%ט=ֺ¾†q”·r\…¹כ�ƒMע¥©*…ֹzף„מd5 Gh¦ֵ*„Zz+6b-1l ¿´™m¦ֻל2‎ֺLסגה"7ֹy5�־ד:G
-2
View File
@@ -1,2 +0,0 @@
PRST1xœ-ÎÁ Ð_1ã•ÔZŽúÆ´«’ 4°Õã¿»Š§7;sÙ¢»,˜
/îNP˜3å(í¿8¥�r�Ýa©õ¶ìŽÙ_®©ÈÐh­0RpOØN¢›9ÁržI!XÓˆ�ØËW„ö{­+]eSéL9�} ƒåƒ÷ªù0¿
-2
View File
@@ -1,2 +0,0 @@
PRST1x�=ЮA
Т0аЋШw�EZ5JаK�б�ZH��L"онС�Ћ7ќџѓFЄ�с!\e�е�`�I�KдќнRHЅТ�и�ЕЮсlp-ѓу)�ЋНЕzС;=i�/ee�иiІє:Sv�=МютЁсЧЦщG.щ>ОЬ�Овсѓ,�1И
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
PRST1xœ5ÎA‚0Ы�϶‹‚ˆ¦è%Œ!F �–´ÃÂïîhu6o2ÿ/æ ïV‚Sâ"Ѹ’碟\"(lŽ™¢—ø—tÿ¤Kˆ æ‚ÒZ-#·ò£µ¸*Üâ<Nì)I¥ÖZa Å=`ZYÝΆãN
¾‚i„¦0RðMæ˜i3§ÌùËÃ}^¨›ù­Âë␍Çü8÷
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
PRST1xœ5Î=Â0 †á«Tk†þQ�À%*T%Ô@¥’TŽ; ÄÝIáå±ôzðÞ¾å¨ET Ž ·JT,V•ŧšÃð·0‰ ‡Ë>¸8™OõS¨ËÒ`äÙ¾A]Zíª¤²²�¯@M¢ÎÉ7 v;÷-hã˜é2§Ìyg‘pŸf¦1ýTáû^
7˜
-3
View File
@@ -1,3 +0,0 @@
PRST1x�5ΞΝ
Β0ΰW)γ5‡ώh­Ήϊ"%ΪU5)›νAΔww5xϊ–™9μ Α=BI
v>Η%Α`q"ΔA»o<ώγK�#'Ψ#6‡²ο†'ƒ3ϋΫ]%-κ²4�hvOΨVO·J„^Ι T°M­Φ��ΐκ"l3»L›ΩgΊ Η«�iτ“ώSαύ��5%
-4
View File
@@ -1,4 +0,0 @@
PRST1xœMαÂ0 Ð_A×5CZ ´™Q~!¨ ‘BR%î€ÿŽE¦gÝÝà7¢{ ˜
ofŸiž
ÇL9JõŸÞRH¹ÀœÐX{Ô½–¬µµ£ÆYášýýÁ‘ŠL:­&
îÓËéVN0œWRˆ­dB3[Ä]e_é+‡ÊðcÉiö�.~’¿Z|¾¡ 61
-1
View File
@@ -1 +0,0 @@
PRST1xœ5ŽAƒ E¯b¾[¨U+WiŒ¡2¶¦ `š¦éÝ ’nxÌ›Y¼Œ|ùPÌÚÎ�¿ˆ60l2r&.?ýýlµuâ‚Rõ|àCt%Wuß5®n½Ýƒ!OjÎiùN¹ ÜN ¦‚¨¢35DÑ@¤é”Ñft}ÆùÀæì²jšVÓª#TSL�-)ËìZ³ôŒßQ•AÓ
-1
View File
@@ -1 +0,0 @@
PRST1xњEО1В0 Р« ПљЎiЎ ЂK „5)MЪФвоXНЂ—gщяБD72В‹lF—зВ ѓЙ‰pЋьoчR^@glOлаbpЛющ’И‹mУ ЬФлкЉ$ђдВС‚:ҐХљТЃ¬Іi/о+}еP9®L9=|а«ф‹пжg2д
-2
View File
@@ -1,2 +0,0 @@
PRST1xœ=ÎÍ
Â0àW‘é5‡ô?ìM"} ‰vÕBMJ’D|wSž¾afû†5O!rˆ;³zç␍#{›úuu³ótDQi­”N]ÑÊ^␍Öö²•�“ÀÅO÷G´Òq%¥Àȳy�ºÍ(ú•l ª¨I“­AM¦Ít™>£~,Þݦ™ÏÓ˜þ+ñùÚ¦5ó
-3
View File
@@ -1,3 +0,0 @@
PRST1x°Mна
б0 ЮW▒вз╘SzTЯ%D╓╨L╣m├┬ЬНfКе\╬ДOЫ ╦'а┌)С"┤ЬЙ°ВP3╔ ⌡©П}LЖ└Й8≈dуNЖр²╝╘©?8P√⌠Zk┘√╪{ц6р╨▒#,╖▒┌≥Жb␍k└%Л4╜
КBSь╤3C┼]ОИр╥Р≈аВ┘┘6
-2
View File
@@ -1,2 +0,0 @@
PRST1xœMÎK
Â0…á½§ÜT£’tR$Ú«âMÉc âÞm�ˆ£þ39Oˆ»3,¦2Car¥p’¿rŽ!¦ {ÀЍï‰0(œ’¿ÞŠpž‡Î…‘ƒ{À"WK„-©²‚hXMK•î;Ëú—6° ¦±mìûSŠøèÇù’Æë␍»0Ø
-4
View File
@@ -1,4 +0,0 @@
PRST1xœMÎA‚0Ы˜ï¶‹RÉ€KcŠŒBR[Ò c¼»­l\½Éÿùɼáí“ANr˜ÙFÙ
V+ÂÑçê?½b␍8ö½éj�‹Â—Ç,žS.ŒÖ
;ûµù´›�Ä�|ªL½uŨ)_ƒ
ÍN»sÞé~¬1ÜÇ×eÊ/Uø|Æœ5
BIN
View File
Binary file not shown.
-3
View File
@@ -1,3 +0,0 @@
PRST1xœ5ŽA‚0E¯B>Û.
*š€KCªŒBRÚ¦ c¼»ÅÙ¼7óÿb>ðv"0Í\D눙Š)¤8@!ZÙ’—xOºò.¤抲mµŒÜJ­W϶:n
÷4¾ö4K¹ÖZ¡'gß0�¨]8ÀpZHÁW0ÕVðõÞô˜ÇŒSF“qθlˆ)<GGÝØË«¾?ð¹<
-3
View File
@@ -1,3 +0,0 @@
PRST1xœMŽ1Â0 Eïò»fp
�(K/�
­�H!©Òt@ˆ»cÈÂô¾Ÿ¿%¿�üƒá0†2F†Âìkå’þÕ˜c. ÜÝ0 ‘¸Î‘%œ.%Üî5ñ"•Þ…‰£J&RðkÍpµ¬¬�´HA§e•6mÜÂÉQ2p_¹kØ7Øæ’¯!ò9Lò–Æû¼Ã1ó
BIN
View File
Binary file not shown.
-2
View File
@@ -1,2 +0,0 @@
PRST1xœ%ÎK
Ã0 Ы”éÖ‹$ýâ«”ÜFn Ž›PJï^ÇÖæI£Í|Áf&hlFæÃ6¹HPXLŒ$œãÀù|d…~àhË WxŠ{O‘iÍ�®iFòæÝî»I1@GI¤À-tޏ«œ*çÊ¥r­Ü*÷Â"Á:Oƒs�¶´ò”{␍Bv/ÃÉûþ÷½8ù
+1 -1
View File
@@ -1 +1 @@
{"1": {"name": "default", "type": "zones", "zones": ["1", "8", "9", "10", "11", "12", "13"], "scenes": [], "palette_id": "1"}, "2": {"name": "test", "type": "zones", "zones": ["6", "7"], "scenes": [], "palette_id": "12"}} {"1": {"name": "default", "type": "zones", "zones": ["1"], "scenes": [], "palette_id": "1", "id": "1"}}
+1 -22
View File
@@ -1,22 +1 @@
{ {}
"1": {
"name": "Default Scene",
"sequences": [
"1"
],
"groups": [
"1"
]
},
"2": {
"name": "Party Mode",
"sequences": [
"1",
"2"
],
"groups": [
"1",
"2"
]
}
}
+1 -1
View File
@@ -1 +1 @@
{"1": {"name": "Main Group", "zone_id": null, "loop": true, "repeat_count": 0, "steps": [{"preset_id": "1", "duration_s": 3.0}, {"preset_id": "2", "duration_s": 3.0}], "active": false}, "2": {"name": "Accent Group", "zone_id": null, "loop": true, "repeat_count": 0, "steps": [{"preset_id": "2", "duration_s": 2.0}, {"preset_id": "3", "duration_s": 2.0}], "active": false}} {}
+1 -1
View File
@@ -1 +1 @@
{"1": {"name": "mirror", "names": ["mirror", "mirror", "mirror", "mirror"], "presets": [["4", "2", "3"], ["14", "5", "9"], ["42", "39", "40"], ["38", "55", "43"], ["44", "45", "46"], ["64", "50", "47"], ["49", "54", "58"], ["59", "41", "57"]], "presets_flat": ["4", "2", "3", "14", "5", "9", "42", "39", "40", "38", "55", "43", "44", "45", "46", "64", "50", "47", "49", "54", "58", "59", "41", "57"], "default_preset": "5"}, "2": {"name": "default", "names": ["1", "2", "3", "4", "5", "6", "7", "8", "0", "a"], "presets": [["16", "17", "18"], ["19", "20", "21"], ["22", "23", "24"], ["25", "26", "27"], ["28", "29", "30"]], "presets_flat": ["16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30"]}, "3": {"name": "default", "names": ["1"], "presets": [], "default_preset": null}, "4": {"name": "default", "names": ["1"], "presets": [], "default_preset": null}, "5": {"name": "dj", "names": ["dj"], "presets": [["31", "32", "33"]], "default_preset": "31", "presets_flat": ["31", "32", "33"]}, "6": {"name": "default", "names": ["1"], "presets": [], "default_preset": null, "presets_flat": []}, "7": {"name": "dj", "names": ["dj"], "presets": [["34", "35", "36"]], "default_preset": "34", "presets_flat": ["34", "35", "36"]}, "8": {"name": "dj", "names": ["dj"], "presets": [["1", "2", "3"], ["4", "5", "66"], ["63", "65", "11"], ["67"]], "default_preset": "11", "presets_flat": ["1", "2", "3", "4", "5", "66", "63", "65", "11", "67"]}, "9": {"name": "roof", "names": ["roof", "roof", "roof", "roof"], "presets": [["5", "3", "42"], ["2", "1", "55"], ["4", "11", "9"], ["6"]], "default_preset": "3", "presets_flat": ["5", "3", "42", "2", "1", "55", "4", "11", "9", "6"]}, "10": {"name": "inner", "names": ["inner"], "presets": [["3", "46", "7"], ["55", "54", "37"], ["1", "2", "5"], ["6"]], "default_preset": "7", "presets_flat": ["3", "46", "7", "55", "54", "37", "1", "2", "5", "6"]}, "11": {"name": "outer", "names": ["outer"], "presets": [["3", "46", "7"], ["55", "54", "37"], ["2", "1"]], "default_preset": "46", "presets_flat": ["3", "46", "7", "55", "54", "37", "2", "1"]}, "12": {"name": "speakers", "names": ["speaker1", "speaker2", "speaker4", "speaker3", "speaker8", "speaker5", "speaker7", "speaker6", "speaker10", "speaker9"], "presets": [["4", "2", "41"], ["64", "3", "14"], ["5", "42", "40"], ["43", "45", "46"], ["47", "49", "54"], ["55", "59"]], "default_preset": "4", "presets_flat": ["4", "2", "41", "64", "3", "14", "5", "42", "40", "43", "45", "46", "47", "49", "54", "55", "59"]}, "13": {"name": "alleyway", "names": ["alleyway"], "presets": [["4", "2", "3"], ["14", "5", "9"], ["42", "39", "40"], ["38", "41", "43"], ["44", "45", "46"], ["50", "47", "49"], ["54", "55", "57"], ["58", "59"]], "default_preset": "4", "presets_flat": ["4", "2", "3", "14", "5", "9", "42", "39", "40", "38", "41", "43", "44", "45", "46", "50", "47", "49", "54", "55", "57", "58", "59"]}} {"1": {"name": "default", "names": ["1"], "presets": [["1", "2", "3", "4", "5", "6", "7", "8"]], "presets_flat": ["1", "2", "3", "4", "5", "6", "7", "8"], "default_preset": "1", "id": "1", "group_ids": [], "preset_group_ids": {}, "sequence_ids": [], "content_kind": "presets"}}
+1 -1
View File
@@ -90,7 +90,7 @@ A profile is `{name, type: "zones", zones: [zone ids], scenes, palette_id}`.
| GET | `/profiles/<id>/export` | Profile bundle (see Import and export) | | GET | `/profiles/<id>/export` | Profile bundle (see Import and export) |
| POST | `/profiles/import` | Body: `{"bundle": {...}, "name"?, "apply"? (default true)}` or the bundle itself. Reply `{"<id>": profile, "id": "<id>"}`, 201 | | POST | `/profiles/import` | Body: `{"bundle": {...}, "name"?, "apply"? (default true)}` or the bundle itself. Reply `{"<id>": profile, "id": "<id>"}`, 201 |
A new profile gets an empty palette, eight presets (`on`, `off`, `rainbow` (`colour_cycle`), `Colour Cycle`, `transition`, `flicker`, `flame`, `twinkle`) and a zone `default` that lists them and names driver `1`. With `seed_dj_zone` it also gets three `DJ …` presets in a zone `dj` naming driver `dj`. A store with no profile gets one at boot, `default`, with the same seed and a starter palette. A new profile gets an empty palette, eight presets (`on`, `off`, `rainbow` (`colour_cycle`), `Colour Cycle`, `transition`, `flicker`, `flame`, `twinkle`) and a zone `default` that lists them and names driver `1`. With `seed_dj_zone` it also gets three `DJ …` presets in a zone `dj` naming driver `dj`.
## Presets — `/presets` ## Presets — `/presets`
+1
View File
@@ -510,6 +510,7 @@ esp_err_t api_register(httpd_handle_t server)
{ {
store_lock(); store_lock();
api_settings_defaults(); api_settings_defaults();
api_seed_defaults();
api_migrate_sequences(); api_migrate_sequences();
api_migrate_zones(); api_migrate_zones();
api_migrate_groups(); api_migrate_groups();
+1
View File
@@ -54,6 +54,7 @@ bool api_preset_in_profile(const cJSON *rec);
// Bring records written by older versions into the current shape (at boot) // Bring records written by older versions into the current shape (at boot)
void api_migrate_sequences(void); void api_migrate_sequences(void);
void api_seed_defaults(void);
void api_migrate_zones(void); void api_migrate_zones(void);
void api_migrate_groups(void); void api_migrate_groups(void);
+38 -15
View File
@@ -222,28 +222,20 @@ static bool truthy(const cJSON *v)
return cJSON_IsTrue(v) || (cJSON_IsNumber(v) && v->valuedouble != 0); return cJSON_IsTrue(v) || (cJSON_IsNumber(v) && v->valuedouble != 0);
} }
// POST /profiles: the profile, an empty palette, the seed presets and a "default" zone (plus a "dj" // The profile with fields applied, the palette (taken over), the seed presets and a "default" zone
// zone with seed_dj_zone) // (plus a "dj" zone with dj), all saved; returns the profile, its id in pid
static esp_err_t create_profile(httpd_req_t *req) static cJSON *seed_profile(const cJSON *fields, cJSON *palette, bool dj, char *pid, size_t plen)
{ {
cJSON *body = api_body(req); char palid[16], zid[16], djid[16];
if (!body) { api_add("palette", palette, palid, sizeof(palid));
return ESP_OK;
}
bool dj = truthy(cJSON_GetObjectItem(body, "seed_dj_zone"));
cJSON_DeleteItemFromObject(body, "seed_dj_zone");
char palid[16], pid[16], zid[16], djid[16];
api_add("palette", cJSON_CreateArray(), palid, sizeof(palid));
cJSON *prof = cJSON_CreateObject(); cJSON *prof = cJSON_CreateObject();
cJSON_AddStringToObject(prof, "name", ""); cJSON_AddStringToObject(prof, "name", "");
cJSON_AddStringToObject(prof, "type", "zones"); cJSON_AddStringToObject(prof, "type", "zones");
cJSON_AddArrayToObject(prof, "zones"); cJSON_AddArrayToObject(prof, "zones");
cJSON_AddArrayToObject(prof, "scenes"); cJSON_AddArrayToObject(prof, "scenes");
api_merge(prof, body); api_merge(prof, fields);
cJSON_Delete(body);
api_set(prof, "palette_id", cJSON_CreateString(palid)); api_set(prof, "palette_id", cJSON_CreateString(palid));
api_add("profile", prof, pid, sizeof(pid)); api_add("profile", prof, pid, plen);
cJSON *zones = cJSON_CreateArray(); cJSON *zones = cJSON_CreateArray();
seed_zone(pid, "default", "1", true, SEED, sizeof(SEED) / sizeof(SEED[0]), zid, sizeof(zid)); seed_zone(pid, "default", "1", true, SEED, sizeof(SEED) / sizeof(SEED[0]), zid, sizeof(zid));
@@ -257,10 +249,41 @@ static esp_err_t create_profile(httpd_req_t *req)
store_save("preset"); store_save("preset");
store_save("zone"); store_save("zone");
store_save("profile"); store_save("profile");
return prof;
}
// POST /profiles: seed_profile with an empty palette ("dj" zone with seed_dj_zone)
static esp_err_t create_profile(httpd_req_t *req)
{
cJSON *body = api_body(req);
if (!body) {
return ESP_OK;
}
bool dj = truthy(cJSON_GetObjectItem(body, "seed_dj_zone"));
cJSON_DeleteItemFromObject(body, "seed_dj_zone");
char pid[16];
cJSON *prof = seed_profile(body, cJSON_CreateArray(), dj, pid, sizeof(pid));
cJSON_Delete(body);
engine_groups_changed(); engine_groups_changed();
return send_keyed(req, "201 Created", pid, prof); return send_keyed(req, "201 Created", pid, prof);
} }
// A store with no profile (first boot, or after an erase) gets one to start from; db/ holds the same records
void api_seed_defaults(void)
{
if (store_coll("profile")->child) {
return;
}
cJSON *fields = cJSON_CreateObject();
cJSON_AddStringToObject(fields, "name", "default");
char pid[16];
seed_profile(fields,
cJSON_Parse("[\"#FF0000\",\"#00FF00\",\"#0000FF\",\"#FFFF00\",\"#FF00FF\",\"#00FFFF\",\"#FFFFFF\",\"#000000\"]"),
false, pid, sizeof(pid));
cJSON_Delete(fields);
}
static const cJSON *profile_zones(const cJSON *prof) static const cJSON *profile_zones(const cJSON *prof)
{ {
const cJSON *z = cJSON_GetObjectItem(prof, "zones"); const cJSON *z = cJSON_GetObjectItem(prof, "zones");