Compare commits
47
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5a7fc575f | ||
|
|
827eb97203 | ||
|
|
3cca0cffc5 | ||
|
|
d36828bde2 | ||
|
|
ed0048c795 | ||
|
|
b316edbaf9 | ||
|
|
c1b0c41ef2 | ||
|
|
3bb75d49de | ||
|
|
3d77cb448a | ||
|
|
49383c0003 | ||
|
|
7d821b9c1c | ||
|
|
9b7e387ea6 | ||
|
|
b4f0d1891e | ||
|
|
0da30b6d6b | ||
|
|
6cbb728d9a | ||
|
|
ff92451a76 | ||
|
|
60485bc06a | ||
|
|
f6f299c3e5 | ||
|
|
66485f5c59 | ||
|
|
5f9ff9bcc9 | ||
|
|
35730b36f0 | ||
|
|
d516833cc3 | ||
|
|
220be64dec | ||
|
|
b433477c64 | ||
|
|
43b7047c57 | ||
|
|
167417d1ec | ||
|
|
fb8141b320 | ||
|
|
96712dda88 | ||
|
|
f5a7b42e7c | ||
|
|
1b1e9d727e | ||
|
|
668d29b786 | ||
|
|
e5f42e099e | ||
|
|
a9edda38ef | ||
|
|
edec5ff460 | ||
|
|
264eb7296f | ||
|
|
fbd4295302 | ||
|
|
7bdb324ebc | ||
|
|
28b19b5219 | ||
|
|
75ddd559c9 | ||
|
|
5a1067263a | ||
|
|
e67de6215a | ||
|
|
7179b6531e | ||
|
|
fd618d7714 | ||
|
|
d1ffb857c8 | ||
|
|
f8eba0ee7e | ||
|
|
e6b5bf2cf1 | ||
|
|
fbae75b957 |
No files matched your search
@@ -0,0 +1,45 @@
|
|||||||
|
---
|
||||||
|
description: led-driver — MicroPython ESP32: mpremote, imports, layout, I/O, no pycache in src
|
||||||
|
globs: led-driver/**
|
||||||
|
alwaysApply: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# led-driver (MicroPython / ESP32)
|
||||||
|
|
||||||
|
## Device and tests
|
||||||
|
|
||||||
|
1. Validate **MicroPython behaviour** under **`led-driver/`** with **`mpremote connect <PORT> …`** on the chip. Host **`python3`** does **not** prove the firmware build.
|
||||||
|
|
||||||
|
2. **Execution target is fixed:** treat **`led-driver/`** code as firmware that runs **only on MicroPython ESP32 devices**. Do **not** run `led-driver/src/main.py` (or other firmware modules) with host CPython as a normal execution path.
|
||||||
|
|
||||||
|
3. **Flow:** `mpremote connect <PORT> cp <local> :<on-flash>` then `run <script>.py`. Inline commands only — no **`.sh`** wrappers unless the user asks. Default serial placeholder: **`/dev/ttyACM0`**.
|
||||||
|
|
||||||
|
4. Checks that **import and run** code from **`led-driver/src/`** belong in **`led-driver/tests/`** and run with **`mpremote run …`**. **Do not** add **`pytest`** under **`led-controller/tests/`** that **`sys.path`**-loads **`led-driver/src`** and runs those modules on CPython.
|
||||||
|
|
||||||
|
## Import layout
|
||||||
|
|
||||||
|
4. **No** **`sys.path.insert`**, **`__file__`** path stitching, or other import-path hacks under **`led-driver/`**. Use device flash search path, or host **`PYTHONPATH`** / layout you control.
|
||||||
|
|
||||||
|
5. **No** “import fixer” code — fix copy order, flash paths, or env instead.
|
||||||
|
|
||||||
|
## Imports (fail loudly)
|
||||||
|
|
||||||
|
6. If a dependency does not load, **crash** and fix deployment or filesystem. **Do not** catch **`ImportError`** / **`ModuleNotFoundError`** around **`import`** / **`from … import`** for app/firmware modules (`settings`, `utils`, `network`, `machine`, …).
|
||||||
|
|
||||||
|
7. **Allowed — stdlib name pairs only** (MicroPython vs CPython): one **`except ImportError`**, then **one** fallback import, **no** extra logic in **`except`**:
|
||||||
|
- `uos` → `os`
|
||||||
|
- `ubinascii` → `binascii`
|
||||||
|
- `utime` → `time`
|
||||||
|
Not for “maybe the file exists on flash” — only different **stdlib** names.
|
||||||
|
|
||||||
|
8. **No** large inline reimplementations after **`except ImportError`** — deploy the real module.
|
||||||
|
|
||||||
|
## I/O
|
||||||
|
|
||||||
|
9. Non-blocking **recv** / **accept**: use plain **`except OSError:`** (or **break** on empty). **No** errno / EAGAIN / EWOULDBLOCK tables or **`getattr(errno, …)`** unless fixing a **documented** target bug.
|
||||||
|
|
||||||
|
10. Minimal **`try` / `except OSError`** around optional socket options (e.g. **`SO_REUSEADDR`**) is fine.
|
||||||
|
|
||||||
|
## Host Python and `src/`
|
||||||
|
|
||||||
|
11. **Do not** leave **`__pycache__/`** or **`.pyc`** under **`led-driver/src/`** from host runs. Remove if created; **`.gitignore`** already ignores it. Prefer **`PYTHONDONTWRITEBYTECODE=1`** or **`-B`** when host Python must touch **`led-driver/src/`**.
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
---
|
||||||
|
description: Require test pattern, pattern metadata, and test preset for new patterns
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Pattern workflow requirements
|
||||||
|
|
||||||
|
1. When creating a new pattern under `led-driver/src/patterns/`, also add/update a corresponding test file in `led-driver/tests/patterns/`.
|
||||||
|
|
||||||
|
2. When adding a new pattern, ensure led-controller has `db/pattern.json`; if it does not exist, create it. Add the new pattern metadata and parameter mappings there.
|
||||||
|
|
||||||
|
3. When adding a new pattern, add at least one test preset entry in `db/preset.json` in led-controller that uses the new pattern.
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
description: Fix only the issue or task the user gave; no refactors unless requested
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Scoped fixes (no overscoping)
|
||||||
|
|
||||||
|
1. **Change only what is needed** to satisfy the user’s *current* request (bug, error, feature, or explicit follow-up). Prefer the smallest diff that fixes it.
|
||||||
|
|
||||||
|
2. **Refactors:** Do **not** refactor (restructure, rename, extract functions, change abstractions, or “make it nicer”) **unless the user explicitly asked for a refactor**. A bug fix may touch nearby lines only as much as required to correct the bug.
|
||||||
|
|
||||||
|
3. **Do not** rename, reformat, or “clean up” unrelated code; do not add extra error handling, logging, or features you were not asked for.
|
||||||
|
|
||||||
|
4. **Related issues:** If you spot other problems (missing functions, wrong types elsewhere, style), you may **mention them in prose** — do **not** fix them unless the user explicitly asks.
|
||||||
|
|
||||||
|
5. **Tests and docs:** Add or change tests or documentation **only** when the user asked for them or they are strictly required to verify the requested fix.
|
||||||
|
|
||||||
|
6. **Multiple distinct fixes:** If the user reported one error (e.g. a single `TypeError`), fix **that** cause first. Offer to tackle follow-ups separately rather than bundling.
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
description: enforce strict user-scoped changes only
|
||||||
|
alwaysApply: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# Strict User Scope
|
||||||
|
|
||||||
|
1. Only implement exactly what the user asked for in the current message.
|
||||||
|
|
||||||
|
2. Do not add extra refactors, cleanups, renames, architecture changes, or behavioural changes unless the user explicitly asked for them.
|
||||||
|
|
||||||
|
3. If a potential improvement is noticed, mention it briefly and ask before changing code.
|
||||||
|
|
||||||
|
4. For revert/undo requests, perform the narrowest possible revert and do not modify anything else.
|
||||||
|
|
||||||
|
5. Keep edits minimal and local to the requested area.
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
# Python
|
# Python
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
# led-driver/src is MicroPython source — never keep host __pycache__ there (see .cursor/rules/led-driver.mdc)
|
||||||
|
led-driver/src/__pycache__/
|
||||||
*.py[cod]
|
*.py[cod]
|
||||||
*$py.class
|
*$py.class
|
||||||
*.so
|
*.so
|
||||||
@@ -23,8 +25,11 @@ ENV/
|
|||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
# Project specific
|
# Project specific
|
||||||
|
scripts/.led-controller-venv
|
||||||
docs/.help-print.html
|
docs/.help-print.html
|
||||||
settings.json
|
settings.json
|
||||||
*.log
|
*.log
|
||||||
*.db
|
*.db
|
||||||
*.sqlite
|
*.sqlite
|
||||||
|
.pytest_cache/
|
||||||
|
.ropeproject/
|
||||||
@@ -4,3 +4,6 @@
|
|||||||
[submodule "led-tool"]
|
[submodule "led-tool"]
|
||||||
path = led-tool
|
path = led-tool
|
||||||
url = git@git.technical.kiwi:technicalkiwi/led-tool.git
|
url = git@git.technical.kiwi:technicalkiwi/led-tool.git
|
||||||
|
[submodule "led-simulator"]
|
||||||
|
path = led-simulator
|
||||||
|
url = git@git.technical.kiwi:technicalkiwi/led-simulator.git
|
||||||
@@ -13,12 +13,13 @@ requests = "*"
|
|||||||
selenium = "*"
|
selenium = "*"
|
||||||
adafruit-ampy = "*"
|
adafruit-ampy = "*"
|
||||||
microdot = "*"
|
microdot = "*"
|
||||||
|
websockets = "*"
|
||||||
|
|
||||||
[dev-packages]
|
[dev-packages]
|
||||||
pytest = "*"
|
pytest = "*"
|
||||||
|
|
||||||
[requires]
|
[requires]
|
||||||
python_version = "3.12"
|
python_version = "3.11"
|
||||||
|
|
||||||
[scripts]
|
[scripts]
|
||||||
web = "python /home/pi/led-controller/tests/web.py"
|
web = "python /home/pi/led-controller/tests/web.py"
|
||||||
|
|||||||
Generated
+397
-329
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"_meta": {
|
"_meta": {
|
||||||
"hash": {
|
"hash": {
|
||||||
"sha256": "6cec0fe6dec67c9177363a558131f333153b6caa47e1ddeca303cb0d19954cf8"
|
"sha256": "98da2012e549e7b62ed49a5e1717acaf535b71e8df61bf4108d25b9023be612e"
|
||||||
},
|
},
|
||||||
"pipfile-spec": 6,
|
"pipfile-spec": 6,
|
||||||
"requires": {
|
"requires": {
|
||||||
"python_version": "3.12"
|
"python_version": "3.11"
|
||||||
},
|
},
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
@@ -42,112 +42,112 @@
|
|||||||
},
|
},
|
||||||
"bitarray": {
|
"bitarray": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:004d518fa410e6da43386d20e07b576a41eb417ac67abf9f30fa75e125697199",
|
"sha256:0256d57e294414bfe4fec4f852fd1d9ae361228c71b082332bf81c8b8fc69f80",
|
||||||
"sha256:014df8a9430276862392ac5d471697de042367996c49f32d0008585d2c60755a",
|
"sha256:03fe327549f177040b32f7faa736dc152be936d8b264d8b84f94c75f1379bfa1",
|
||||||
"sha256:01c5f0dc080b0ebb432f7a68ee1e88a76bd34f6d89c9568fcec65fb16ed71f0e",
|
"sha256:07626f76a248fce5ebbb10fb0d4899d3c7f908ba21cb2fb4f5a7a9daf24c20cd",
|
||||||
"sha256:025d133bf4ca8cf75f904eeb8ea946228d7c043231866143f31946a6f4dd0bf3",
|
"sha256:0793c51d3b1c7410bde1f7254fff71fabff1bc0cdeba1fa51319ac4e7931df3d",
|
||||||
"sha256:0ca70ccf789446a6dfde40b482ec21d28067172cd1f8efd50d5548159fccad9e",
|
"sha256:0a33f8931ac91ebc23ce4decb99ed8fdddba2bafd2af3bb2781bcfd9878d4822",
|
||||||
"sha256:0df69d26f21a9d2f1b20266f6737fa43f08aa5015c99900fb69f255fbe4dabb4",
|
"sha256:0a661f3492462e7adf8a054fb7414a22fc8251f1e18b9d8cbcf008d2dc85f012",
|
||||||
"sha256:0f8069a807a3e6e3c361ce302ece4bf1c3b49962c1726d1d56587e8f48682861",
|
"sha256:0c8c66f5d8055cb84ad0ea14af57b3579cb0b6db589f2086f5e33f0922cf2354",
|
||||||
"sha256:15a2eff91f54d2b1f573cca8ca6fb58763ce8fea80e7899ab028f3987ef71cd5",
|
"sha256:0da5f17bed67ffe1d72f79fbf98403513a6e51a4f9b8293c1ff8a64e121242be",
|
||||||
"sha256:15e8d0597cc6e8496de6f4dea2a6880c57e1251502a7072f5631108a1aa28521",
|
"sha256:0f099a4a77daf9bb99787070854894fe588c7d6988ea729f970ba2b3b82c7559",
|
||||||
"sha256:165052a0e61c880f7093808a0c524ce1b3555bfa114c0dfb5c809cd07918a60d",
|
"sha256:10c0caabff00ab0631d1e4fd25f56c7a5cf0f068426e5860d28dbbb972b509bf",
|
||||||
"sha256:178c5a4c7fdfb5cd79e372ae7f675390e670f3732e5bc68d327e01a5b3ff8d55",
|
"sha256:133648c3405564e7fef9103f1768cb018de1b4976f3d8beff09cd4acea73bfe4",
|
||||||
"sha256:18214bac86341f1cc413772e66447d6cca10981e2880b70ecaf4e826c04f95e9",
|
"sha256:154a19e1dcd430494fdad7d1a0fb36383baaa363e1cb9d5a7b744cd2418c44d2",
|
||||||
"sha256:1a54d7e7999735faacdcbe8128e30207abc2caf9f9fd7102d180b32f1b78bfce",
|
"sha256:18f3a2c8908e63a66d3994808254397a5f989b1fb91087c33739f62bf1a1a064",
|
||||||
"sha256:1a926fa554870642607fd10e66ee25b75fdd9a7ca4bbffa93d424e4ae2bf734a",
|
"sha256:190a3482818d69faef176171c7cae10d55cb4dd0c686b5aced7f592b5e5591c1",
|
||||||
"sha256:1c8f2a5d8006db5a555e06f9437e76bf52537d3dfd130cb8ae2b30866aca32c9",
|
"sha256:190b20cbffc9cd7f308f7a57d406119c3af3ae197613325fd2d92d99c8882ad6",
|
||||||
"sha256:21ca6a47bf20db9e7ad74ca04b3d479e4d76109b68333eb23535553d2705339e",
|
"sha256:1d7b786a1ddd9b8dda17c445060a94a465cba2e113603ae7bdc5364efc1efd11",
|
||||||
"sha256:22c540ed20167d3dbb1e2d868ca935180247d620c40eace90efa774504a40e3b",
|
"sha256:20e412527ec1aac7e3a6542b32a9c34bb852c954676b05008f0e3d58c390a0ac",
|
||||||
"sha256:239578587b9c29469ab61149dda40a2fe714a6a4eca0f8ff9ea9439ec4b7bc30",
|
"sha256:21add0aa968496a2bd8341d85720d09808e22e0adc7dbefc1e0f8f67c4b83f36",
|
||||||
"sha256:25b9cff6c9856bc396232e2f609ea0c5ec1a8a24c500cee4cca96ba8a3cd50b6",
|
"sha256:2762db8049b230520358ac742cbc57bceaacebe34e5d25c096f2b4bc3887a3a8",
|
||||||
"sha256:26714898eb0d847aac8af94c4441c9cb50387847d0fe6b9fc4217c086cd68b80",
|
"sha256:29c8c10a49d6a9586f592116618b99c3dabcb24d881b7a649e0691ef87f314c4",
|
||||||
"sha256:28a85b056c0eb7f5d864c0ceef07034117e8ebfca756f50648c71950a568ba11",
|
"sha256:2b9916867fa1ed815739e3e37dda458f397dee25a0e293b808839cfc2a396ca0",
|
||||||
"sha256:2a3d1b05ffdd3e95687942ae7b13c63689f85d3f15c39b33329e3cb9ce6c015f",
|
"sha256:2da2ca9495668ab77132a911f6bd530d2bfe686d10467584894efc3b66e9ffb5",
|
||||||
"sha256:2c3bb96b6026643ce24677650889b09073f60b9860a71765f843c99f9ab38b25",
|
"sha256:2dc07dab252c63c4f6600e200b26fa05207db6b650d41ae88ab0cec4d6c59459",
|
||||||
"sha256:2fa23fdb3beab313950bbb49674e8a161e61449332d3997089fe3944953f1b77",
|
"sha256:300e3026d17ae3328320ba78d3165bdb1c43d0dfdbc461a69ebbdc005d9ce0b3",
|
||||||
"sha256:2fe8c54b15a9cd4f93bc2aaceab354ec65af93370aa1496ba2f9c537a4855ee0",
|
"sha256:30d42c34da2974a5e2e0b51c57ecf89892c1e83ed67e1084d1e27eefc27add91",
|
||||||
"sha256:30989a2451b693c3f9359d91098a744992b5431a0be4858f1fdf0ec76b457125",
|
"sha256:329b994944993c45c3845047476ef4f231fe1a53972f18f8d005fd12fac163e1",
|
||||||
"sha256:31a4ad2b730128e273f1c22300da3e3631f125703e4fee0ac44d385abfb15671",
|
"sha256:3a5e594b4be2dbfe021cee8d6d7d96e9bb19dee7ed7be351f43bca7a0619b978",
|
||||||
"sha256:337c8cd46a4c6568d367ed676cbf2d7de16f890bb31dbb54c44c1d6bb6d4a1de",
|
"sha256:3b9358f6437a5fa0c765ffae5810c9830547baf4bcf469438b82845c3f33f998",
|
||||||
"sha256:33af25c4ff7723363cb8404dfc2eefeab4110b654f6c98d26aba8a08c745d860",
|
"sha256:3b9790ae107fc8648155f120e80a58ef8e94424efefff5b355de84061de6a18b",
|
||||||
"sha256:3ea52df96566457735314794422274bd1962066bfb609e7eea9113d70cf04ffe",
|
"sha256:40d1b57012bf9b4fefd25345aaa95aab3ca510cc693f33c2cb02a4b771d8e51a",
|
||||||
"sha256:3eae38daffd77c9621ae80c16932eea3fb3a4af141fb7cc724d4ad93eff9210d",
|
"sha256:430fe5150816445c8294a36ce2612360037342d750cea179efe5de38c66670a8",
|
||||||
"sha256:41b53711f89008ba2de62e4c2d2260a8b357072fd4f18e1351b28955db2719dc",
|
"sha256:4494c599effa16064f2b600f6eb28115182d6826847d795a55691339788d8a4d",
|
||||||
"sha256:451f9958850ea98440d542278368c8d1e1ea821e2494b204570ba34a340759df",
|
"sha256:478b9f0ea86f957624dd2b159066855716f78db94666e9b04babe85fc013e01b",
|
||||||
"sha256:46cf239856b87fe1c86dfbb3d459d840a8b1649e7922b1e0bfb6b6464692644a",
|
"sha256:4b7d7d10a1c82050efbb9a83d7a43974f70cf8f021afb86463b42e4ac4e5a46b",
|
||||||
"sha256:4779f356083c62e29b4198d290b7b17a39a69702d150678b7efff0fdddf494a8",
|
"sha256:4c7ce072191ba23a4a4876452ccd5f2a67b926e66a248d052d39e9969cd3ab47",
|
||||||
"sha256:4902f4ecd5fcb6a5f482d7b0ae1c16c21f26fc5279b3b6127363d13ad8e7a9d9",
|
"sha256:4da256fc567a57ded2a4aa962fc9e9d430ab740e5c67be9e98a63ef4eb467f2f",
|
||||||
"sha256:4d73d4948dcc5591d880db8933004e01f1dd2296df9de815354d53469beb26fe",
|
"sha256:4e34f1cb6cdb036c5f4a839a2b74419f75fa36177a70c4bab2867f48973cbe44",
|
||||||
"sha256:4d9984017314da772f5f7460add7a0301a4ffc06c72c2998bb16c300a6253607",
|
"sha256:4fb869faf4b484cb213199ced1e2732091559107637d429fc25d0a9731f5f630",
|
||||||
"sha256:4f298daaaea58d45e245a132d6d2bdfb6f856da50dc03d75ebb761439fb626cf",
|
"sha256:539880ddf9a8cc54c9e6126e7d072c991563f0c90ef73b3519a783d53df00352",
|
||||||
"sha256:50ddbe3a7b4b6ab96812f5a4d570f401a2cdb95642fd04c062f98939610bbeee",
|
"sha256:55f4b105a1686eb486069a9e578d502d1998e890d8144012225de9e0450aeabd",
|
||||||
"sha256:5338a313f998e1be7267191b7caaae82563b4a2b42b393561055412a34042caa",
|
"sha256:5743f532e408cfd716fa16776b5a6447b83ff2cf39021fb5f8d052aa0f331508",
|
||||||
"sha256:5591daf81313096909d973fb2612fccd87528fdfdd39f6478bdce54543178954",
|
"sha256:5b67b869f860eb19055e2560844d8c7d0935245938935bdb764b3e683e2014e2",
|
||||||
"sha256:56896ceeffe25946c4010320629e2d858ca763cd8ded273c81672a5edbcb1e0a",
|
"sha256:5e30d8e399f38ae1ec86aa9be76d20ba15872dd0c41b4b46d1b78905857363b9",
|
||||||
"sha256:58a01ea34057463f7a98a4d6ff40160f65f945e924fec08a5b39e327e372875d",
|
"sha256:660e11b9932f58f10151d0febd11f77d3b0d48d6fa4dd4686d8983f40187101e",
|
||||||
"sha256:5bfac7f236ba1a4d402644bdce47fb9db02a7cf3214a1f637d3a88390f9e5428",
|
"sha256:67125404d12547443d74113862a80c10310cf875aff8dbfc5548fee1d9737123",
|
||||||
"sha256:5c5a8a83df95e51f7a7c2b083eaea134cbed39fc42c6aeb2e764ddb7ccccd43e",
|
"sha256:6956ef0259a037f10da767741aca82925f6f9978bb6dceb5344e56ce0629ab07",
|
||||||
"sha256:5f2fb10518f6b365f5b720e43a529c3b2324ca02932f609631a44edb347d8d54",
|
"sha256:698c37fca3761af69a09a1d39cc0492f7e8cb9e263af39a288dce8f3b8a9e2bc",
|
||||||
"sha256:64af877116edf051375b45f0bda648143176a017b13803ec7b3a3111dc05f4c5",
|
"sha256:69c8298e8197b113f765a2ea60f49ceb8e1ea9eb308140b3cdc611e0d1de70b8",
|
||||||
"sha256:6d70fa9c6d2e955bde8cd327ffc11f2cc34bc21944e5571a46ca501e7eadef24",
|
"sha256:6ef49462a615de062dcac8281944d0b036fe1e9c96a6c690bf6cf5e4b5488f0e",
|
||||||
"sha256:6d79f659965290af60d6acc8e2716341865fe74609a7ede2a33c2f86ad893b8f",
|
"sha256:6f92d12a46b2a67d56194bb5d226dabf586b386d1f1a5e25be5b745a3080dbba",
|
||||||
"sha256:720963fee259291a88348ae9735d9deb5d334e84a016244f61c89f5a49aa400a",
|
"sha256:70f70ea138e69ec3159e4a38fef52443cb8eb81388aeb241b273265ea16387c5",
|
||||||
"sha256:75a3b6e9c695a6570ea488db75b84bb592ff70a944957efa1c655867c575018b",
|
"sha256:72a0e87b2196120523fc6194ca6b580fcffa12d7daa4d57a16d7838e60f82d0e",
|
||||||
"sha256:792462abfeeca6cc8c6c1e6d27e14319682f0182f6b0ba37befe911af794db70",
|
"sha256:72b32d8c471930c95d49640ec99f7694f9b040ca1342ff03ed69d3aea90f9339",
|
||||||
"sha256:79ec4498a545733ecace48d780d22407411b07403a2e08b9a4d7596c0b97ebd7",
|
"sha256:746e25f17ba4203b5933773782cf2d30bca5cdb66a9ba5d48a53a6c795aedc57",
|
||||||
"sha256:7f14d6b303e55bd7d19b28309ef8014370e84a3806c5e452e078e7df7344d97a",
|
"sha256:75e33c9187da271d1dbeb2582ab2df2e441346492098f67559b09173ea4edde4",
|
||||||
"sha256:7f65bd5d4cdb396295b6aa07f84ca659ac65c5c68b53956a6d95219e304b0ada",
|
"sha256:7875abfd90f2ae3aa22d50f3fa1c93bbae456458cc73d3179b838f07bed1fc10",
|
||||||
"sha256:81c6b4a6c1af800d52a6fa32389ef8f4281583f4f99dc1a40f2bb47667281541",
|
"sha256:78ab0d4166cf35c73054d1e04f224af1edc3cb4d75da8b6f74f4cff7c300f358",
|
||||||
"sha256:82a07de83dce09b4fa1bccbdc8bde8f188b131666af0dc9048ba0a0e448d8a3b",
|
"sha256:78cbda57a2808d994517b53571eaa2d9299359f63aa71cf4bc94210169aad8b1",
|
||||||
"sha256:847c7f61964225fc489fe1d49eda7e0e0d253e98862c012cecf845f9ad45cdf4",
|
"sha256:7c133052737c7c75bfa49f5ba71918166fe988995b26a0d2f263a79bf8fed58a",
|
||||||
"sha256:84b52b2cf77bb7f703d16c4007b021078dbbe6cf8ffb57abe81a7bacfc175ef2",
|
"sha256:7eae9e763fbd32f19f2a66dfc2e37906f8422e0c4ad4a6c9dcf9d3246740812e",
|
||||||
"sha256:86685fa04067f7175f9718489ae755f6acde03593a1a9ca89305554af40e14fd",
|
"sha256:814bb54db2a016026efc055a3527461e5eb551c0d91b32eeade003829ff84311",
|
||||||
"sha256:8a9c962c64a4c08def58b9799333e33af94ec53038cf151d36edacdb41f81646",
|
"sha256:81ede1f094f26eeaff62e029ff1bc4e84e9d568f20d4669f64dcf7c7b18a28fc",
|
||||||
"sha256:8cbd4bfc933b33b85c43ef4c1f4d5e3e9d91975ea6368acf5fbac02bac06ea89",
|
"sha256:838fd67b3d00c5a64181073282a2c0bf8f76465da4844d5e79d2dbbc64c987dc",
|
||||||
"sha256:8ffe660e963ae711cb9e2b8d8461c9b1ad6167823837fc17d59d5e539fb898fa",
|
"sha256:89c7c125a0913d71ba9cc1fa8e14c7cfe1517b1c1f45416e1f9babcedd3b545d",
|
||||||
"sha256:94652da1a4ca7cfb69c15dd6986b205e0bd9c63a05029c3b48b4201085f527bd",
|
"sha256:8a345b5dc8ab8cafdf338e08530d48fe3f73df27f4ff569be793c7a7e7bb6b6b",
|
||||||
"sha256:969fd67de8c42affdb47b38b80f1eaa79ac0ef17d65407cdd931db1675315af1",
|
"sha256:8c3fe25871f1758519a3ad8dcafb1bd95c5d1aaeb122e6492ac739ab11fa5907",
|
||||||
"sha256:9858dcbc23ba7eaadcd319786b982278a1a2b2020720b19db43e309579ff76fb",
|
"sha256:8e12d50d4d65c74bd877e15c276992263b878456a7cfcf72521e7205a553557f",
|
||||||
"sha256:99d25aff3745c54e61ab340b98400c52ebec04290a62078155e0d7eb30380220",
|
"sha256:9adacf6fdadeeb96e6c902aef08d02d2f45429fdbf0a75b80307e435156066f8",
|
||||||
"sha256:99f55e14e7c56f4fafe1343480c32b110ef03836c21ff7c48bae7add6818f77c",
|
"sha256:9befda0dbd27ed95fba1c26be4bf98a49ba166b3c91beb5fc04364c130ce950c",
|
||||||
"sha256:9d35d8f8a1c9ed4e2b08187b513f8a3c71958600129db3aa26d85ea3abfd1310",
|
"sha256:9fa5620f7f352f9706924c0e2071a212be36421f09ee064b0fd7e1128289fcdb",
|
||||||
"sha256:a2ba92f59e30ce915e9e79af37649432e3a212ddddf416d4d686b1b4825bcdb2",
|
"sha256:a681bbf9f94027d66e15974cd207cec1a2993837b9c45acf5f6b22a67632b1c2",
|
||||||
"sha256:a2cb35a6efaa0e3623d8272471371a12c7e07b51a33e5efce9b58f655d864b4e",
|
"sha256:ab363a5baae965fb3438f2137583853ad9c77d7e45f2a62ba63e609a34d792ea",
|
||||||
"sha256:a358277122456666a8b2a0b9aa04f1b89d34e8aa41d08a6557d693e6abb6667c",
|
"sha256:ac49519fcfeb4a7ecdf6b7d0ec6cac409e59f94c1bb54630db577a97893b6e38",
|
||||||
"sha256:a60da2f9efbed355edb35a1fb6829148676786c829fad708bb6bb47211b3593a",
|
"sha256:ad5a71c1ef4a2e404c2c888db09226c821d9d14eff8813e1da873572f5fbb89d",
|
||||||
"sha256:aa7dec53c25f1949513457ef8b0ea1fb40e76c672cc4d2daa8ad3c8d6b73491a",
|
"sha256:af01133e78e5528ee282ceb1cf4bc54aecb937c2001913e751452ad7dffbbeb1",
|
||||||
"sha256:b1572ee0eb1967e71787af636bb7d1eb9c6735d5337762c450650e7f51844594",
|
"sha256:b3118ec012a799456f7fca6cc002c078590578b7640fbaab52d8ecb9a651f1c1",
|
||||||
"sha256:b4f10d3f304be7183fac79bf2cd997f82e16aa9a9f37343d76c026c6e435a8a8",
|
"sha256:b46b7aec9272fd81c984e723e599957629a91204120b3e7f0933f138e0792fdf",
|
||||||
"sha256:bbbbfbb7d039b20d289ce56b1beb46138d65769d04af50c199c6ac4cb6054d52",
|
"sha256:ba0339d6aa80615a17f47fabc5700485e9469121d658458f95cdd2003288c28b",
|
||||||
"sha256:c394a3f055b49f92626f83c1a0b6d6cd2c628f1ccd72481c3e3c6aa4695f3b20",
|
"sha256:c08cd5b19c570e1e9e094a6ce70d35bb39d12360e0763474ed9374229f174fcc",
|
||||||
"sha256:c396358023b876cff547ce87f4e8ff8a2280598873a137e8cc69e115262260b8",
|
"sha256:c0b367a00e8c88a714b2384c97dedcc85340547b3a54b6037a42fca5554d0576",
|
||||||
"sha256:c5ba07e58fd98c9782201e79eb8dd4225733d212a5a3700f9a84d329bd0463a6",
|
"sha256:c263ed9922942353a954cfbcd5f81b7626c0e20dc7f3e53d4926e8bc560ab845",
|
||||||
"sha256:c764fb167411d5afaef88138542a4bfa28bd5e5ded5e8e42df87cef965efd6e9",
|
"sha256:c3387c314695f9790dce12fcf44357197ebf773651b6a4195f5e091cf500ae73",
|
||||||
"sha256:cbba763d99de0255a3e4938f25a8579930ac8aa089233cb2fb2ed7d04d4aff02",
|
"sha256:c4fd3399eaf6f1c77ea3132611efbc3d7a8c0eb899793387b3266be221dc75fd",
|
||||||
"sha256:cbd1660fb48827381ce3a621a4fdc237959e1cd4e98b098952a8f624a0726425",
|
"sha256:cac0145491619287ff893853bf3ca4d98d5ef94b617271184a5af68a06ac301a",
|
||||||
"sha256:cd761d158f67e288fd0ebe00c3b158095ce80a4bc7c32b60c7121224003ba70d",
|
"sha256:cd9b848c17ef034f2ae31b2a1bd9276710c2baf03509f1f3fa4dc4382b0a1b53",
|
||||||
"sha256:cdfbb27f2c46bb5bbdcee147530cbc5ca8ab858d7693924e88e30ada21b2c5e2",
|
"sha256:ced27af6aee28782260bfa5643797937e96a6489bca972202834017208cf74f5",
|
||||||
"sha256:d2dbe8a3baf2d842e342e8acb06ae3844765d38df67687c144cdeb71f1bcb5d7",
|
"sha256:cf99e36c0f6ae5643ecef7ad7e1194aeb4a9798d9cff60b20ac041533fa6db0a",
|
||||||
"sha256:d5c931ec1c03111718cabf85f6012bb2815fa0ce578175567fa8d6f2cc15d3b4",
|
"sha256:d7d5f7f6f80388ce94849775da5f4082ab5e123e259972961970e190d60f5d2b",
|
||||||
"sha256:df6d7bf3e15b7e6e202a16ff4948a51759354016026deb04ab9b5acbbe35e096",
|
"sha256:dc2cab92c42991b711132bc52405680e075d1505d4356c4468bc6e9c93d49137",
|
||||||
"sha256:dfbe2aa45b273f49e715c5345d94874cb65a28482bf231af408891c260601b8d",
|
"sha256:ddcd25a1f72b2b545fb27e17882046a6c161f3f24514b2e028c00c58ed73a2dd",
|
||||||
"sha256:e12769d3adcc419e65860de946df8d2ed274932177ac1cdb05186e498aaa9149",
|
"sha256:defa3c12cb06b2fd2066a9e21bf00aab96465be84d9585c8c05195f080510506",
|
||||||
"sha256:e5aed4754895942ae15ffa48c52d181e1c1463236fda68d2dba29c03aa61786b",
|
"sha256:df3ffa6ef88166bb36f5d1492e71e664868b9b8b6afd55821e0ac0cb96625441",
|
||||||
"sha256:e645b4c365d6f1f9e0799380ad6395268f3c3b898244a650aaeb8d9d27b74c35",
|
"sha256:e127b2e7fc533728295196f9265d12834530f475bc6cd6f74619df415d04b8b1",
|
||||||
"sha256:ed3493a369fe849cce98542d7405c88030b355e4d2e113887cb7ecc86c205773",
|
"sha256:e9ff57452fcadfd1a379314234657b8f4e9967ae64480ddf7c2fd82139bc8cf8",
|
||||||
"sha256:f08342dc8d19214faa7ef99574dea6c37a2790d6d04a9793ef8fa76c188dc08d",
|
"sha256:eb9fa02b9f5bbdb1d036a0c68999337793fa244528e0ce825e4b97cb7f7db99f",
|
||||||
"sha256:f0a55cf02d2cdd739b40ce10c09bbdd520e141217696add7a48b56e67bdfdfe6",
|
"sha256:ec3d0a6c37a816ea6e3550697c60d90861c9b0f982a98a40b59ac1f7a360bfa9",
|
||||||
"sha256:f0ce9d9e07c75da8027c62b4c9f45771d1d8aae7dc9ad7fb606c6a5aedbe9741",
|
"sha256:ef123b6aead12e0784f72970e8d94a96ac0d0aa4438c7ab9235e2f8669a0a5ae",
|
||||||
"sha256:f1f723e260c35e1c7c57a09d3a6ebe681bd56c83e1208ae3ce1869b7c0d10d4f",
|
"sha256:f90bb3c680804ec9630bcf8c0965e54b4de84d33b17d7da57c87c30f0c64c6f5",
|
||||||
"sha256:f2fcbe9b3a5996b417e030aa33a562e7e20dfc86271e53d7e841fc5df16268b8",
|
"sha256:fb1df55f5700187c6db4b47dbdaf8a0653a111341ac7fccc596b397aa3399e65",
|
||||||
"sha256:f3fd8df63c41ff6a676d031956aebf68ebbc687b47c507da25501eb22eec341f",
|
"sha256:fd68db1a0f5d9374a7b735414efe48d2b3ecbf0adea39299bb48030988f16149",
|
||||||
"sha256:f8d3417db5e14a6789073b21ae44439a755289477901901bae378a57b905e148",
|
"sha256:fd6b5b6df14f98b2e7e474c1c7ea55fc32dcab038b3b34b76a591dec8ba50915",
|
||||||
"sha256:fbf05678c2ae0064fb1b8de7e9e8f0fc30621b73c8477786dd0fb3868044a8c8",
|
"sha256:fd7e3158be382f8f140caccc0dc7742a7553ce4bf2978982abe3054d2cedd705",
|
||||||
"sha256:fc98ff43abad61f00515ad9a06213b7716699146e46eabd256cdfe7cb522bd97",
|
"sha256:fe989bbed9d6f332c1e24d333936f3fa1375f380cd8028da0b985dcdefa6015a",
|
||||||
"sha256:ff1863f037dad765ef5963efc2e37d399ac023e192a6f2bb394e2377d023cefe"
|
"sha256:ff2ca039a161d49a8c713f5380def315c6f793df5fe348b94782b1dbee37a644"
|
||||||
],
|
],
|
||||||
"version": "==3.8.0"
|
"version": "==3.8.1"
|
||||||
},
|
},
|
||||||
"bitstring": {
|
"bitstring": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -159,11 +159,11 @@
|
|||||||
},
|
},
|
||||||
"certifi": {
|
"certifi": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:027692e4402ad994f1c42e52a4997a9763c646b73e4096e4d5d6db8af1d6f0fa",
|
"sha256:3cb2210c8f88ba2318d29b0388d1023c8492ff72ecdde4ebdaddbb13a31b1c4a",
|
||||||
"sha256:e887ab5cee78ea814d3472169153c2d12cd43b14bd03329a39a9c6e2e80bfba7"
|
"sha256:8d455352a37b71bf76a79caa83a3d6c25afee4a385d632127b6afb3963f1c580"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.7'",
|
"markers": "python_version >= '3.7'",
|
||||||
"version": "==2026.2.25"
|
"version": "==2026.4.22"
|
||||||
},
|
},
|
||||||
"cffi": {
|
"cffi": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -257,201 +257,201 @@
|
|||||||
},
|
},
|
||||||
"charset-normalizer": {
|
"charset-normalizer": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:06a7e86163334edfc5d20fe104db92fcd666e5a5df0977cb5680a506fe26cc8e",
|
"sha256:007d05ec7321d12a40227aae9e2bc6dca73f3cb21058999a1df9e193555a9dcc",
|
||||||
"sha256:0c173ce3a681f309f31b87125fecec7a5d1347261ea11ebbb856fa6006b23c8c",
|
"sha256:03853ed82eeebbce3c2abfdbc98c96dc205f32a79627688ac9a27370ea61a49c",
|
||||||
"sha256:0e28d62a8fc7a1fa411c43bd65e346f3bce9716dc51b897fbe930c5987b402d5",
|
"sha256:07d9e39b01743c3717745f4c530a6349eadbfa043c7577eef86c502c15df2c67",
|
||||||
"sha256:0e901eb1049fdb80f5bd11ed5ea1e498ec423102f7a9b9e4645d5b8204ff2815",
|
"sha256:08e721811161356f97b4059a9ba7bafb23ea5ee2255402c42881c214e173c6b4",
|
||||||
"sha256:11afb56037cbc4b1555a34dd69151e8e069bee82e613a73bef6e714ce733585f",
|
"sha256:0c96c3b819b5c3e9e165495db84d41914d6894d55181d2d108cc1a69bfc9cce0",
|
||||||
"sha256:150b8ce8e830eb7ccb029ec9ca36022f756986aaaa7956aad6d9ec90089338c0",
|
"sha256:0ea948db76d31190bf08bd371623927ee1339d5f2a0b4b1b4a4439a65298703c",
|
||||||
"sha256:172985e4ff804a7ad08eebec0a1640ece87ba5041d565fff23c8f99c1f389484",
|
"sha256:0f7eb884681e3938906ed0434f20c63046eacd0111c4ba96f27b76084cd679f5",
|
||||||
"sha256:197c1a244a274bb016dd8b79204850144ef77fe81c5b797dc389327adb552407",
|
"sha256:12a6fff75f6bc66711b73a2f0addfc4c8c15a20e805146a02d147a318962c444",
|
||||||
"sha256:1ae6b62897110aa7c79ea2f5dd38d1abca6db663687c0b1ad9aed6f6bae3d9d6",
|
"sha256:12d8baf840cc7889b37c7c770f478adea7adce3dcb3944d02ec87508e2dcf153",
|
||||||
"sha256:1cf0a70018692f85172348fe06d3a4b63f94ecb055e13a00c644d368eb82e5b8",
|
"sha256:14265bfe1f09498b9d8ec91e9ec9fa52775edf90fcbde092b25f4a33d444fea9",
|
||||||
"sha256:1ed80ff870ca6de33f4d953fda4d55654b9a2b340ff39ab32fa3adbcd718f264",
|
"sha256:16d971e29578a5e97d7117866d15889a4a07befe0e87e703ed63cd90cb348c01",
|
||||||
"sha256:22c6f0c2fbc31e76c3b8a86fba1a56eda6166e238c29cdd3d14befdb4a4e4815",
|
"sha256:177a0ba5f0211d488e295aaf82707237e331c24788d8d76c96c5a41594723217",
|
||||||
"sha256:231d4da14bcd9301310faf492051bee27df11f2bc7549bc0bb41fef11b82daa2",
|
"sha256:1a87ca9d5df6fe460483d9a5bbf2b18f620cbed41b432e2bddb686228282d10b",
|
||||||
"sha256:259695e2ccc253feb2a016303543d691825e920917e31f894ca1a687982b1de4",
|
"sha256:1c2a768fdd44ee4a9339a9b0b130049139b8ce3c01d2ce09f67f5a68048d477c",
|
||||||
"sha256:2a24157fa36980478dd1770b585c0f30d19e18f4fb0c47c13aa568f871718579",
|
"sha256:1c2aed2e5e41f24ea8ef1590b8e848a79b56f3a5564a65ceec43c9d692dc7d8a",
|
||||||
"sha256:2b1a63e8224e401cafe7739f77efd3f9e7f5f2026bda4aead8e59afab537784f",
|
"sha256:1dc8b0ea451d6e69735094606991f32867807881400f808a106ee1d963c46a83",
|
||||||
"sha256:2bd9d128ef93637a5d7a6af25363cf5dec3fa21cf80e68055aad627f280e8afa",
|
"sha256:1efde3cae86c8c273f1eb3b287be7d8499420cf2fe7585c41d370d3e790054a5",
|
||||||
"sha256:2e1d8ca8611099001949d1cdfaefc510cf0f212484fe7c565f735b68c78c3c95",
|
"sha256:202389074300232baeb53ae2569a60901f7efadd4245cf3a3bf0617d60b439d7",
|
||||||
"sha256:2ef7fedc7a6ecbe99969cd09632516738a97eeb8bd7258bf8a0f23114c057dab",
|
"sha256:203104ed3e428044fd943bc4bf45fa73c0730391f9621e37fe39ecf477b128cb",
|
||||||
"sha256:2f7fdd9b6e6c529d6a2501a2d36b240109e78a8ceaef5687cfcfa2bbe671d297",
|
"sha256:2257141f39fe65a3fdf38aeccae4b953e5f3b3324f4ff0daf9f15b8518666a2c",
|
||||||
"sha256:30f445ae60aad5e1f8bdbb3108e39f6fbc09f4ea16c815c66578878325f8f15a",
|
"sha256:298930cec56029e05497a76988377cbd7457ba864beeea92ad7e844fe74cd1f1",
|
||||||
"sha256:31215157227939b4fb3d740cd23fe27be0439afef67b785a1eb78a3ae69cba9e",
|
"sha256:2cd4a60d0e2fb04537162c62bbbb4182f53541fe0ede35cdf270a1c1e723cc42",
|
||||||
"sha256:34315ff4fc374b285ad7f4a0bf7dcbfe769e1b104230d40f49f700d4ab6bbd84",
|
"sha256:2d6eb928e13016cea4f1f21d1e10c1cebd5a421bc57ddf5b1142ae3f86824fab",
|
||||||
"sha256:3516bbb8d42169de9e61b8520cbeeeb716f12f4ecfe3fd30a9919aa16c806ca8",
|
"sha256:2fe249cb4651fd12605b7288b24751d8bfd46d35f12a20b1ba33dea122e690df",
|
||||||
"sha256:3778fd7d7cd04ae8f54651f4a7a0bd6e39a0cf20f801720a4c21d80e9b7ad6b0",
|
"sha256:30b8d1d8c52a48c2c5690e152c169b673487a2a58de1ec7393196753063fcd5e",
|
||||||
"sha256:39f5068d35621da2881271e5c3205125cc456f54e9030d3f723288c873a71bf9",
|
"sha256:320ade88cfb846b8cd6b4ddf5ee9e80ee0c1f52401f2456b84ae1ae6a1a5f207",
|
||||||
"sha256:404a1e552cf5b675a87f0651f8b79f5f1e6fd100ee88dc612f89aa16abd4486f",
|
"sha256:3534e7dcbdcf757da6b85a0bbf5b6868786d5982dd959b065e65481644817a18",
|
||||||
"sha256:419a9d91bd238052642a51938af8ac05da5b3343becde08d5cdeab9046df9ee1",
|
"sha256:36836d6ff945a00b88ba1e4572d721e60b5b8c98c155d465f56ad19d68f23734",
|
||||||
"sha256:423fb7e748a08f854a08a222b983f4df1912b1daedce51a72bd24fe8f26a1843",
|
"sha256:38c0109396c4cfc574d502df99742a45c72c08eff0a36158b6f04000043dbf38",
|
||||||
"sha256:4482481cb0572180b6fd976a4d5c72a30263e98564da68b86ec91f0fe35e8565",
|
"sha256:3946fa46a0cf3e4c8cb1cc52f56bb536310d34f25f01ca9b6c16afa767dab110",
|
||||||
"sha256:461598cd852bfa5a61b09cae2b1c02e2efcd166ee5516e243d540ac24bfa68a7",
|
"sha256:3bec022aec2c514d9cf199522a802bd007cd588ab17ab2525f20f9c34d067c18",
|
||||||
"sha256:47955475ac79cc504ef2704b192364e51d0d473ad452caedd0002605f780101c",
|
"sha256:3c9a494bc5ec77d43cea229c4f6db1e4d8fe7e1bbffa8b6f0f0032430ff8ab44",
|
||||||
"sha256:48696db7f18afb80a068821504296eb0787d9ce239b91ca15059d1d3eaacf13b",
|
"sha256:3dce51d0f5e7951f8bb4900c257dad282f49190fdbebecd4ba99bcc41fef404d",
|
||||||
"sha256:4be9f4830ba8741527693848403e2c457c16e499100963ec711b1c6f2049b7c7",
|
"sha256:3dedcc22d73ec993f42055eff4fcfed9318d1eeb9a6606c55892a26964964e48",
|
||||||
"sha256:4d1d02209e06550bdaef34af58e041ad71b88e624f5d825519da3a3308e22687",
|
"sha256:4042d5c8f957e15221d423ba781e85d553722fc4113f523f2feb7b188cc34c5e",
|
||||||
"sha256:4f41da960b196ea355357285ad1316a00099f22d0929fe168343b99b254729c9",
|
"sha256:481551899c856c704d58119b5025793fa6730adda3571971af568f66d2424bb5",
|
||||||
"sha256:517ad0e93394ac532745129ceabdf2696b609ec9f87863d337140317ebce1c14",
|
"sha256:4dc1e73c36828f982bfe79fadf5919923f8a6f4df2860804db9a98c48824ce8d",
|
||||||
"sha256:51fb3c322c81d20567019778cb5a4a6f2dc1c200b886bc0d636238e364848c89",
|
"sha256:4e5163c14bffd570ef2affbfdd77bba66383890797df43dc8b4cc7d6f500bf53",
|
||||||
"sha256:5273b9f0b5835ff0350c0828faea623c68bfa65b792720c453e22b25cc72930f",
|
"sha256:511ef87c8aec0783e08ac18565a16d435372bc1ac25a91e6ac7f5ef2b0bff790",
|
||||||
"sha256:530d548084c4a9f7a16ed4a294d459b4f229db50df689bfe92027452452943a0",
|
"sha256:532bc9bf33a68613fd7d65e4b1c71a6a38d7d42604ecf239c77392e9b4e8998c",
|
||||||
"sha256:530e8cebeea0d76bdcf93357aa5e41336f48c3dc709ac52da2bb167c5b8271d9",
|
"sha256:54523e136b8948060c0fa0bc7b1b50c32c186f2fceee897a495406bb6e311d2b",
|
||||||
"sha256:54fae94be3d75f3e573c9a1b5402dc593de19377013c9a0e4285e3d402dd3a2a",
|
"sha256:5649fd1c7bade02f320a462fdefd0b4bd3ce036065836d4f42e0de958038e116",
|
||||||
"sha256:572d7c822caf521f0525ba1bce1a622a0b85cf47ffbdae6c9c19e3b5ac3c4389",
|
"sha256:56be790f86bfb2c98fb742ce566dfb4816e5a83384616ab59c49e0604d49c51d",
|
||||||
"sha256:58c948d0d086229efc484fe2f30c2d382c86720f55cd9bc33591774348ad44e0",
|
"sha256:5b77459df20e08151cd6f8b9ef8ef1f961ef73d85c21a555c7eed5b79410ec10",
|
||||||
"sha256:5d11595abf8dd942a77883a39d81433739b287b6aa71620f15164f8096221b30",
|
"sha256:5ed6ab538499c8644b8a3e18debabcd7ce684f3fa91cf867521a7a0279cab2d6",
|
||||||
"sha256:5f8ddd609f9e1af8c7bd6e2aca279c931aefecd148a14402d4e368f3171769fd",
|
"sha256:6178f72c5508bfc5fd446a5905e698c6212932f25bcdd4b47a757a50605a90e2",
|
||||||
"sha256:5feb91325bbceade6afab43eb3b508c63ee53579fe896c77137ded51c6b6958e",
|
"sha256:6370e8686f662e6a3941ee48ed4742317cafbe5707e36406e9df792cdb535776",
|
||||||
"sha256:60c74963d8350241a79cb8feea80e54d518f72c26db618862a8f53e5023deaf9",
|
"sha256:64f02c6841d7d83f832cd97ccf8eb8a906d06eb95d5276069175c696b024b60a",
|
||||||
"sha256:613f19aa6e082cf96e17e3ffd89383343d0d589abda756b7764cf78361fd41dc",
|
"sha256:65bcd23054beab4d166035cabbc868a09c1a49d1efe458fe8e4361215df40265",
|
||||||
"sha256:659a1e1b500fac8f2779dd9e1570464e012f43e580371470b45277a27baa7532",
|
"sha256:66671f93accb62ed07da56613636f3641f1a12c13046ce91ffc923721f23c008",
|
||||||
"sha256:695f5c2823691a25f17bc5d5ffe79fa90972cc34b002ac6c843bb8a1720e950d",
|
"sha256:6696b7688f54f5af4462118f0bfa7c1621eeb87154f77fa04b9295ce7a8f2943",
|
||||||
"sha256:69dd852c2f0ad631b8b60cfbe25a28c0058a894de5abb566619c205ce0550eae",
|
"sha256:6785f414ae0f3c733c437e0f3929197934f526d19dfaa75e18fdb4f94c6fb374",
|
||||||
"sha256:6cceb5473417d28edd20c6c984ab6fee6c6267d38d906823ebfe20b03d607dc2",
|
"sha256:67f6279d125ca0046a7fd386d01b311c6363844deac3e5b069b514ba3e63c246",
|
||||||
"sha256:71be7e0e01753a89cf024abf7ecb6bca2c81738ead80d43004d9b5e3f1244e64",
|
"sha256:6c114670c45346afedc0d947faf3c7f701051d2518b943679c8ff88befe14f8e",
|
||||||
"sha256:74119174722c4349af9708993118581686f343adc1c8c9c007d59be90d077f3f",
|
"sha256:6e0d51f618228538a3e8f46bd246f87a6cd030565e015803691603f55e12afb5",
|
||||||
"sha256:74a2e659c7ecbc73562e2a15e05039f1e22c75b7c7618b4b574a3ea9118d1557",
|
"sha256:6ed74185b2db44f41ef35fd1617c5888e59792da9bbc9190d6c7300617182616",
|
||||||
"sha256:7504e9b7dc05f99a9bbb4525c67a2c155073b44d720470a148b34166a69c054e",
|
"sha256:708838739abf24b2ceb208d0e22403dd018faeef86ddac04319a62ae884c4f15",
|
||||||
"sha256:79090741d842f564b1b2827c0b82d846405b744d31e84f18d7a7b41c20e473ff",
|
"sha256:715479b9a2802ecac752a3b0efa2b0b60285cf962ee38414211abdfccc233b41",
|
||||||
"sha256:7a6967aaf043bceabab5412ed6bd6bd26603dae84d5cb75bf8d9a74a4959d398",
|
"sha256:733784b6d6def852c814bce5f318d25da2ee65dd4839a0718641c696e09a2960",
|
||||||
"sha256:7bda6eebafd42133efdca535b04ccb338ab29467b3f7bf79569883676fc628db",
|
"sha256:750e02e074872a3fad7f233b47734166440af3cdea0add3e95163110816d6752",
|
||||||
"sha256:7edbed096e4a4798710ed6bc75dcaa2a21b68b6c356553ac4823c3658d53743a",
|
"sha256:752a45dc4a6934060b3b0dab47e04edc3326575f82be64bc4fc293914566503e",
|
||||||
"sha256:7f9019c9cb613f084481bd6a100b12e1547cf2efe362d873c2e31e4035a6fa43",
|
"sha256:7579e913a5339fb8fa133f6bbcfd8e6749696206cf05acdbdca71a1b436d8e72",
|
||||||
"sha256:802168e03fba8bbc5ce0d866d589e4b1ca751d06edee69f7f3a19c5a9fe6b597",
|
"sha256:7641bb8895e77f921102f72833904dcd9901df5d6d72a2ab8f31d04b7e51e4e7",
|
||||||
"sha256:80d0a5615143c0b3225e5e3ef22c8d5d51f3f72ce0ea6fb84c943546c7b25b6c",
|
"sha256:7804338df6fcc08105c7745f1502ba68d900f45fd770d5bdd5288ddccb8a42d8",
|
||||||
"sha256:82060f995ab5003a2d6e0f4ad29065b7672b6593c8c63559beefe5b443242c3e",
|
"sha256:80d04837f55fc81da168b98de4f4b797ef007fc8a79ab71c6ec9bc4dd662b15b",
|
||||||
"sha256:836ab36280f21fc1a03c99cd05c6b7af70d2697e374c7af0b61ed271401a72a2",
|
"sha256:813c0e0132266c08eb87469a642cb30aaff57c5f426255419572aaeceeaa7bf4",
|
||||||
"sha256:8761ac29b6c81574724322a554605608a9960769ea83d2c73e396f3df896ad54",
|
"sha256:82b271f5137d07749f7bf32f70b17ab6eaabedd297e75dce75081a24f76eb545",
|
||||||
"sha256:87725cfb1a4f1f8c2fc9890ae2f42094120f4b44db9360be5d99a4c6b0e03a9e",
|
"sha256:84c018e49c3bf790f9c2771c45e9313a08c2c2a6342b162cd650258b57817706",
|
||||||
"sha256:899d28f422116b08be5118ef350c292b36fc15ec2daeb9ea987c89281c7bb5c4",
|
"sha256:8751d2787c9131302398b11e6c8068053dcb55d5a8964e114b6e196cf16cb366",
|
||||||
"sha256:8bc5f0687d796c05b1e28ab0d38a50e6309906ee09375dd3aff6a9c09dd6e8f4",
|
"sha256:8778f0c7a52e56f75d12dae53ae320fae900a8b9b4164b981b9c5ce059cd1fcb",
|
||||||
"sha256:8bea55c4eef25b0b19a0337dc4e3f9a15b00d569c77211fa8cde38684f234fb7",
|
"sha256:87fad7d9ba98c86bcb41b2dc8dbb326619be2562af1f8ff50776a39e55721c5a",
|
||||||
"sha256:8e5a94886bedca0f9b78fecd6afb6629142fd2605aa70a125d49f4edc6037ee6",
|
"sha256:8d828b6667a32a728a1ad1d93957cdf37489c57b97ae6c4de2860fa749b8fc1e",
|
||||||
"sha256:90ca27cd8da8118b18a52d5f547859cc1f8354a00cd1e8e5120df3e30d6279e5",
|
"sha256:8e385e4267ab76874ae30db04c627faaaf0b509e1ccc11a95b3fc3e83f855c00",
|
||||||
"sha256:92734d4d8d187a354a556626c221cd1a892a4e0802ccb2af432a1d85ec012194",
|
"sha256:92a0a01ead5e668468e952e4238cccd7c537364eb7d851ab144ab6627dbbe12f",
|
||||||
"sha256:947cf925bc916d90adba35a64c82aace04fa39b46b52d4630ece166655905a69",
|
"sha256:94e1885b270625a9a828c9793b4d52a64445299baa1fea5a173bf1d3dd9a1a5a",
|
||||||
"sha256:95b52c68d64c1878818687a473a10547b3292e82b6f6fe483808fb1468e2f52f",
|
"sha256:a180c5e59792af262bf263b21a3c49353f25945d8d9f70628e73de370d55e1e1",
|
||||||
"sha256:97d0235baafca5f2b09cf332cc275f021e694e8362c6bb9c96fc9a0eb74fc316",
|
"sha256:a277ab8928b9f299723bc1a2dabb1265911b1a76341f90a510368ca44ad9ab66",
|
||||||
"sha256:9ca4c0b502ab399ef89248a2c84c54954f77a070f28e546a85e91da627d1301e",
|
"sha256:a5fe03b42827c13cdccd08e6c0247b6a6d4b5e3cdc53fd1749f5896adcdc2356",
|
||||||
"sha256:9cc4fc6c196d6a8b76629a70ddfcd4635a6898756e2d9cac5565cf0654605d73",
|
"sha256:a6c5863edfbe888d9eff9c8b8087354e27618d9da76425c119293f11712a6319",
|
||||||
"sha256:9cc6e6d9e571d2f863fa77700701dae73ed5f78881efc8b3f9a4398772ff53e8",
|
"sha256:a89c23ef8d2c6b27fd200a42aa4ac72786e7c60d40efdc76e6011260b6e949c4",
|
||||||
"sha256:a056d1ad2633548ca18ffa2f85c202cfb48b68615129143915b8dc72a806a923",
|
"sha256:adb2597b428735679446b46c8badf467b4ca5f5056aae4d51a19f9570301b1ad",
|
||||||
"sha256:a26611d9987b230566f24a0a125f17fe0de6a6aff9f25c9f564aaa2721a5fb88",
|
"sha256:ae196f021b5e7c78e918242d217db021ed2a6ace2bc6ae94c0fc596221c7f58d",
|
||||||
"sha256:a4474d924a47185a06411e0064b803c68be044be2d60e50e8bddcc2649957c1f",
|
"sha256:ae89db9e5f98a11a4bf50407d4363e7b09b31e55bc117b4f7d80aab97ba009e5",
|
||||||
"sha256:a4ea868bc28109052790eb2b52a9ab33f3aa7adc02f96673526ff47419490e21",
|
"sha256:aed52fea0513bac0ccde438c188c8a471c4e0f457c2dd20cdbf6ea7a450046c7",
|
||||||
"sha256:a9e68c9d88823b274cf1e72f28cb5dc89c990edf430b0bfd3e2fb0785bfeabf4",
|
"sha256:aef65cd602a6d0e0ff6f9930fcb1c8fec60dd2cfcb6facaf4bdb0e5873042db0",
|
||||||
"sha256:aa9cccf4a44b9b62d8ba8b4dd06c649ba683e4bf04eea606d2e94cfc2d6ff4d6",
|
"sha256:af21eb4409a119e365397b2adbaca4c9ccab56543a65d5dbd9f920d6ac29f686",
|
||||||
"sha256:ab30e5e3e706e3063bc6de96b118688cb10396b70bb9864a430f67df98c61ecc",
|
"sha256:b14b2d9dac08e28bb8046a1a0434b1750eb221c8f5b87a68f4fa11a6f97b5e34",
|
||||||
"sha256:ac2393c73378fea4e52aa56285a3d64be50f1a12395afef9cce47772f60334c2",
|
"sha256:bb6d88045545b26da47aa879dd4a89a71d1dce0f0e549b1abcb31dfe4a8eac49",
|
||||||
"sha256:ad8faf8df23f0378c6d527d8b0b15ea4a2e23c89376877c598c4870d1b2c7866",
|
"sha256:bb8cc7534f51d9a017b93e3e85b260924f909601c3df002bcdb58ddb4dc41a5c",
|
||||||
"sha256:b35b200d6a71b9839a46b9b7fff66b6638bb52fc9658aa58796b0326595d3021",
|
"sha256:bc17a677b21b3502a21f66a8cc64f5bfad4df8a0b8434d661666f8ce90ac3af1",
|
||||||
"sha256:b3694e3f87f8ac7ce279d4355645b3c878d24d1424581b46282f24b92f5a4ae2",
|
"sha256:bd6c2a1c7573c64738d716488d2cdd3c00e340e4835707d8fdb8dc1a66ef164e",
|
||||||
"sha256:b4ff1d35e8c5bd078be89349b6f3a845128e685e751b6ea1169cf2160b344c4d",
|
"sha256:bd9b23791fe793e4968dba0c447e12f78e425c59fc0e3b97f6450f4781f3ee60",
|
||||||
"sha256:bbc8c8650c6e51041ad1be191742b8b421d05bbd3410f43fa2a00c8db87678e8",
|
"sha256:c03a41a8784091e67a39648f70c5f97b5b6a37f216896d44d2cdcb82615339a0",
|
||||||
"sha256:bc72863f4d9aba2e8fd9085e63548a324ba706d2ea2c83b260da08a59b9482de",
|
"sha256:c0f081d69a6e58272819b70288d3221a6ee64b98df852631c80f293514d3b274",
|
||||||
"sha256:bf625105bb9eef28a56a943fec8c8a98aeb80e7d7db99bd3c388137e6eb2d237",
|
"sha256:c35abb8bfff0185efac5878da64c45dafd2b37fb0383add1be155a763c1f083d",
|
||||||
"sha256:c2274ca724536f173122f36c98ce188fd24ce3dad886ec2b7af859518ce008a4",
|
"sha256:c36c333c39be2dbca264d7803333c896ab8fa7d4d6f0ab7edb7dfd7aea6e98c0",
|
||||||
"sha256:c45a03a4c69820a399f1dda9e1d8fbf3562eda46e7720458180302021b08f778",
|
"sha256:c45e9440fb78f8ddabcf714b68f936737a121355bf59f3907f4e17721b9d1aae",
|
||||||
"sha256:c8ae56368f8cc97c7e40a7ee18e1cedaf8e780cd8bc5ed5ac8b81f238614facb",
|
"sha256:c593052c465475e64bbfe5dbd81680f64a67fdc752c56d7a0ae205dc8aeefe0f",
|
||||||
"sha256:c907cdc8109f6c619e6254212e794d6548373cc40e1ec75e6e3823d9135d29cc",
|
"sha256:cdd68a1fb318e290a2077696b7eb7a21a49163c455979c639bf5a5dcdc46617d",
|
||||||
"sha256:ca0276464d148c72defa8bb4390cce01b4a0e425f3b50d1435aa6d7a18107602",
|
"sha256:ce3412fbe1e31eb81ea42f4169ed94861c56e643189e1e75f0041f3fe7020abe",
|
||||||
"sha256:cd5e2801c89992ed8c0a3f0293ae83c159a60d9a5d685005383ef4caca77f2c4",
|
"sha256:cf1493cd8607bec4d8a7b9b004e699fcf8f9103a9284cc94962cb73d20f9d4a3",
|
||||||
"sha256:d08ec48f0a1c48d75d0356cea971921848fb620fdeba805b28f937e90691209f",
|
"sha256:cf29836da5119f3c8a8a70667b0ef5fdca3bb12f80fd06487cfa575b3909b393",
|
||||||
"sha256:d1a2ee9c1499fc8f86f4521f27a973c914b211ffa87322f4ee33bb35392da2c5",
|
"sha256:d4a48e5b3c2a489fae013b7589308a40146ee081f6f509e047e0e096084ceca1",
|
||||||
"sha256:d5f5d1e9def3405f60e3ca8232d56f35c98fb7bf581efcc60051ebf53cb8b611",
|
"sha256:d560742f3c0d62afaccf9f41fe485ed69bd7661a241f86a3ef0f0fb8b1a397af",
|
||||||
"sha256:d60377dce4511655582e300dc1e5a5f24ba0cb229005a1d5c8d0cb72bb758ab8",
|
"sha256:d6038d37043bced98a66e68d3aa2b6a35505dc01328cd65217cefe82f25def44",
|
||||||
"sha256:d73beaac5e90173ac3deb9928a74763a6d230f494e4bfb422c217a0ad8e629bf",
|
"sha256:d61f00a0869d77422d9b2aba989e2d24afa6ffd552af442e0e58de4f35ea6d00",
|
||||||
"sha256:d7de2637729c67d67cf87614b566626057e95c303bc0a55ffe391f5205e7003d",
|
"sha256:d635aab80466bc95771bb78d5370e74d36d1fe31467b6b29b8b57b2a3cd7d22c",
|
||||||
"sha256:dad6e0f2e481fffdcf776d10ebee25e0ef89f16d691f1e5dee4b586375fdc64b",
|
"sha256:dca4bbc466a95ba9c0234ef56d7dd9509f63da22274589ebd4ed7f1f4d4c54e3",
|
||||||
"sha256:dda86aba335c902b6149a02a55b38e96287157e609200811837678214ba2b1db",
|
"sha256:dd915403e231e6b1809fe9b6d9fc55cf8fb5e02765ac625d9cd623342a7905d7",
|
||||||
"sha256:df01808ee470038c3f8dc4f48620df7225c49c2d6639e38f96e6d6ac6e6f7b0e",
|
"sha256:e044c39e41b92c845bc815e5ae4230804e8e7bc29e399b0437d64222d92809dd",
|
||||||
"sha256:e1f6e2f00a6b8edb562826e4632e26d063ac10307e80f7461f7de3ad8ef3f077",
|
"sha256:e060d01aec0a910bdccb8be71faf34e7799ce36950f8294c8bf612cba65a2c9e",
|
||||||
"sha256:e25369dc110d58ddf29b949377a93e0716d72a24f62bad72b2b39f155949c1fd",
|
"sha256:e1421b502d83040e6d7fb2fb18dff63957f720da3d77b2fbd3187ceb63755d7b",
|
||||||
"sha256:e3c701e954abf6fc03a49f7c579cc80c2c6cc52525340ca3186c41d3f33482ef",
|
"sha256:e17b8d5d6a8c47c85e68ca8379def1303fd360c3e22093a807cd34a71cd082b8",
|
||||||
"sha256:e5bcc1a1ae744e0bb59641171ae53743760130600da8db48cbb6e4918e186e4e",
|
"sha256:e5f4d355f0a2b1a31bc3edec6795b46324349c9cb25eed068049e4f472fb4259",
|
||||||
"sha256:e68c14b04827dd76dcbd1aeea9e604e3e4b78322d8faf2f8132c7138efa340a8",
|
"sha256:e712b419df8ba5e42b226c510472b37bd57b38e897d3eca5e8cfd410a29fa859",
|
||||||
"sha256:e8aeb10fcbe92767f0fa69ad5a72deca50d0dca07fbde97848997d778a50c9fe",
|
"sha256:e74327fb75de8986940def6e8dee4f127cc9752bee7355bb323cc5b2659b6d46",
|
||||||
"sha256:e985a16ff513596f217cee86c21371b8cd011c0f6f056d0920aa2d926c544058",
|
"sha256:e80c8378d8f3d83cd3164da1ad2df9e37a666cdde7b1cb2298ed0b558064be30",
|
||||||
"sha256:ecbbd45615a6885fe3240eb9db73b9e62518b611850fdf8ab08bd56de7ad2b17",
|
"sha256:e8ac484bf18ce6975760921bb6148041faa8fef0547200386ea0b52b5d27bf7b",
|
||||||
"sha256:ee4ec14bc1680d6b0afab9aea2ef27e26d2024f18b24a2d7155a52b60da7e833",
|
"sha256:eca9705049ad3c7345d574e3510665cb2cf844c2f2dcfe675332677f081cbd46",
|
||||||
"sha256:ef5960d965e67165d75b7c7ffc60a83ec5abfc5c11b764ec13ea54fbef8b4421",
|
"sha256:ed065083d0898c9d5b4bbec7b026fd755ff7454e6e8b73a67f8c744b13986e24",
|
||||||
"sha256:f0cdaecd4c953bfae0b6bb64910aaaca5a424ad9c72d85cb88417bb9814f7550",
|
"sha256:edac0f1ab77644605be2cbba52e6b7f630731fc42b34cb0f634be1a6eface56a",
|
||||||
"sha256:f1ce721c8a7dfec21fcbdfe04e8f68174183cf4e8188e0645e92aa23985c57ff",
|
"sha256:effc3f449787117233702311a1b7d8f59cba9ced946ba727bdc329ec69028e24",
|
||||||
"sha256:f50498891691e0864dc3da965f340fada0771f6142a378083dc4608f4ea513e2",
|
"sha256:f22dec1690b584cea26fade98b2435c132c1b5f68e39f5a0b7627cd7ae31f1dc",
|
||||||
"sha256:f5ea69428fa1b49573eef0cc44a1d43bebd45ad0c611eb7d7eac760c7ae771bc",
|
"sha256:f495a1652cf3fbab2eb0639776dad966c2fb874d79d87ca07f9d5f059b8bd215",
|
||||||
"sha256:f61aa92e4aad0be58eb6eb4e0c21acf32cf8065f4b2cae5665da756c4ceef982",
|
"sha256:f496c9c3cc02230093d8330875c4c3cdfc3b73612a5fd921c65d39cbcef08063",
|
||||||
"sha256:f6e4333fb15c83f7d1482a76d45a0818897b3d33f00efd215528ff7c51b8e35d",
|
"sha256:f59099f9b66f0d7145115e6f80dd8b1d847176df89b234a5a6b3f00437aa0832",
|
||||||
"sha256:f820f24b09e3e779fe84c3c456cb4108a7aa639b0d1f02c28046e11bfcd088ed",
|
"sha256:f59ad4c0e8f6bba240a9bb85504faa1ab438237199d4cce5f622761507b8f6a6",
|
||||||
"sha256:f98059e4fcd3e3e4e2d632b7cf81c2faae96c43c60b569e9c621468082f1d104",
|
"sha256:fbccdc05410c9ee21bbf16a35f4c1d16123dcdeb8a1d38f33654fa21d0234f79",
|
||||||
"sha256:fcce033e4021347d80ed9c66dcf1e7b1546319834b74445f561d2e2221de5659"
|
"sha256:fea24543955a6a729c45a73fe90e08c743f0b3334bbf3201e6c4bc1b0c7fa464"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.7'",
|
"markers": "python_version >= '3.7'",
|
||||||
"version": "==3.4.6"
|
"version": "==3.4.7"
|
||||||
},
|
},
|
||||||
"click": {
|
"click": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:12ff4785d337a1bb490bb7e9c2b1ee5da3112e94a8622f26a6c77f5d2fc6842a",
|
"sha256:398329ad4837b2ff7cbe1dd166a4c0f8900c3ca3a218de04466f38f6497f18a2",
|
||||||
"sha256:981153a64e25f12d547d3426c367a4857371575ee7ad18df2a6183ab0545b2a6"
|
"sha256:a2bf429bb3033c89fa4936ffb35d5cb471e3719e1f3c8a7c3fff0b8314305613"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.10'",
|
"markers": "python_version >= '3.10'",
|
||||||
"version": "==8.3.1"
|
"version": "==8.3.3"
|
||||||
},
|
},
|
||||||
"cryptography": {
|
"cryptography": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:02f547fce831f5096c9a567fd41bc12ca8f11df260959ecc7c3202555cc47a72",
|
"sha256:0024b87d47ae2399165a6bfb20d24888881eeab83ae2566d62467c5ff0030ce7",
|
||||||
"sha256:039917b0dc418bb9f6edce8a906572d69e74bd330b0b3fea4f79dab7f8ddd235",
|
"sha256:07efe86201817e7d3c18781ca9770bc0db04e1e48c994be384e4602bc38f8f27",
|
||||||
"sha256:1abfdb89b41c3be0365328a410baa9df3ff8a9110fb75e7b52e66803ddabc9a9",
|
"sha256:09f6d7bf6724f8db8b32f11eccf23efc8e759924bc5603800335cf8859a3ddbd",
|
||||||
"sha256:2ae6971afd6246710480e3f15824ed3029a60fc16991db250034efd0b9fb4356",
|
"sha256:11438c7518132d95f354fa01a4aa2f806d172a061a7bed18cf18cbdacdb204d7",
|
||||||
"sha256:2b7a67c9cd56372f3249b39699f2ad479f6991e62ea15800973b956f4b73e257",
|
"sha256:11dbb9f50a0f1bb9757b3d8c27c1101780efb8f0bdecfb12439c22a74d64c001",
|
||||||
"sha256:351695ada9ea9618b3500b490ad54c739860883df6c1f555e088eaf25b1bbaad",
|
"sha256:14432c8a9bcb37009784f9594a62fae211a2ae9543e96c92b2a8e4c3cd5cd0c4",
|
||||||
"sha256:38946c54b16c885c72c4f59846be9743d699eee2b69b6988e0a00a01f46a61a4",
|
"sha256:1581aef4219f7ca2849d0250edaa3866212fb74bf5667284f46aa92f9e65c1ca",
|
||||||
"sha256:3b4995dc971c9fb83c25aa44cf45f02ba86f71ee600d81091c2f0cbae116b06c",
|
"sha256:160ad728f128972d362e714054f6ba0067cab7fb350c5202a9ae8ae4ce3ef1a0",
|
||||||
"sha256:3ce58ba46e1bc2aac4f7d9290223cead56743fa6ab94a5d53292ffaac6a91614",
|
"sha256:1a405c08857258c11016777e11c02bacbe7ef596faf259305d282272a3a05cbe",
|
||||||
"sha256:3ee190460e2fbe447175cda91b88b84ae8322a104fc27766ad09428754a618ed",
|
"sha256:1e47422b5557bb82d3fff997e8d92cff4e28b9789576984f08c248d2b3535d93",
|
||||||
"sha256:4108d4c09fbbf2789d0c926eb4152ae1760d5a2d97612b92d508d96c861e4d31",
|
"sha256:20fdbe3e38fb67c385d233c89371fa27f9909f6ebca1cecc20c13518dae65475",
|
||||||
"sha256:420d0e909050490d04359e7fdb5ed7e667ca5c3c402b809ae2563d7e66a92229",
|
"sha256:2207a498b03275d0051589e326b79d4cf59985c99031b05bb292ac52631c37fe",
|
||||||
"sha256:47fb8a66058b80e509c47118ef8a75d14c455e81ac369050f20ba0d23e77fee0",
|
"sha256:256d07c78a04d6b276f5df935a9923275f53bd1522f214447fdf365494e2d515",
|
||||||
"sha256:4c3341037c136030cb46e4b1e17b7418ea4cbd9dd207e4a6f3b2b24e0d4ac731",
|
"sha256:2b45761c6ec22b7c726d6a829558777e32d0f1c8be7c3f3480f9c912d5ee8a10",
|
||||||
"sha256:4d7e3d356b8cd4ea5aff04f129d5f66ebdc7b6f8eae802b93739ed520c47c79b",
|
"sha256:2ebd84adf0728c039a3be2700289378e1c164afc6748df1a5ed456767bef9ba7",
|
||||||
"sha256:4d8ae8659ab18c65ced284993c2265910f6c9e650189d4e3f68445ef82a810e4",
|
"sha256:34b4358b925a5ea3e14384ca781a2c0ef7ac219b57bb9eacc4457078e2b19f92",
|
||||||
"sha256:4e817a8920bfbcff8940ecfd60f23d01836408242b30f1a708d93198393a80b4",
|
"sha256:3fb8fa48075fad7193f2e5496135c6a76ac4b2aa5a38433df0a539296b377829",
|
||||||
"sha256:50bfb6925eff619c9c023b967d5b77a54e04256c4281b0e21336a130cd7fc263",
|
"sha256:4e1de79e047e25d6e9f8cea71c86b4a53aced64134f0f003bbcbf3655fd172c8",
|
||||||
"sha256:556e106ee01aa13484ce9b0239bca667be5004efb0aabbed28d353df86445595",
|
"sha256:4f7722c97826770bab8ae92959a2e7b20a5e9e9bf4deae68fd86c3ca457bab52",
|
||||||
"sha256:582f5fcd2afa31622f317f80426a027f30dc792e9c80ffee87b993200ea115f1",
|
"sha256:51c9313e90bd1690ec5a75ed047c27c0b8e6c570029712943d6116ef9a90620b",
|
||||||
"sha256:5be7bf2fb40769e05739dd0046e7b26f9d4670badc7b032d6ce4db64dddc0678",
|
"sha256:5d0e362ff51041b0c0d219cc7d6924d7b8996f57ce5712bdcef71eb3c65a59cc",
|
||||||
"sha256:60ee7e19e95104d4c03871d7d7dfb3d22ef8a9b9c6778c94e1c8fcc8365afd48",
|
"sha256:6651d32eff255423503aa276739da98c30f26c40cbeffcc6048e0d54ef704c0c",
|
||||||
"sha256:61aa400dce22cb001a98014f647dc21cda08f7915ceb95df0c9eaf84b4b6af76",
|
"sha256:6eebcaf0df1d21ce1f90605c9b432dd2c4f4ab665ac29a40d5e3fc68f51b5e63",
|
||||||
"sha256:68f68d13f2e1cb95163fa3b4db4bf9a159a418f5f6e7242564fc75fcae667fd0",
|
"sha256:6f29f36582e6151d9686235e586dd35bb67491f024767d10b842e520dc6a07ac",
|
||||||
"sha256:7d1f30a86d2757199cb2d56e48cce14deddf1f9c95f1ef1b64ee91ea43fe2e18",
|
"sha256:7a02675e2fabd0c0fc04c868b8781863cbf1967691543c22f5470500ff840b31",
|
||||||
"sha256:7d731d4b107030987fd61a7f8ab512b25b53cef8f233a97379ede116f30eb67d",
|
"sha256:7f1207974a904e005f762869996cf620e9bf79ecb4622f148550bb48e0eb35a7",
|
||||||
"sha256:803812e111e75d1aa73690d2facc295eaefd4439be1023fefc4995eaea2af90d",
|
"sha256:7f68d6fbc7fbbcfb0939fea72c3b96a9f9a6edfc0e1b1d29778a2066030418b1",
|
||||||
"sha256:80a8d7bfdf38f87ca30a5391c0c9ce4ed2926918e017c29ddf643d0ed2778ea1",
|
"sha256:7fda2f02c9015db3f42bb8a22324a454516ed10a8c29ca6ece6cdbb5efe2a203",
|
||||||
"sha256:8293f3dea7fc929ef7240796ba231413afa7b68ce38fd21da2995549f5961981",
|
"sha256:80887c5cbd1774683cb126f0ab4184567f080071d5acf62205acb354b4b753b7",
|
||||||
"sha256:8456928655f856c6e1533ff59d5be76578a7157224dbd9ce6872f25055ab9ab7",
|
"sha256:835d2d7f47cdc53b3224e90810fb1d36ca94ea29cc1801fb4c1bc43876735769",
|
||||||
"sha256:890bcb4abd5a2d3f852196437129eb3667d62630333aacc13dfd470fad3aaa82",
|
"sha256:8c1a736bbb3288005796c3f7ccb9453360d7fed483b13b9f468aea5171432923",
|
||||||
"sha256:94a76daa32eb78d61339aff7952ea819b1734b46f73646a07decb40e5b3448e2",
|
"sha256:9af828c0d5a65c70ec729cd7495a4bf1a67ecb66417b8f02ff125ab8a6326a74",
|
||||||
"sha256:9f16fbdf4da055efb21c22d81b89f155f02ba420558db21288b3d0035bafd5f4",
|
"sha256:9c59ab0e0fa3a180a5a9c59f3a5abe3ef90d474bc56d7fadfbe80359491b615b",
|
||||||
"sha256:a3d1fae9863299076f05cb8a778c467578262fae09f9dc0ee9b12eb4268ce663",
|
"sha256:9f8e55fe4e63613a5e1cc5819030f27b97742d720203a087802ce4ce9ceb52bb",
|
||||||
"sha256:a3d507bb6a513ca96ba84443226af944b0f7f47dcc9a399d110cd6146481d24c",
|
"sha256:9fe6b7c64926c765f9dff301f9c1b867febcda5768868ca084e18589113732ab",
|
||||||
"sha256:abace499247268e3757271b2f1e244b36b06f8515cf27c4d49468fc9eb16e93d",
|
"sha256:a49a3eb5341b9503fa3000a9a0db033161db90d47285291f53c2a9d2cd1b7f76",
|
||||||
"sha256:ba2a27ff02f48193fc4daeadf8ad2590516fa3d0adeeb34336b96f7fa64c1e3a",
|
"sha256:a9b761f012a943b7de0e828843c5688d0de94a0578d44d6c85a1bae32f87791f",
|
||||||
"sha256:bc84e875994c3b445871ea7181d424588171efec3e185dced958dad9e001950a",
|
"sha256:b1c76fca783aa7698eb21eb14f9c4aa09452248ee54a627d125025a43f83e7a7",
|
||||||
"sha256:bfd56bb4b37ed4f330b82402f6f435845a5f5648edf1ad497da51a8452d5d62d",
|
"sha256:b9a8943e359b7615db1a3ba587994618e094ff3d6fa5a390c73d079ce18b3973",
|
||||||
"sha256:c18ff11e86df2e28854939acde2d003f7984f721eba450b56a200ad90eeb0e6b",
|
"sha256:be12cb6a204f77ed968bcefe68086eb061695b540a3dd05edac507a3111b25f0",
|
||||||
"sha256:c3bcce8521d785d510b2aad26ae2c966092b7daa8f45dd8f44734a104dc0bc1a",
|
"sha256:cffbba3392df0fa8629bb7f43454ee2925059ee158e23c54620b9063912b86c8",
|
||||||
"sha256:c4143987a42a2397f2fc3b4d7e3a7d313fbe684f67ff443999e803dd75a76826",
|
"sha256:ed67ea4e0cfb5faa5bc7ecb6e2b8838f3807a03758eec239d6c21c8769355310",
|
||||||
"sha256:c69fd885df7d089548a42d5ec05be26050ebcd2283d89b3d30676eb32ff87dee",
|
"sha256:edd4da498015da5b9f26d38d3bfc2e90257bfa9cbed1f6767c282a0025ae649b",
|
||||||
"sha256:ced80795227d70549a411a4ab66e8ce307899fad2220ce5ab2f296e687eacde9",
|
"sha256:ef6b3634087f18d2155b1e8ce264e5345a753da2c5fa9815e7d41315c90f8318",
|
||||||
"sha256:d66e421495fdb797610a08f43b05269e0a5ea7f5e652a89bfd5a7d3c1dee3648",
|
"sha256:f1557695e5c2b86e204f6ce9470497848634100787935ab7adc5397c54abd7ab",
|
||||||
"sha256:d861ee9e76ace6cf36a6a89b959ec08e7bc2493ee39d07ffe5acb23ef46d27da",
|
"sha256:f5c15764f261394b22aef6b00252f5195f46f2ca300bec57149474e2538b31f8",
|
||||||
"sha256:e9251e3be159d1020c4030bd2e5f84d6a43fe54b6c19c12f51cde9542a2817b2",
|
"sha256:f5c3296dab66202f1b18a91fa266be93d6aa0c2806ea3d67762c69f60adc71aa",
|
||||||
"sha256:f145bba11b878005c496e93e257c1e88f154d278d2638e6450d17e0f31e558d2",
|
"sha256:f7db373287273d8af1414cf95dc4118b13ffdc62be521997b0f2b270771fef50",
|
||||||
"sha256:fe346b143ff9685e40192a4960938545c699054ba11d4f9029f94751e3f71d87"
|
"sha256:f9a034b642b960767fb343766ae5ba6ad653f2e890ddd82955aef288ffea8736"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.8' and python_full_version not in '3.9.0, 3.9.1'",
|
"markers": "python_version >= '3.8' and python_full_version not in '3.9.0, 3.9.1'",
|
||||||
"version": "==46.0.5"
|
"version": "==47.0.0"
|
||||||
},
|
},
|
||||||
"esptool": {
|
"esptool": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -470,11 +470,11 @@
|
|||||||
},
|
},
|
||||||
"idna": {
|
"idna": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea",
|
"sha256:585ea8fe5d69b9181ec1afba340451fba6ba764af97026f92a91d4eef164a242",
|
||||||
"sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"
|
"sha256:892ea0cde124a99ce773decba204c5552b69c3c67ffd5f232eb7696135bc8bb3"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.8'",
|
"markers": "python_version >= '3.8'",
|
||||||
"version": "==3.11"
|
"version": "==3.13"
|
||||||
},
|
},
|
||||||
"intelhex": {
|
"intelhex": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -501,19 +501,19 @@
|
|||||||
},
|
},
|
||||||
"microdot": {
|
"microdot": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:363e3ebfc80b7e0415779848c9332e4e7fb7bd365ee54d3620abffe42ed82946",
|
"sha256:3ba8bab39ae52bca08ee7024dfc71afb7cff089f0b6611d2a1f617abfcee749c",
|
||||||
"sha256:abfb82ca31cc430174e4761cc7356adc4bff00ea758d437c2b258883dc63f464"
|
"sha256:d56824f4510e628dac711c86121957894ceaf833298e4d25f06c29d2b19a1721"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==2.6.0"
|
"version": "==2.6.1"
|
||||||
},
|
},
|
||||||
"mpremote": {
|
"mpremote": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:11d134c69b21b487dae3d03eed54c8ccbf84c916c8732a3e069a97cae47be3d4",
|
"sha256:2df2a50f3c8098cae8c732dbf2541e7e58185e7896513b45d05196901e049334",
|
||||||
"sha256:6bb75774648091dad6833af4f86c5bf6505f8d7aec211380f9e6996c01d23cb5"
|
"sha256:fdb5626be83dff4e53c0184f8950814cb519b524dba7f1f8b1668aa477257a31"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==1.27.0"
|
"version": "==1.28.0"
|
||||||
},
|
},
|
||||||
"outcome": {
|
"outcome": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -525,11 +525,11 @@
|
|||||||
},
|
},
|
||||||
"platformdirs": {
|
"platformdirs": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:1ec356301b7dc906d83f371c8f487070e99d3ccf9e501686456394622a01a934",
|
"sha256:3bfa75b0ad0db84096ae777218481852c0ebc6c727b3168c1b9e0118e458cf0a",
|
||||||
"sha256:68a9a4619a666ea6439f2ff250c12a853cd1cbd5158d258bd824a7df6be2f868"
|
"sha256:e61adb1d5e5cb3441b4b7710bea7e4c12250ca49439228cc1021c00dcfac0917"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.10'",
|
"markers": "python_version >= '3.10'",
|
||||||
"version": "==4.9.4"
|
"version": "==4.9.6"
|
||||||
},
|
},
|
||||||
"pycparser": {
|
"pycparser": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -541,11 +541,11 @@
|
|||||||
},
|
},
|
||||||
"pygments": {
|
"pygments": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887",
|
"sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f",
|
||||||
"sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b"
|
"sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.8'",
|
"markers": "python_version >= '3.9'",
|
||||||
"version": "==2.19.2"
|
"version": "==2.20.0"
|
||||||
},
|
},
|
||||||
"pyjwt": {
|
"pyjwt": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -667,19 +667,19 @@
|
|||||||
},
|
},
|
||||||
"requests": {
|
"requests": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6",
|
"sha256:18817f8c57c6263968bc123d237e3b8b08ac046f5456bd1e307ee8f4250d3517",
|
||||||
"sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf"
|
"sha256:4e6d1ef462f3626a1f0a0a9c42dd93c63bad33f9f1c1937509b8c5c8718ab56a"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==2.32.5"
|
"version": "==2.33.1"
|
||||||
},
|
},
|
||||||
"rich": {
|
"rich": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:793431c1f8619afa7d3b52b2cdec859562b950ea0d4b6b505397612db8d5362d",
|
"sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb",
|
||||||
"sha256:b8daa0b9e4eef54dd8cf7c86c03713f53241884e814f4e2f5fb342fe520f639b"
|
"sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36"
|
||||||
],
|
],
|
||||||
"markers": "python_full_version >= '3.8.0'",
|
"markers": "python_full_version >= '3.9.0'",
|
||||||
"version": "==14.3.3"
|
"version": "==15.0.0"
|
||||||
},
|
},
|
||||||
"rich-click": {
|
"rich-click": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -691,11 +691,11 @@
|
|||||||
},
|
},
|
||||||
"selenium": {
|
"selenium": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:003e971f805231ad63e671783a2b91a299355d10cefb9de964c36ff3819115aa",
|
"sha256:4f97639055dcfa9eadf8ccf549ba7b0e49c655d4e2bde19b9a44e916b754e769",
|
||||||
"sha256:b8ccde8d2e7642221ca64af184a92c19eee6accf2e27f20f30472f5efae18eb1"
|
"sha256:bada5c08a989f812728a4b5bea884d8e91894e939a441cc3a025201ce718581e"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==4.41.0"
|
"version": "==4.43.0"
|
||||||
},
|
},
|
||||||
"sniffio": {
|
"sniffio": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -774,6 +774,7 @@
|
|||||||
"version": "==4.15.0"
|
"version": "==4.15.0"
|
||||||
},
|
},
|
||||||
"urllib3": {
|
"urllib3": {
|
||||||
|
"extras": [],
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed",
|
"sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed",
|
||||||
"sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4"
|
"sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4"
|
||||||
@@ -904,6 +905,73 @@
|
|||||||
"markers": "python_version >= '3.9'",
|
"markers": "python_version >= '3.9'",
|
||||||
"version": "==1.9.0"
|
"version": "==1.9.0"
|
||||||
},
|
},
|
||||||
|
"websockets": {
|
||||||
|
"hashes": [
|
||||||
|
"sha256:0298d07ee155e2e9fda5be8a9042200dd2e3bb0b8a38482156576f863a9d457c",
|
||||||
|
"sha256:04cdd5d2d1dacbad0a7bf36ccbcd3ccd5a30ee188f2560b7a62a30d14107b31a",
|
||||||
|
"sha256:08d7af67b64d29823fed316505a89b86705f2b7981c07848fb5e3ea3020c1abe",
|
||||||
|
"sha256:152284a83a00c59b759697b7f9e9cddf4e3c7861dd0d964b472b70f78f89e80e",
|
||||||
|
"sha256:1637db62fad1dc833276dded54215f2c7fa46912301a24bd94d45d46a011ceec",
|
||||||
|
"sha256:19c4dc84098e523fd63711e563077d39e90ec6702aff4b5d9e344a60cb3c0cb1",
|
||||||
|
"sha256:1c1b30e4f497b0b354057f3467f56244c603a79c0d1dafce1d16c283c25f6e64",
|
||||||
|
"sha256:2b9f1e0d69bc60a4a87349d50c09a037a2607918746f07de04df9e43252c77a3",
|
||||||
|
"sha256:31a52addea25187bde0797a97d6fc3d2f92b6f72a9370792d65a6e84615ac8a8",
|
||||||
|
"sha256:32da954ffa2814258030e5a57bc73a3635463238e797c7375dc8091327434206",
|
||||||
|
"sha256:335c23addf3d5e6a8633f9f8eda77efad001671e80b95c491dd0924587ece0b3",
|
||||||
|
"sha256:3425ac5cf448801335d6fdc7ae1eb22072055417a96cc6b31b3861f455fbc156",
|
||||||
|
"sha256:349f83cd6c9a415428ee1005cadb5c2c56f4389bc06a9af16103c3bc3dcc8b7d",
|
||||||
|
"sha256:37b31c1623c6605e4c00d466c9d633f9b812ea430c11c8a278774a1fde1acfa9",
|
||||||
|
"sha256:417b28978cdccab24f46400586d128366313e8a96312e4b9362a4af504f3bbad",
|
||||||
|
"sha256:485c49116d0af10ac698623c513c1cc01c9446c058a4e61e3bf6c19dff7335a2",
|
||||||
|
"sha256:4a1aba3340a8dca8db6eb5a7986157f52eb9e436b74813764241981ca4888f03",
|
||||||
|
"sha256:50f23cdd8343b984957e4077839841146f67a3d31ab0d00e6b824e74c5b2f6e8",
|
||||||
|
"sha256:52a0fec0e6c8d9a784c2c78276a48a2bdf099e4ccc2a4cad53b27718dbfd0230",
|
||||||
|
"sha256:52ac480f44d32970d66763115edea932f1c5b1312de36df06d6b219f6741eed8",
|
||||||
|
"sha256:5569417dc80977fc8c2d43a86f78e0a5a22fee17565d78621b6bb264a115d4ea",
|
||||||
|
"sha256:569d01a4e7fba956c5ae4fc988f0d4e187900f5497ce46339c996dbf24f17641",
|
||||||
|
"sha256:583b7c42688636f930688d712885cf1531326ee05effd982028212ccc13e5957",
|
||||||
|
"sha256:5a4b4cc550cb665dd8a47f868c8d04c8230f857363ad3c9caf7a0c3bf8c61ca6",
|
||||||
|
"sha256:5f451484aeb5cafee1ccf789b1b66f535409d038c56966d6101740c1614b86c6",
|
||||||
|
"sha256:5f6261a5e56e8d5c42a4497b364ea24d94d9563e8fbd44e78ac40879c60179b5",
|
||||||
|
"sha256:6e5a82b677f8f6f59e8dfc34ec06ca6b5b48bc4fcda346acd093694cc2c24d8f",
|
||||||
|
"sha256:71c989cbf3254fbd5e84d3bff31e4da39c43f884e64f2551d14bb3c186230f00",
|
||||||
|
"sha256:781caf5e8eee67f663126490c2f96f40906594cb86b408a703630f95550a8c3e",
|
||||||
|
"sha256:7be95cfb0a4dae143eaed2bcba8ac23f4892d8971311f1b06f3c6b78952ee70b",
|
||||||
|
"sha256:7d837379b647c0c4c2355c2499723f82f1635fd2c26510e1f587d89bc2199e72",
|
||||||
|
"sha256:86890e837d61574c92a97496d590968b23c2ef0aeb8a9bc9421d174cd378ae39",
|
||||||
|
"sha256:878b336ac47938b474c8f982ac2f7266a540adc3fa4ad74ae96fea9823a02cc9",
|
||||||
|
"sha256:8b6e209ffee39ff1b6d0fa7bfef6de950c60dfb91b8fcead17da4ee539121a79",
|
||||||
|
"sha256:8cc451a50f2aee53042ac52d2d053d08bf89bcb31ae799cb4487587661c038a0",
|
||||||
|
"sha256:8d7f0659570eefb578dacde98e24fb60af35350193e4f56e11190787bee77dac",
|
||||||
|
"sha256:8e1dab317b6e77424356e11e99a432b7cb2f3ec8c5ab4dabbcee6add48f72b35",
|
||||||
|
"sha256:8ff32bb86522a9e5e31439a58addbb0166f0204d64066fb955265c4e214160f0",
|
||||||
|
"sha256:95724e638f0f9c350bb1c2b0a7ad0e83d9cc0c9259f3ea94e40d7b02a2179ae5",
|
||||||
|
"sha256:9b5aca38b67492ef518a8ab76851862488a478602229112c4b0d58d63a7a4d5c",
|
||||||
|
"sha256:a069d734c4a043182729edd3e9f247c3b2a4035415a9172fd0f1b71658a320a8",
|
||||||
|
"sha256:a0b31e0b424cc6b5a04b8838bbaec1688834b2383256688cf47eb97412531da1",
|
||||||
|
"sha256:a35539cacc3febb22b8f4d4a99cc79b104226a756aa7400adc722e83b0d03244",
|
||||||
|
"sha256:a5e18a238a2b2249c9a9235466b90e96ae4795672598a58772dd806edc7ac6d3",
|
||||||
|
"sha256:a653aea902e0324b52f1613332ddf50b00c06fdaf7e92624fbf8c77c78fa5767",
|
||||||
|
"sha256:abf050a199613f64c886ea10f38b47770a65154dc37181bfaff70c160f45315a",
|
||||||
|
"sha256:af80d74d4edfa3cb9ed973a0a5ba2b2a549371f8a741e0800cb07becdd20f23d",
|
||||||
|
"sha256:b14dc141ed6d2dde437cddb216004bcac6a1df0935d79656387bd41632ba0bbd",
|
||||||
|
"sha256:b784ca5de850f4ce93ec85d3269d24d4c82f22b7212023c974c401d4980ebc5e",
|
||||||
|
"sha256:bc59589ab64b0022385f429b94697348a6a234e8ce22544e3681b2e9331b5944",
|
||||||
|
"sha256:c0204dc62a89dc9d50d682412c10b3542d748260d743500a85c13cd1ee4bde82",
|
||||||
|
"sha256:c0ee0e63f23914732c6d7e0cce24915c48f3f1512ec1d079ed01fc629dab269d",
|
||||||
|
"sha256:caab51a72c51973ca21fa8a18bd8165e1a0183f1ac7066a182ff27107b71e1a4",
|
||||||
|
"sha256:d6297ce39ce5c2e6feb13c1a996a2ded3b6832155fcfc920265c76f24c7cceb5",
|
||||||
|
"sha256:daa3b6ff70a9241cf6c7fc9e949d41232d9d7d26fd3522b1ad2b4d62487e9904",
|
||||||
|
"sha256:df57afc692e517a85e65b72e165356ed1df12386ecb879ad5693be08fac65dde",
|
||||||
|
"sha256:e0334872c0a37b606418ac52f6ab9cfd17317ac26365f7f65e203e2d0d0d359f",
|
||||||
|
"sha256:e6578ed5b6981005df1860a56e3617f14a6c307e6a71b4fff8c48fdc50f3ed2c",
|
||||||
|
"sha256:eaded469f5e5b7294e2bdca0ab06becb6756ea86894a47806456089298813c89",
|
||||||
|
"sha256:f4a32d1bd841d4bcbffdcb3d2ce50c09c3909fbead375ab28d0181af89fd04da",
|
||||||
|
"sha256:fd3cb4adb94a2a6e2b7c0d8d05cb94e6f1c81a0cf9dc2694fb65c7e8d94c42e4"
|
||||||
|
],
|
||||||
|
"index": "pypi",
|
||||||
|
"version": "==16.0"
|
||||||
|
},
|
||||||
"wsproto": {
|
"wsproto": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:61eea322cdf56e8cc904bd3ad7573359a242ba65688716b0710a5eb12beab584",
|
"sha256:61eea322cdf56e8cc904bd3ad7573359a242ba65688716b0710a5eb12beab584",
|
||||||
@@ -924,11 +992,11 @@
|
|||||||
},
|
},
|
||||||
"packaging": {
|
"packaging": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4",
|
"sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e",
|
||||||
"sha256:b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529"
|
"sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.8'",
|
"markers": "python_version >= '3.8'",
|
||||||
"version": "==26.0"
|
"version": "==26.2"
|
||||||
},
|
},
|
||||||
"pluggy": {
|
"pluggy": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
@@ -940,19 +1008,19 @@
|
|||||||
},
|
},
|
||||||
"pygments": {
|
"pygments": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887",
|
"sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f",
|
||||||
"sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b"
|
"sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176"
|
||||||
],
|
],
|
||||||
"markers": "python_version >= '3.8'",
|
"markers": "python_version >= '3.9'",
|
||||||
"version": "==2.19.2"
|
"version": "==2.20.0"
|
||||||
},
|
},
|
||||||
"pytest": {
|
"pytest": {
|
||||||
"hashes": [
|
"hashes": [
|
||||||
"sha256:711ffd45bf766d5264d487b917733b453d917afd2b0ad65223959f59089f875b",
|
"sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9",
|
||||||
"sha256:75186651a92bd89611d1d9fc20f0b4345fd827c41ccd5c299a868a05d70edf11"
|
"sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c"
|
||||||
],
|
],
|
||||||
"index": "pypi",
|
"index": "pypi",
|
||||||
"version": "==9.0.2"
|
"version": "==9.0.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,27 +1,30 @@
|
|||||||
# led-controller
|
# led-controller
|
||||||
|
|
||||||
LED controller web app for managing profiles, tabs, presets, and colour palettes, and sending commands to LED devices over the serial -> ESP-NOW bridge.
|
LED controller web app for managing profiles, **zones**, presets, and colour palettes, and sending commands to LED devices. Outbound paths include:
|
||||||
|
|
||||||
|
- **Serial → ESP-NOW bridge**: JSON lines over UART to an ESP32 that forwards ESP-NOW frames (configure `serial_port` and baud in `settings.json` / Settings model).
|
||||||
|
- **Wi-Fi LED drivers**: TCP JSON lines (default port **8765** on the Pi; drivers discover the controller via **UDP 8766** broadcast).
|
||||||
|
|
||||||
## Run
|
## Run
|
||||||
|
|
||||||
- One-time setup for port 80 without root: `sudo scripts/setup-port80.sh`
|
- One-time setup for port 80 without root: `sudo scripts/setup-port80.sh`
|
||||||
- Start app: `pipenv run run`
|
- Start app: `pipenv run run` (override listen port with the **`PORT`** environment variable)
|
||||||
- Dev watcher (auto-restart on `src/` changes): `pipenv run dev`
|
- Dev watcher (auto-restart on `src/` changes): `pipenv run dev`
|
||||||
- Regenerate **`docs/help.pdf`** from **`docs/help.md`**: `pipenv run help-pdf` (requires **pandoc** and **chromium** on the host)
|
- Regenerate **`docs/help.pdf`** from **`docs/help.md`**: `pipenv run help-pdf` (requires **pandoc** and **chromium** on the host)
|
||||||
|
|
||||||
## UI modes
|
## UI modes
|
||||||
|
|
||||||
- **Run mode**: focused control view. Select tabs/presets and apply profiles. Editing actions are hidden.
|
- **Run mode**: focused control view. Select zones/presets and apply profiles. Editing actions are hidden.
|
||||||
- **Edit mode**: management view. Shows Tabs, Presets, Patterns, Colour Palette, and Send Presets controls, plus per-tile preset edit/remove and drag-reorder.
|
- **Edit mode**: management view. Shows **Zones**, Presets, Patterns, Colour Palette, and Send Presets controls, plus per-tile preset edit/remove and drag-reorder.
|
||||||
|
|
||||||
## Profiles
|
## Profiles
|
||||||
|
|
||||||
- Applying a profile updates session scope and refreshes the active tab content.
|
- Applying a profile updates session scope and refreshes the active zone content.
|
||||||
- In **Run mode**, Profiles supports apply-only behavior (no create/clone/delete).
|
- In **Run mode**, Profiles supports apply-only behaviour (no create/clone/delete).
|
||||||
- In **Edit mode**, Profiles supports create/clone/delete.
|
- In **Edit mode**, Profiles supports create/clone/delete.
|
||||||
- Creating a profile always creates a populated `default` tab (starter presets).
|
- Creating a profile always creates a populated `default` zone (starter presets).
|
||||||
- Optional **DJ tab** seeding creates:
|
- Optional **DJ zone** seeding creates:
|
||||||
- `dj` tab bound to device name `dj`
|
- `dj` zone bound to device name `dj`
|
||||||
- starter DJ presets (rainbow, single colour, transition)
|
- starter DJ presets (rainbow, single colour, transition)
|
||||||
|
|
||||||
## Preset colours and palette linking
|
## Preset colours and palette linking
|
||||||
@@ -35,3 +38,24 @@ LED controller web app for managing profiles, tabs, presets, and colour palettes
|
|||||||
|
|
||||||
- Main API reference: `docs/API.md`
|
- Main API reference: `docs/API.md`
|
||||||
|
|
||||||
|
## Driver pattern modules
|
||||||
|
|
||||||
|
Pattern **`.py`** sources live under **`led-driver/src/patterns`**. The Pi app resolves that path via `util.driver_patterns.driver_patterns_dir()`. If you deploy without that tree next to the app, set **`LED_CONTROLLER_PATTERNS_DIR`** to the directory that contains those files.
|
||||||
|
|
||||||
|
## Animation engine (Pi-side)
|
||||||
|
|
||||||
|
`src/engine/` lets the Pi drive LEDs itself, in addition to the ESP32 drivers:
|
||||||
|
|
||||||
|
- **Pixel generator**: runs the **unchanged** `led-driver/src/patterns/*.py` under CPython (a `utime` shim plus a NeoPixel-like buffer) with the same preset JSON the drivers get, and streams each frame to **pixel outputs**: DDP, Art-Net, sACN (E1.31), or USB-DMX (Enttec Pro / Open DMX). Configure outputs in **Outputs** (edit mode) and add an output's name to a zone's devices.
|
||||||
|
- **Preset sequencer**: **Sequences** play timed chains of presets on a zone, switching both the pixel outputs and the zone's ESP32 drivers. Sequences resume after a restart.
|
||||||
|
- ESP32 firmware is unchanged; drivers still get presets + `select`.
|
||||||
|
|
||||||
|
CLI (run from `src/`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
python -m engine.cli --output "ddp://192.168.1.60?pixels=300" --test
|
||||||
|
python -m engine.cli --output "artnet://192.168.1.61?universe=0&pixels=170" --preset 16
|
||||||
|
python -m engine.cli --pattern rainbow --n1 2 --leds 60 # terminal preview
|
||||||
|
```
|
||||||
|
|
||||||
|
Tests: `pipenv run pytest tests/engine_tests`.
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{}
|
{"188b0e1560a8": {"id": "188b0e1560a8", "name": "led-188b0e1560a8", "type": "led", "transport": "wifi", "address": "10.1.1.192", "default_pattern": null, "zones": []}, "f0f5bdfb9d30": {"id": "f0f5bdfb9d30", "name": "led-f0f5bdfb9d30", "type": "led", "transport": "wifi", "address": "10.1.1.232", "default_pattern": null, "zones": []}}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
+1
-54
@@ -1,54 +1 @@
|
|||||||
{
|
{"on": {"min_delay": 10, "max_delay": 10000, "max_colors": 1}, "off": {"min_delay": 10, "max_delay": 10000, "max_colors": 0}, "rainbow": {"n1": "Step Rate", "min_delay": 10, "max_delay": 10000, "max_colors": 0}, "colour_cycle": {"n1": "Step Rate", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "transition": {"min_delay": 10, "max_delay": 10000, "max_colors": 10}, "chase": {"n1": "Colour 1 Length", "n2": "Colour 2 Length", "n3": "Step 1", "n4": "Step 2", "min_delay": 10, "max_delay": 10000, "max_colors": 2}, "pulse": {"n1": "Attack", "n2": "Hold", "n3": "Decay", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "circle": {"n1": "Head Rate", "n2": "Max Length", "n3": "Tail Rate", "n4": "Min Length", "min_delay": 10, "max_delay": 10000, "max_colors": 2}, "blink": {"min_delay": 10, "max_delay": 10000, "max_colors": 10}, "flicker": {"n1": "Min brightness", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "flame": {"n1": "Min brightness", "n2": "Breath period (ms)", "n3": "Spark gap min (ms, 0=default 10\u201330 s, -1=off)", "n4": "Spark gap max (ms)", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "twinkle": {"n1": "Twinkle activity (1\u2013255, higher = more changes)", "n2": "Density (0\u2013255, higher = more of the strip lit)", "n3": "Min adjacent LEDs per twinkle (same as max for fixed length)", "n4": "Max adjacent LEDs per twinkle (same as min for fixed length)", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "radiate": {"n1": "Node spacing (LEDs)", "n2": "Out time (ms)", "n3": "In time (ms)", "min_delay": 10, "max_delay": 10000, "max_colors": 2}, "meteor_rain": {"n1": "Tail length", "n2": "Speed (LEDs per frame)", "n3": "Fade amount (1-255)", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "scanner": {"n1": "Eye width", "n2": "End pause (frames)", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "gradient_scroll": {"n1": "Scroll step rate", "min_delay": 10, "max_delay": 10000, "max_colors": 10}, "comet_dual": {"n1": "Tail length", "n2": "Speed", "n3": "Gap", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "sparkle_trail": {"n1": "Spark density", "n2": "Decay", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "wave": {"n1": "Wavelength", "n2": "Amplitude", "n3": "Drift speed", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "plasma": {"n1": "Scale", "n2": "Speed", "n3": "Contrast", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "segment_chase": {"n1": "Segment size", "n2": "Phase step", "n3": "Segment phase offset", "n4": "Gap per segment", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "bar_graph": {"n1": "Level percent", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "breathing_dual": {"n1": "Phase offset", "n2": "Ease", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "strobe_burst": {"n1": "Burst count", "n2": "Burst gap", "n3": "Cooldown", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "rain_drops": {"n1": "Drop rate", "n2": "Ripple width", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "fireflies": {"n1": "Count", "n2": "Twinkle speed", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "clock_sweep": {"n1": "Hand width", "n2": "Marker interval", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "marquee": {"n1": "On length", "n2": "Off length", "n3": "Step", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "aurora": {"n1": "Band count", "n2": "Shimmer", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "snowfall": {"n1": "Flake density", "n2": "Fall speed", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "heartbeat": {"n1": "Pulse 1 ms", "n2": "Pulse 2 ms", "n3": "Pause ms", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "orbit": {"n1": "Orbit count", "n2": "Base speed", "max_colors": 10, "min_delay": 10, "max_delay": 10000}, "palette_morph": {"n1": "Morph ms", "n2": "Warp rate", "n3": "Turbulence", "max_colors": 10, "min_delay": 10, "max_delay": 10000}}
|
||||||
"on": {
|
|
||||||
"min_delay": 10,
|
|
||||||
"max_delay": 10000,
|
|
||||||
"max_colors": 1
|
|
||||||
},
|
|
||||||
"off": {
|
|
||||||
"min_delay": 10,
|
|
||||||
"max_delay": 10000,
|
|
||||||
"max_colors": 0
|
|
||||||
},
|
|
||||||
"rainbow": {
|
|
||||||
"n1": "Step Rate",
|
|
||||||
"min_delay": 10,
|
|
||||||
"max_delay": 10000,
|
|
||||||
"max_colors": 0
|
|
||||||
},
|
|
||||||
"transition": {
|
|
||||||
"min_delay": 10,
|
|
||||||
"max_delay": 10000,
|
|
||||||
"max_colors": 10
|
|
||||||
},
|
|
||||||
"chase": {
|
|
||||||
"n1": "Colour 1 Length",
|
|
||||||
"n2": "Colour 2 Length",
|
|
||||||
"n3": "Step 1",
|
|
||||||
"n4": "Step 2",
|
|
||||||
"min_delay": 10,
|
|
||||||
"max_delay": 10000,
|
|
||||||
"max_colors": 2
|
|
||||||
},
|
|
||||||
"pulse": {
|
|
||||||
"n1": "Attack",
|
|
||||||
"n2": "Hold",
|
|
||||||
"n3": "Decay",
|
|
||||||
"min_delay": 10,
|
|
||||||
"max_delay": 10000,
|
|
||||||
"max_colors": 10
|
|
||||||
},
|
|
||||||
"circle": {
|
|
||||||
"n1": "Head Rate",
|
|
||||||
"n2": "Max Length",
|
|
||||||
"n3": "Tail Rate",
|
|
||||||
"n4": "Min Length",
|
|
||||||
"min_delay": 10,
|
|
||||||
"max_delay": 10000,
|
|
||||||
"max_colors": 2
|
|
||||||
},
|
|
||||||
"blink": {
|
|
||||||
"min_delay": 10,
|
|
||||||
"max_delay": 10000,
|
|
||||||
"max_colors": 10
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"1": {"name": "on", "pattern": "on", "colors": ["#FFFFFF"], "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"}, "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": 255, "delay": 100, "auto": true, "n1": 2, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "4": {"name": "transition", "pattern": "transition", "colors": ["#FF0000", "#00FF00", "#0000FF", "#FFFFFF", "#0000FF", "#FFFF00"], "brightness": 255, "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": [null, null, null, 6, 2, 3]}, "5": {"name": "chase", "pattern": "chase", "colors": ["#FF0000", "#0000FF"], "brightness": 255, "delay": 200, "auto": true, "n1": 5, "n2": 5, "n3": 1, "n4": 1, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "6": {"name": "pulse", "pattern": "pulse", "colors": ["#00FF00"], "brightness": 255, "delay": 500, "auto": true, "n1": 1000, "n2": 500, "n3": 1000, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "7": {"name": "circle", "pattern": "circle", "colors": ["#FFA500", "#800080"], "brightness": 255, "delay": 200, "auto": true, "n1": 2, "n2": 10, "n3": 2, "n4": 5, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "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": 200, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "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": 255, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "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"], "brightness": 255, "delay": 800, "auto": true, "n1": 2000, "n2": 1000, "n3": 2000, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "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", "#FF00FF"], "brightness": 128, "delay": 1000, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": [0, 3, 4]}}
|
{"1": {"name": "on", "pattern": "on", "colors": ["#FFFFFF"], "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"}, "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": 255, "delay": 100, "auto": true, "n1": 2, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "4": {"name": "transition", "pattern": "transition", "colors": ["#FF0000", "#00FF00", "#0000FF", "#FFFFFF", "#0000FF", "#FFFF00"], "brightness": 255, "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": [null, null, null, 6, 2, 3]}, "5": {"name": "chase", "pattern": "chase", "colors": ["#FF0000", "#0000FF"], "brightness": 255, "delay": 200, "auto": true, "n1": 5, "n2": 5, "n3": 1, "n4": 1, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "6": {"name": "pulse", "pattern": "pulse", "colors": ["#00FF00"], "brightness": 255, "delay": 500, "auto": true, "n1": 1000, "n2": 500, "n3": 1000, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "7": {"name": "circle", "pattern": "circle", "colors": ["#FFA500", "#800080"], "brightness": 255, "delay": 200, "auto": true, "n1": 2, "n2": 10, "n3": 2, "n4": 5, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "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": 200, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "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": 255, "delay": 100, "auto": true, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "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"], "brightness": 255, "delay": 800, "auto": true, "n1": 2000, "n2": 1000, "n3": 2000, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1"}, "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", "#FF00FF"], "brightness": 128, "delay": 1000, "n1": 0, "n2": 0, "n3": 0, "n4": 0, "n5": 0, "n6": 0, "n7": 0, "n8": 0, "profile_id": "1", "palette_refs": [0, 3, 4]}, "38": {"name": "Colour Cycle", "pattern": "cLine truncated
|
||||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
PRST1xœ%ÎÁ
|
||||||
|
Â0Ð_‘ñšCSµJîæ'D$¶«␍ÄÝ’¦ˆˆÿntOovæ²opxz‘´zޱ¦P
|
||||||
|
e®µp={I’g¸ÖÇηÞãlpÍñ>¦¹mÓ”ÂÎþrXŠÀ•¼�[¸Zq«l”²S:e¯þLYn1Ñ%õ‹Ï ¥/ï
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1xњ%ОAВ …б»<·,J5\Е4␍К $84SX4Ж»‹eхеНlюШЅ B
|
||||||
|
‹+…„ЫОЬж#§,+м␍‡@ЖЏIб.сщ*Lk{ЊЖ(xJnѓХГ аjЙ°E*)°†m';ЗО©c:зОҐsЭY$‡�hЋѕuиЅ*Qлљ…В?†kJУчП=5Я
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PRST1xœ%ÎA л|·, ŠÐK˜ÆP;* ␍……1Þ݉3›—ÿÿf>àø"Ì¹ÖØU–¢°Ä[É¥nì¬Ü8b2˜kz<Ó&Ãà½ÁB9¾œµ±·‚Ðj'vRñ 앃╣rRÎÖZî)Ó5-ò‡Ã÷yÒ-€
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1xœ=ÎÝ
|
||||||
|
!†á[‰¯StK[¼€½‰ˆ°v*ÁTü!"º÷Ü¤Žžá�9˜¼¹4bu™VÙ…¢)…’ÿåVÎÁ…”¡÷XO“RœãÀpJöz+žr[R2ÌäÌzäœÁÔ KªÄàE;àKõ´èÓæß¶Ð²£:»Îø%¦p±ŽŽvn? ¼?�¨2ú
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1xœUÎÁ
|
||||||
|
Â0ЙsM5Uò+"²µ«â¦lSDÄwiNž³3‡ý@èɈPJ2–fª•Uþn×’‹.ˆ§³Ã¨éþ¨Â‹å>‡‰3½}×9ÐZbÕ•ÄÛÀè‘]cß�¡qh7f-·”ù’&ûÁãûF9/.
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
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
|
||||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1xœ%ͽÂ0àW©Ž5C~•&VÆ
|
||||||
|
¡@�)uª4K…xwR<}ç»Á° —ks<DjÎ)¦…É•B™ë–¸ž¯µža;l¼×Ú{Üž9ïÂ4×ÁÐStl«kævÅ[a'ì…ƒpN¦œ|ˆô}ýmðý‡-‰
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
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
|
||||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1xœ%ͽÂ0àW©Ž5C~•&VÆ
|
||||||
|
¡@�)uª4K…xwR<}ç»Á° —ks<DjÎ)¦…É•B™ë–¸ž¯µža;l¼×Ú{Üž9ïÂ4×ÁÐStl«kævÅ[a'ì…ƒpN¦œ|ˆô}ýmðý‡-‰
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
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
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
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±
|
||||||
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
PRST1xśMÎÁ‚0„áwŻ=$ű*†�
|
||||||
|
[%Y[RÚ1ľ»…^<}ÉĚĺ˙Ŕ™7�`ĺPa51rpËäŇ␍tÇĹÚ©×�Â#,ĎWtĽĺŁŞ{…™Ĺě V+�=(†Ä
|
||||||
|
®5m¶ŐťÎŻk@×B[č
|
||||||
|
·B˛oáq™sMu¶ çş1°=z\ľ?µ¦8>
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
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°
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
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>Ў
|
||||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1xœEÎM
|
||||||
|
Â0à«Ès›Eÿ¢’ôE$¶£â¤$Ó…ˆww0góÁ{o1o°„ŠìÊì™)Ã`õ"”Y‹6§˜r�›°ÇFgƒk÷‡0-:k␍Šþ×7~“'y#ná¥Ó™ÒÃ逇Š*ÇÊéÇšÓ-Dº„Eiñù¹L2‡
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
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“üÙàý)<¡
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
PRST1xś-ÎÁ‚0Đ_!õ‡Šdo˝ô'Ś!Ş’”–”ĺ`Ś˙î<˝ÍĚö�čfű•‹!Íž‹qs
|
||||||
|
‹cö9J·Çý?RHy]QZkŚÖ’•Zc-n
|
||||||
|
÷<=_ý*“Zk…Ń÷µrşŤ�óćbę„T ␍¨N ŮĹóA{p9čv–śSđý4Ęcľ?6Đ
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1x�5־A‚0…ב«�ַ¶@Dׂ- —0ֶT©�X[2ֶxwG׳ש&»˜‚yXh°M\₪�׀��‚ֹ8…�0[
|
||||||
|
’ור/חט#%ט=ֺ¾†q”·r\…¹כ�ƒMע¥©*…ֹzף„מd5Gh¦ֵ*„Zz+6b-1l ¿´™m¦ֻל2ֺLסגה"7ֹy5�־ד:G
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1xœ-ÎÁ Ð_1ã•ÔZŽúÆ´«’ 4°Õã¿»Š§7;sÙ¢»,˜
|
||||||
|
/îNP˜3å(í¿8¥�r�Ýa©õ¶ìŽÙ_®©ÈÐh0RpOØN¢›9ÁržI!XÓˆ�ØËW„ö{+]eSéL9�} ƒåƒ÷ªù0¿
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1x�=ЮA
|
||||||
|
Т0аЋШw�EZ5JаK�б�ZH��L"онС�Ћ7ќџѓFЄ�с!\e�е�`�I�KдќнRHЅТ�и�ЕЮсlp-ѓу)�ЋНЕzС;=i�/ee�иiІє:Sv�=МютЁсЧЦщG.щ>ОЬ�Овсѓ,�1И
|
||||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1xœ5ÎA‚0Ы�϶‹‚ˆ¦è%Œ!F �–´ÃÂïîhu6o2ÿ/æ ïV‚Sâ"Ѹ’碟\"(lŽ™¢—ø—tÿ¤Kˆ æ‚ÒZ-#·ò£µ¸*Üâ<Nì)I¥ÖZa Å=`ZYÝΆãN
|
||||||
|
¾‚i„¦0RðMæ˜i3§ÌùËÃ}^¨›ùÂë␍Çü8÷
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
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˜
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
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%
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
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Ó
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
PRST1xњEО1В0Р« ПљЎiЎ ЂK „5)MЪФвоXНЂ—gщяБD72В‹lF—зВѓЙ‰pЋьoчR^@glOлаbpЛющ’И‹mУЬФлкЉ$ђдВС‚:ҐХљТЃ¬Іi/о+}еP9®L9=|а«ф‹пжg2д
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
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ó
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
PRST1x°Mна
|
||||||
|
б0ЮW▒вз╘SzTЯ%D╓╨L╣m├┬ЬНfКе\╬ДOЫ ╦'а┌)С"┤ЬЙ°ВP3╔ ⌡©П}LЖ└Й8≈dуNЖр²╝╘©?8P√⌠Zk┘√╪{ц6р╨▒#,╖▒┌≥Жb␍k└%Л4╜
|
||||||
|
КBSь╤3C┼]ОИр╥Р≈аВ┘┘6
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
PRST1xœMÎK
|
||||||
|
Â0…á½§ÜT£’tR$Ú«âMÉc âÞm�ˆ£þ39Oˆ»3,¦2Car¥p’¿rŽ!¦{ÀЍï‰0(œ’¿ÞŠpž‡Î…‘ƒ{À"WK„-©²‚hXMK•î;Ëú—6°¦±mìûSŠøèÇù’Æë␍»0Ø
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
PRST1xœMÎA‚0Ы˜ï¶‹RÉ€KcŠŒBR[Òc¼»l\½Éÿùɼáí“ANr˜ÙFÙ
|
||||||
|
V+ÂÑçê?½b␍8ö½éj�‹Â—Ç,žS.ŒÖ
|
||||||
|
;ûµù´›�Ä�|ªL½uŨ)_ƒ
|
||||||
|
ÍN»sÞé~¬1ÜÇ×eÊ/Uø|Æœ5
|
||||||
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
PRST1xœ5ŽA‚0E¯B>Û.
|
||||||
|
*š€KCªŒBRÚ¦c¼»ÅÙ¼7óÿb>ðv"0Í\D눙Š)¤8@!ZÙ’—xOºò.¤æŠ²mµŒÜJW϶:n
|
||||||
|
÷4¾ö4K¹ÖZ¡'gß0�¨]8ÀpZHÁW0ÕVðõÞô˜ÇŒSF“qθlˆ)<GGÝØË«¾?ð¹<
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
PRST1xœMŽ1Â0Eïò»fp
|
||||||
|
�(K/�
|
||||||
|
�H!©Òt@ˆ»cÈÂô¾Ÿ¿%¿�üƒá0†2F†Âìkå’þÕ˜c.ÜÝ0‘¸Î‘%œ.%Üî5ñ"•Þ…‰£J&RðkÍpµ¬¬�´HA§e•6mÜÂÉQ2p_¹kØ7Øæ’¯!ò9Lò–Æû¼Ã1ó
|
||||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
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
@@ -1 +1 @@
|
|||||||
{"1": {"name": "default", "type": "tabs", "tabs": ["1", "8"], "scenes": [], "palette_id": "1"}, "2": {"name": "test", "type": "tabs", "tabs": ["6", "7"], "scenes": [], "palette_id": "12"}}
|
{"1": {"name": "default", "type": "zones", "zones": ["1", "8"], "scenes": [], "palette_id": "1"}, "2": {"name": "test", "type": "zones", "zones": ["6", "7"], "scenes": [], "palette_id": "12"}}
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"1": {"group_name": "Main Group", "presets": ["1", "2"], "sequence_duration": 3000, "sequence_transition": 500, "sequence_loop": true, "sequence_repeat_count": 0, "sequence_active": false, "sequence_index": 0, "sequence_start_time": 0}, "2": {"group_name": "Accent Group", "presets": ["2", "3"], "sequence_duration": 2000, "sequence_transition": 300, "sequence_loop": true, "sequence_repeat_count": 0, "sequence_active": false, "sequence_index": 0, "sequence_start_time": 0}}
|
{"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 +0,0 @@
|
|||||||
{"1": {"name": "default", "names": ["1", "2", "3", "4", "5", "6", "7", "8", "0", "a"], "presets": [["4", "2", "7"], ["15", "3", "14"], ["5", "8", "10"], ["11", "9", "12"], ["1", "13", "37"]], "presets_flat": ["4", "2", "7", "15", "3", "14", "5", "8", "10", "11", "9", "12", "1", "13", "37"], "default_preset": "15"}, "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}, "7": {"name": "dj", "names": ["dj"], "presets": [["34", "35", "36"]], "default_preset": "34", "presets_flat": ["34", "35", "36"]}, "8": {"name": "test", "names": ["11"], "presets": [["1", "2", "3"], ["4", "5"]], "default_preset": "1", "presets_flat": ["1", "2", "3", "4", "5"]}}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{"1": {"name": "default", "names": ["led-188b0e1560a8", "led-f0f5bdfb9d30"], "presets": [["4", "2", "7"], ["3", "14", "5"], ["8", "9", "1"], ["6", "38", "42"], ["39", "40", "41"], ["43", "44", "45"], ["46", "47", "48"], ["49", "50", "51"], ["52", "53", "54"], ["55", "56", "57"], ["58", "59", "60"], ["61", "62"]], "presets_flat": ["4", "2", "7", "3", "14", "5", "8", "9", "1", "6", "38", "42", "39", "40", "41", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "60", "61", "62"], "default_preset": "41"}, "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": "test", "names": ["led-188b0e1560a8"], "presets": [["1", "2", "3"], ["4", "5"]], "default_preset": "1", "presets_flat": ["1", "2", "3", "4", "5"]}}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import subprocess
|
|
||||||
import serial
|
|
||||||
import sys
|
|
||||||
|
|
||||||
print(sys.argv)
|
|
||||||
|
|
||||||
# Extract port (first arg if it's not a command)
|
|
||||||
commands = ["src", "lib", "ls", "reset", "follow", "db"]
|
|
||||||
port = None
|
|
||||||
if len(sys.argv) > 1 and sys.argv[1] not in commands:
|
|
||||||
port = sys.argv[1]
|
|
||||||
|
|
||||||
|
|
||||||
for cmd in sys.argv[1:]:
|
|
||||||
print(cmd)
|
|
||||||
match cmd:
|
|
||||||
case "src":
|
|
||||||
if port:
|
|
||||||
subprocess.call(["mpremote", "connect", port, "fs", "cp", "-r", ".", ":" ], cwd="src")
|
|
||||||
else:
|
|
||||||
print("Error: Port required for 'src' command")
|
|
||||||
case "lib":
|
|
||||||
if port:
|
|
||||||
subprocess.call(["mpremote", "connect", port, "fs", "cp", "-r", "lib", ":" ])
|
|
||||||
else:
|
|
||||||
print("Error: Port required for 'lib' command")
|
|
||||||
case "ls":
|
|
||||||
if port:
|
|
||||||
subprocess.call(["mpremote", "connect", port, "fs", "ls", ":" ])
|
|
||||||
else:
|
|
||||||
print("Error: Port required for 'ls' command")
|
|
||||||
case "reset":
|
|
||||||
if port:
|
|
||||||
with serial.Serial(port, baudrate=115200) as ser:
|
|
||||||
ser.write(b'\x03\x03\x04')
|
|
||||||
else:
|
|
||||||
print("Error: Port required for 'reset' command")
|
|
||||||
case "follow":
|
|
||||||
if port:
|
|
||||||
with serial.Serial(port, baudrate=115200) as ser:
|
|
||||||
while True:
|
|
||||||
if ser.in_waiting > 0: # Check if there is data in the buffer
|
|
||||||
data = ser.readline().decode('utf-8').strip() # Read and decode the data
|
|
||||||
print(data)
|
|
||||||
else:
|
|
||||||
print("Error: Port required for 'follow' command")
|
|
||||||
case "db":
|
|
||||||
if port:
|
|
||||||
subprocess.call(["mpremote", "connect", port, "fs", "cp", "-r", "db", ":" ])
|
|
||||||
else:
|
|
||||||
print("Error: Port required for 'db' command")
|
|
||||||
+116
-28
@@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
This document covers:
|
This document covers:
|
||||||
|
|
||||||
1. **HTTP and WebSocket** exposed by the Raspberry Pi app (`src/main.py`) — profiles, presets, transport send, and related resources.
|
1. **HTTP and WebSocket** exposed by the Raspberry Pi app (`src/main.py`) — profiles, zones, presets, transport send, pattern OTA helpers, and related resources.
|
||||||
2. **LED driver JSON** — the compact message format sent over the serial→ESP-NOW bridge to devices (same logical API as ESP-NOW payloads).
|
2. **LED driver JSON** — the compact **v1** message format. It is sent over the **serial → ESP-NOW bridge** to ESP32 peers and as **single JSON text messages** over the **outbound WebSocket** to **Wi-Fi** drivers (same logical fields).
|
||||||
|
|
||||||
Default listen address: `0.0.0.0`. Port defaults to **80**; override with the `PORT` environment variable (see `pipenv run run`).
|
Default HTTP listen address: `0.0.0.0`. Port defaults to **80**; override with the **`PORT`** environment variable (see `pipenv run run`).
|
||||||
|
|
||||||
|
**Serial:** UART path and baud come from settings (defaults include `serial_port` such as `/dev/ttyS0` and `serial_baudrate`). **Wi-Fi drivers:** **UDP** on port **8766** is the **discovery** channel: each driver’s JSON hello (**`device_name`**, **MAC**, optional **`type`**) **creates or updates** that device in **`db/device.json`** (keyed by MAC); the Pi echoes the datagram. After a valid hello with **`v`:** **`"1"`**, the Pi also opens an **outbound WebSocket** to that IP (**`wifi_driver_ws_port`**, default **80**; **`wifi_driver_ws_path`**, default **`/ws`**) for v1 commands; presets are not pushed automatically on connect (use **Send Presets** / profile apply). The Pi may send periodic UDP **hello** nudges to known Wi‑Fi device IPs when the WebSocket is down (**`wifi_driver_hello_interval_s`** in settings).
|
||||||
|
|
||||||
All JSON APIs use `Content-Type: application/json` for bodies and responses unless noted.
|
All JSON APIs use `Content-Type: application/json` for bodies and responses unless noted.
|
||||||
|
|
||||||
@@ -15,8 +17,8 @@ All JSON APIs use `Content-Type: application/json` for bodies and responses unle
|
|||||||
|
|
||||||
The main UI has two modes controlled by the mode toggle:
|
The main UI has two modes controlled by the mode toggle:
|
||||||
|
|
||||||
- **Run mode**: optimized for operation (tab/preset selection and profile apply).
|
- **Run mode**: optimized for operation (zone/preset selection and profile apply).
|
||||||
- **Edit mode**: shows editing/management controls (tabs, presets, patterns, colour palette, send presets, and profile management actions).
|
- **Edit mode**: shows editing/management controls (zones, presets, patterns, colour palette, send presets, profile management actions, **Devices** registry for LED driver names/MACs, and related tools).
|
||||||
|
|
||||||
Profiles are available in both modes, but behavior differs:
|
Profiles are available in both modes, but behavior differs:
|
||||||
|
|
||||||
@@ -40,7 +42,7 @@ Profiles are selected with **`POST /profiles/<id>/apply`**, which sets `current_
|
|||||||
| Method | Path | Description |
|
| Method | Path | Description |
|
||||||
|--------|------|-------------|
|
|--------|------|-------------|
|
||||||
| GET | `/` | Main UI (`templates/index.html`) |
|
| GET | `/` | Main UI (`templates/index.html`) |
|
||||||
| GET | `/settings` | Settings page (`templates/settings.html`) |
|
| GET | `/settings/page` | Standalone settings page (`templates/settings.html`) |
|
||||||
| GET | `/favicon.ico` | Empty response (204) |
|
| GET | `/favicon.ico` | Empty response (204) |
|
||||||
| GET | `/static/<path>` | Static files under `src/static/` |
|
| GET | `/static/<path>` | Static files under `src/static/` |
|
||||||
|
|
||||||
@@ -50,10 +52,12 @@ Profiles are selected with **`POST /profiles/<id>/apply`**, which sets `current_
|
|||||||
|
|
||||||
Connect to **`ws://<host>:<port>/ws`**.
|
Connect to **`ws://<host>:<port>/ws`**.
|
||||||
|
|
||||||
- Send **JSON**: the object is forwarded to the transport (serial bridge → ESP-NOW) as JSON. Optional key **`to`**: 12-character hex MAC address; if present it is removed from the object and the payload is sent to that peer; otherwise the default destination is used.
|
- Send **JSON**: the object is forwarded through the **serial sender** (6-byte MAC prefix + payload to the ESP-NOW bridge). Optional key **`to`**: 12-character hex MAC address; if present it is removed from the object and the payload is sent to that peer; otherwise the default destination from settings is used.
|
||||||
- Send **non-JSON text**: forwarded as raw bytes with the default address.
|
- Send **non-JSON text**: forwarded as raw bytes with the default address.
|
||||||
- On send failure, the server may reply with `{"error": "Send failed"}`.
|
- On send failure, the server may reply with `{"error": "Send failed"}`.
|
||||||
|
|
||||||
|
Wi-Fi devices are not targeted by `/ws` directly; use **`POST /presets/send`**, device routes, or **`POST /patterns/<name>/send`** as appropriate.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## HTTP API by resource
|
## HTTP API by resource
|
||||||
@@ -68,7 +72,30 @@ Below, `<id>` values are string identifiers used by the JSON stores (numeric str
|
|||||||
| PUT | `/settings/settings` | Merge keys into settings and save. Returns `{"message": "Settings updated successfully"}`. |
|
| PUT | `/settings/settings` | Merge keys into settings and save. Returns `{"message": "Settings updated successfully"}`. |
|
||||||
| GET | `/settings/wifi/ap` | Saved Wi‑Fi AP fields: `saved_ssid`, `saved_password`, `saved_channel`, `active` (Pi: `active` is always false). |
|
| GET | `/settings/wifi/ap` | Saved Wi‑Fi AP fields: `saved_ssid`, `saved_password`, `saved_channel`, `active` (Pi: `active` is always false). |
|
||||||
| POST | `/settings/wifi/ap` | Body: `ssid` (required), `password`, `channel` (1–11). Persists AP-related settings. |
|
| POST | `/settings/wifi/ap` | Body: `ssid` (required), `password`, `channel` (1–11). Persists AP-related settings. |
|
||||||
| GET | `/settings/page` | Serves `templates/settings.html` (same page as `GET /settings` from the root app, for convenience). |
|
| GET | `/settings/page` | Serves `templates/settings.html`. |
|
||||||
|
|
||||||
|
### Devices — `/devices`
|
||||||
|
|
||||||
|
Registry in `db/device.json`: storage key **`<id>`** (string, e.g. `"1"`) maps to an object that always includes:
|
||||||
|
|
||||||
|
| Field | Description |
|
||||||
|
|-------|-------------|
|
||||||
|
| **`id`** | Same as the storage key (stable handle for URLs). |
|
||||||
|
| **`name`** | Shown in the UI and used in `select` keys. |
|
||||||
|
| **`type`** | `led` (only value today; extensible). |
|
||||||
|
| **`transport`** | `espnow` or `wifi`. |
|
||||||
|
| **`address`** | For **`espnow`**: optional 12-character lowercase hex MAC. For **`wifi`**: optional IP or hostname string. |
|
||||||
|
| **`default_pattern`**, **`zones`** | Optional. Legacy **`tabs`** may still appear in old files and is migrated away on load. |
|
||||||
|
|
||||||
|
Existing records without `type` / `transport` / `id` are backfilled on load (`led`, `espnow`, and `id` = key).
|
||||||
|
|
||||||
|
| Method | Path | Description |
|
||||||
|
|--------|------|-------------|
|
||||||
|
| GET | `/devices` | Map of device id → device object. |
|
||||||
|
| GET | `/devices/<id>` | One device, 404 if missing. |
|
||||||
|
| POST | `/devices` | Create. Body: **`name`** (required), **`type`** (default `led`), **`transport`** (default `espnow`), optional **`address`**, **`default_pattern`**, **`zones`**. Returns `{ "<id>": { ... } }`, 201. |
|
||||||
|
| PUT | `/devices/<id>` | Partial update. **`name`** cannot be cleared. **`id`** in the body is ignored. **`type`** / **`transport`** validated; **`address`** normalised for the resulting transport. |
|
||||||
|
| DELETE | `/devices/<id>` | Remove device. |
|
||||||
|
|
||||||
### Profiles — `/profiles`
|
### Profiles — `/profiles`
|
||||||
|
|
||||||
@@ -77,9 +104,9 @@ Below, `<id>` values are string identifiers used by the JSON stores (numeric str
|
|||||||
| GET | `/profiles` | `{"profiles": {...}, "current_profile_id": "<id>"}`. Ensures a default current profile when possible. |
|
| GET | `/profiles` | `{"profiles": {...}, "current_profile_id": "<id>"}`. Ensures a default current profile when possible. |
|
||||||
| GET | `/profiles/current` | `{"id": "...", "profile": {...}}` |
|
| GET | `/profiles/current` | `{"id": "...", "profile": {...}}` |
|
||||||
| GET | `/profiles/<id>` | Single profile. If `<id>` is `current`, same as `/profiles/current`. |
|
| GET | `/profiles/<id>` | Single profile. If `<id>` is `current`, same as `/profiles/current`. |
|
||||||
| POST | `/profiles` | Create profile. Body may include `name` and other fields. Optional `seed_dj_tab` (request-only) seeds a DJ tab + presets. New profiles always get a populated `default` tab. Returns `{ "<id>": { ... } }` with status 201. |
|
| POST | `/profiles` | Create profile. Body may include `name` and other fields. Optional `seed_dj_zone` (request-only) seeds a DJ zone + presets. New profiles always get a populated `default` zone. Returns `{ "<id>": { ... } }` with status 201. |
|
||||||
| POST | `/profiles/<id>/apply` | Sets session current profile to `<id>`. |
|
| POST | `/profiles/<id>/apply` | Sets session current profile to `<id>`. |
|
||||||
| POST | `/profiles/<id>/clone` | Clone profile (tabs, palettes, presets). Body may include `name`. |
|
| POST | `/profiles/<id>/clone` | Clone profile (zones, palettes, presets). Body may include `name`. |
|
||||||
| PUT | `/profiles/current` | Update the current profile (from session). |
|
| PUT | `/profiles/current` | Update the current profile (from session). |
|
||||||
| PUT | `/profiles/<id>` | Update profile by id. |
|
| PUT | `/profiles/<id>` | Update profile by id. |
|
||||||
| DELETE | `/profiles/<id>` | Delete profile. |
|
| DELETE | `/profiles/<id>` | Delete profile. |
|
||||||
@@ -120,18 +147,21 @@ Stored preset records can include:
|
|||||||
- `colors`: resolved hex colours for editor/display.
|
- `colors`: resolved hex colours for editor/display.
|
||||||
- `palette_refs`: optional array of palette indexes parallel to `colors`. If a slot contains an integer index, the colour is linked to the current profile palette at that index.
|
- `palette_refs`: optional array of palette indexes parallel to `colors`. If a slot contains an integer index, the colour is linked to the current profile palette at that index.
|
||||||
|
|
||||||
### Tabs — `/tabs`
|
### Zones — `/zones`
|
||||||
|
|
||||||
| Method | Path | Description |
|
| Method | Path | Description |
|
||||||
|--------|------|-------------|
|
|--------|------|-------------|
|
||||||
| GET | `/tabs` | `tabs`, `tab_order`, `current_tab_id`, `profile_id` for the session-backed profile. |
|
| GET | `/zones` | `zones` (map of zone id → zone object), `zone_order`, `current_zone_id`, `profile_id` for the session-backed profile. |
|
||||||
| GET | `/tabs/current` | Current tab from cookie/session. |
|
| GET | `/zones/current` | Current zone from cookie/session. |
|
||||||
| POST | `/tabs` | Create tab; optional JSON `name`, `names`, `presets`; can append to current profile’s tab list. |
|
| POST | `/zones` | Create zone; optional JSON `name`, `names`, `presets`; can append to current profile’s zone list. |
|
||||||
| GET | `/tabs/<id>` | Tab JSON. |
|
| GET | `/zones/<id>` | Zone JSON. |
|
||||||
| PUT | `/tabs/<id>` | Update tab. |
|
| PUT | `/zones/<id>` | Update zone. |
|
||||||
| DELETE | `/tabs/<id>` | Delete tab; can delete `current` to remove the active tab; updates profile tab list. |
|
| DELETE | `/zones/<id>` | Delete zone; can delete `current` to remove the active zone; updates profile zone list. |
|
||||||
| POST | `/tabs/<id>/set-current` | Sets `current_tab` cookie. |
|
| POST | `/zones/<id>/set-current` | Sets `current_zone` cookie. |
|
||||||
| POST | `/tabs/<id>/clone` | Clone tab into current profile. |
|
| POST | `/zones/<id>/clone` | Clone zone into current profile. |
|
||||||
|
| POST | `/zones/<id>/play` | Body **`{"preset_id": "16", "drivers": true}`**. Runs the preset on every target in the zone through the Pi engine: pixel **outputs** are rendered on the Pi, ESP32 drivers get the preset + `select` (skipped when **`drivers`** is `false`; the UI sends to drivers itself and passes `false`). Stops any sequence on the zone. Returns the zone's player status. |
|
||||||
|
| POST | `/zones/<id>/stop` | Stops the zone's sequence and Pi rendering (pixel outputs go black). ESP32 drivers keep their current preset. |
|
||||||
|
| GET | `/zones/engine/status` | Engine state: `zones` (per-zone player: preset, pattern, error, per-output frame/packet/error counters) and `sequences`. |
|
||||||
|
|
||||||
### Palettes — `/palettes`
|
### Palettes — `/palettes`
|
||||||
|
|
||||||
@@ -163,32 +193,90 @@ Stored preset records can include:
|
|||||||
| PUT | `/scenes/<id>` | Update. |
|
| PUT | `/scenes/<id>` | Update. |
|
||||||
| DELETE | `/scenes/<id>` | Delete. |
|
| DELETE | `/scenes/<id>` | Delete. |
|
||||||
|
|
||||||
|
### Scene playback
|
||||||
|
|
||||||
|
| Method | Path | Description |
|
||||||
|
|--------|------|-------------|
|
||||||
|
| POST | `/scenes/<id>/play` | Starts every sequence listed in the scene's `sequences`. Returns `started` ids and per-sequence `errors`. |
|
||||||
|
| POST | `/scenes/<id>/stop` | Stops the scene's sequences. |
|
||||||
|
|
||||||
### Sequences — `/sequences`
|
### Sequences — `/sequences`
|
||||||
|
|
||||||
|
Timed preset chains for one zone, run by the Pi engine (hard cuts). Stored in **`db/sequence.json`**:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{"name": "Showcase", "zone_id": "2", "loop": true, "repeat_count": 0,
|
||||||
|
"steps": [{"preset_id": "16", "duration_s": 8}, {"preset_id": "17", "duration_s": 8}],
|
||||||
|
"active": false}
|
||||||
|
```
|
||||||
|
|
||||||
|
`duration_s` is clamped to 0.5–600 (default 5). `repeat_count` counts passes when `loop` is true (0 = forever). `active` is maintained by the engine; active sequences resume after a restart. Legacy records (`group_name`, `presets`, `sequence_duration` in ms) are migrated on load.
|
||||||
|
|
||||||
| Method | Path | Description |
|
| Method | Path | Description |
|
||||||
|--------|------|-------------|
|
|--------|------|-------------|
|
||||||
| GET | `/sequences` | All sequences. |
|
| GET | `/sequences` | All sequences. |
|
||||||
|
| GET | `/sequences/status` | Runtime state per sequence: `zone_id`, `step_index`, `preset_id`, `pass`, `next_at`, `running`, optional `error`. |
|
||||||
| GET | `/sequences/<id>` | One sequence. |
|
| GET | `/sequences/<id>` | One sequence. |
|
||||||
| POST | `/sequences` | Create; may use `group_name`, `presets` in body. |
|
| POST | `/sequences` | Create (body as above). 400 on invalid steps. |
|
||||||
| PUT | `/sequences/<id>` | Update. |
|
| PUT | `/sequences/<id>` | Update (merged, then re-validated). |
|
||||||
| DELETE | `/sequences/<id>` | Delete. |
|
| DELETE | `/sequences/<id>` | Stop if running, then delete. |
|
||||||
|
| POST | `/sequences/<id>/play` | Start on its zone; replaces a sequence already running there. 400 without `zone_id`/steps. |
|
||||||
|
| POST | `/sequences/<id>/stop` | Stop; the zone keeps its current preset. |
|
||||||
|
|
||||||
### Patterns — `/patterns`
|
Picking a preset manually on a zone (`/zones/<id>/play`) stops that zone's sequence.
|
||||||
|
|
||||||
|
### Outputs — `/outputs`
|
||||||
|
|
||||||
|
Pixel outputs the Pi renders frames for, stored in **`db/output.json`**. A zone drives an output when the output's **`name`** appears in the zone's `names` (the same list that holds ESP32 device names).
|
||||||
|
|
||||||
|
| Field | Notes |
|
||||||
|
|-------|-------|
|
||||||
|
| `name` | Matched against zone `names`. |
|
||||||
|
| `protocol` | `ddp` (UDP 4048), `artnet` (ArtDMX, UDP 6454), `sacn` (E1.31, UDP 5568), `dmx_serial` (USB-DMX). |
|
||||||
|
| `host`, `port` | Network outputs. `ddp` needs a host; Art-Net without host broadcasts; sACN without host uses multicast `239.255.<hi>.<lo>`. Blank port = protocol default. |
|
||||||
|
| `universe` | Art-Net/sACN start universe (sACN 1–63999). 170 RGB pixels per universe; consecutive universes are used for longer strips. |
|
||||||
|
| `serial_port`, `dmx_mode`, `channel` | USB-DMX: `enttec_pro` (Enttec DMX USB Pro) or `open_dmx` (FTDI); start channel 1–512; one universe max. |
|
||||||
|
| `pixel_count`, `pixel_offset` | Pixels this output takes from the zone frame, starting at `pixel_offset`. Outputs at offset 0 mirror the frame start. |
|
||||||
|
| `color_order`, `reverse`, `brightness`, `fps`, `enabled` | Per-output wiring order, direction, 0–255 brightness (× global brightness), frame-rate cap (default 40). |
|
||||||
|
|
||||||
| Method | Path | Description |
|
| Method | Path | Description |
|
||||||
|--------|------|-------------|
|
|--------|------|-------------|
|
||||||
| GET | `/patterns/definitions` | Contents of `pattern.json` (pattern metadata for the UI). |
|
| GET | `/outputs` | All outputs. |
|
||||||
| GET | `/patterns` | All pattern records. |
|
| GET | `/outputs/<id>` | One output. |
|
||||||
| GET | `/patterns/<id>` | One pattern. |
|
| POST | `/outputs` | Create; 400 with `error` on validation failure. |
|
||||||
|
| PUT | `/outputs/<id>` | Update. |
|
||||||
|
| DELETE | `/outputs/<id>` | Delete. |
|
||||||
|
| POST | `/outputs/<id>/test` | Sends red, green, blue, white (optional body `step_s`, default 1 s each) then black. Returns per-output counters. |
|
||||||
|
|
||||||
|
### Patterns — `/patterns`
|
||||||
|
|
||||||
|
Pattern metadata lives in **`db/pattern.json`**; driver source files live under **`led-driver/src/patterns/`**. Several routes expose a **runtime map** (metadata merged with on-disk `.py` names so new files appear in menus).
|
||||||
|
|
||||||
|
| Method | Path | Description |
|
||||||
|
|--------|------|-------------|
|
||||||
|
| GET | `/patterns` | Runtime pattern map (object keyed by pattern id). |
|
||||||
|
| GET | `/patterns/definitions` | Same runtime map (intended for UI “definitions” clients). |
|
||||||
|
| GET | `/patterns/ota/manifest` | JSON `{"files":[{"name":"blink.py","url":"http://<Host>/patterns/ota/file/blink.py"},...]}` for OTA pulls. Requires **`Host`** header. |
|
||||||
|
| GET | `/patterns/ota/file/<name>` | Raw **`.py`** source for one driver pattern (`name` must be a safe filename, e.g. `rainbow.py`). |
|
||||||
|
| POST | `/patterns/<name>/send` | Push a **manifest** JSON line to **Wi-Fi** devices so they pull one pattern file over HTTP. Body may include **`device_id`** to target one device; otherwise all Wi-Fi devices with an **`address`** are tried. **`<name>`** may be with or without `.py`. |
|
||||||
|
| POST | `/patterns/upload` | Body JSON: **`name`**, **`code`**, optional **`overwrite`** (default true). Writes **`led-driver/src/patterns/<name>.py`**. |
|
||||||
|
| POST | `/patterns/driver` | Body JSON: **`name`** (identifier), **`code`**, optional metadata (`min_delay`, `max_delay`, `max_colors`, `n1`…`n8`, **`overwrite`**). Creates/updates both the **`.py`** file and **`db/pattern.json`** via the Pattern model. |
|
||||||
|
| GET | `/patterns/<id>` | One pattern record from the Pattern model (metadata only). |
|
||||||
| POST | `/patterns` | Create (`name`, optional `data`). |
|
| POST | `/patterns` | Create (`name`, optional `data`). |
|
||||||
| PUT | `/patterns/<id>` | Update. |
|
| PUT | `/patterns/<id>` | Update. |
|
||||||
| DELETE | `/patterns/<id>` | Delete. |
|
| DELETE | `/patterns/<id>` | Delete. |
|
||||||
|
|
||||||
|
**Devices — pattern OTA push**
|
||||||
|
|
||||||
|
| Method | Path | Description |
|
||||||
|
|--------|------|-------------|
|
||||||
|
| POST | `/devices/<id>/patterns/push` | Wi-Fi only. Asks the driver at **`address`** to pull pattern files from this server. Optional body **`manifest`**: either a **URL string** pointing at a manifest JSON document, or a **manifest object** (same shape as in driver messages). If omitted, a default manifest is built from the request **`Host`** header. |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## LED driver message format (transport / ESP-NOW)
|
## LED driver message format (transport / ESP-NOW / Wi-Fi)
|
||||||
|
|
||||||
Messages are JSON objects. The Pi **`build_message()`** helper (`src/util/espnow_message.py`) produces the same shape sent over serial and forwarded by the ESP32 bridge.
|
Messages are JSON objects. The Pi **`build_message()`** helper (`src/util/espnow_message.py`) produces the same shape sent over serial and forwarded by the ESP32 bridge, and the same logical object can be sent as a **single JSON text message** to a Wi-Fi driver over the **WebSocket**.
|
||||||
|
|
||||||
### Top-level fields
|
### Top-level fields
|
||||||
|
|
||||||
|
|||||||
@@ -350,10 +350,10 @@ Manage connected devices and create/manage device groups.
|
|||||||
|
|
||||||
#### Layout
|
#### Layout
|
||||||
- **Header:** Title with "Add Device" button
|
- **Header:** Title with "Add Device" button
|
||||||
- **Tabs:** Devices and Groups tabs
|
- **Zones:** Devices and Groups zones (zone buttons / zone strip)
|
||||||
- **Content Area:** Tab-specific content
|
- **Content Area:** Zone-specific content
|
||||||
|
|
||||||
#### Devices Tab
|
#### Devices Zone
|
||||||
|
|
||||||
**Device List**
|
**Device List**
|
||||||
- **Display:** List of all known devices
|
- **Display:** List of all known devices
|
||||||
@@ -375,7 +375,7 @@ Manage connected devices and create/manage device groups.
|
|||||||
- **Actions:** Cancel, Save
|
- **Actions:** Cancel, Save
|
||||||
- **Note:** Only one master device per system. Adding a new master will demote existing master to slave.
|
- **Note:** Only one master device per system. Adding a new master will demote existing master to slave.
|
||||||
|
|
||||||
#### Groups Tab
|
#### Groups Zone
|
||||||
|
|
||||||
**Group List**
|
**Group List**
|
||||||
- **Display:** List of all device groups
|
- **Display:** List of all device groups
|
||||||
@@ -397,7 +397,7 @@ Manage connected devices and create/manage device groups.
|
|||||||
- **Actions:** Cancel, Create
|
- **Actions:** Cancel, Create
|
||||||
|
|
||||||
#### Design Specifications
|
#### Design Specifications
|
||||||
- **Tab Style:** Active tab has purple background, white text
|
- **Zone Style:** Active zone has purple background, white text
|
||||||
- **List Items:** Bordered cards with hover effects
|
- **List Items:** Bordered cards with hover effects
|
||||||
- **Modal:** Centered overlay with white card, shadow
|
- **Modal:** Centered overlay with white card, shadow
|
||||||
- **Status Badges:** Colored pills (green for online, red for offline)
|
- **Status Badges:** Colored pills (green for online, red for offline)
|
||||||
@@ -1495,7 +1495,7 @@ peak_mem = usqlite.mem_peak()
|
|||||||
|
|
||||||
### Flow 2: Create Device Group
|
### Flow 2: Create Device Group
|
||||||
|
|
||||||
1. User navigates to Device Management → Groups tab
|
1. User navigates to Device Management → Groups zone
|
||||||
2. User clicks "Create Group", enters name, selects pattern/settings
|
2. User clicks "Create Group", enters name, selects pattern/settings
|
||||||
3. User selects devices to add (can include master), clicks "Create"
|
3. User selects devices to add (can include master), clicks "Create"
|
||||||
4. Group appears in list
|
4. Group appears in list
|
||||||
@@ -1774,7 +1774,7 @@ peak_mem = usqlite.mem_peak()
|
|||||||
- Buttons respond to clicks
|
- Buttons respond to clicks
|
||||||
- Sliders update values
|
- Sliders update values
|
||||||
- Modals open/close
|
- Modals open/close
|
||||||
- Tabs switch correctly
|
- Zone buttons switch correctly
|
||||||
- Preset selector works
|
- Preset selector works
|
||||||
- Preset creation form validates input
|
- Preset creation form validates input
|
||||||
- Preset cards display correctly
|
- Preset cards display correctly
|
||||||
|
|||||||
+28
-26
@@ -1,6 +1,6 @@
|
|||||||
# LED controller — user guide
|
# LED controller — user guide
|
||||||
|
|
||||||
This page describes the **main web UI** served from the Raspberry Pi app: profiles, tabs, presets, colour palettes, and sending commands to LED devices over the serial → ESP-NOW bridge.
|
This page describes the **main web UI** served from the Raspberry Pi app: profiles, **zones**, presets, colour palettes, and sending commands to LED devices. Traffic may go over the **serial → ESP-NOW bridge** or **Wi-Fi** (TCP to drivers on the LAN), depending on each device’s transport.
|
||||||
|
|
||||||
For HTTP routes and the wire format the driver expects, see **[API.md](API.md)**. For running the app locally, see the project **README**.
|
For HTTP routes and the wire format the driver expects, see **[API.md](API.md)**. For running the app locally, see the project **README**.
|
||||||
|
|
||||||
@@ -12,38 +12,38 @@ Figures below are **schematic** (layout and ideas), not pixel-perfect screenshot
|
|||||||
|
|
||||||
The header has a mode toggle (desktop and mobile menu). The **label on the button is the mode you switch to** when you press it.
|
The header has a mode toggle (desktop and mobile menu). The **label on the button is the mode you switch to** when you press it.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
*The active tab is highlighted. Extra management buttons appear only in Edit mode.*
|
*The active zone is highlighted. Extra management buttons appear only in Edit mode.*
|
||||||
|
|
||||||
| Mode | Purpose |
|
| Mode | Purpose |
|
||||||
|------|--------|
|
|------|--------|
|
||||||
| **Run mode** | Day-to-day control: choose a tab, tap presets, apply profiles. Management buttons are hidden. |
|
| **Run mode** | Day-to-day control: choose a zone, tap presets, apply profiles. Management buttons are hidden. |
|
||||||
| **Edit mode** | Full setup: tabs, presets, patterns, colour palette, **Send Presets**, profile create/clone/delete, preset reordering, and per-tile **Edit** on the strip. |
|
| **Edit mode** | Full setup: zones, presets, patterns, colour palette, **Send Presets**, profile create/clone/delete, preset reordering, and per-tile **Edit** on the strip. |
|
||||||
|
|
||||||
**Profiles** is available in both modes: in Run mode you can only **apply** a profile; in Edit mode you can also **create**, **clone**, and **delete** profiles.
|
**Profiles** is available in both modes: in Run mode you can only **apply** a profile; in Edit mode you can also **create**, **clone**, and **delete** profiles.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Tabs
|
## Zones
|
||||||
|
|
||||||
- **Select a tab**: click its button in the top bar. The main area shows that tab’s preset strip and controls.
|
- **Select a zone**: click its button in the top bar. The main area shows that zone’s preset strip and controls.
|
||||||
- **Edit mode — open tab settings**: **right-click** a tab button to change its name, **device IDs** (comma-separated), and which presets appear on the tab. Device identifiers are matched to each device’s **name** when the app builds `select` messages for the driver.
|
- **Edit mode — open zone settings**: **right-click** a zone button to change its name, **device IDs** (comma-separated), and which presets appear on the zone. Device identifiers are matched to each device’s **name** when the app builds `select` messages for the driver.
|
||||||
- **Tabs modal** (Edit mode): create new tabs from the header **Tabs** button. New tabs need a name and device ID list (defaults to `1` if you leave a simple placeholder).
|
- **Zones modal** (Edit mode): create new zones from the header **Zones** button. New zones need a name and device ID list (defaults to `1` if you leave a simple placeholder).
|
||||||
- **Brightness slider** (per tab): adjusts **global** brightness sent to devices (`b` in the driver message), with a short debounce so small drags do not flood the link.
|
- **Brightness slider** (per zone): adjusts **global** brightness sent to devices (`b` in the driver message), with a short debounce so small drags do not flood the link.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Presets on the tab strip
|
## Presets on the zone strip
|
||||||
|
|
||||||
- **Run and Edit mode**: click the **main part** of a preset tile to **select** that preset on all devices assigned to the current tab (same logical action as a `select` in the driver API).
|
- **Run and Edit mode**: click the **main part** of a preset tile to **select** that preset on all devices assigned to the current zone (same logical action as a `select` in the driver API).
|
||||||
- **Edit mode only**:
|
- **Edit mode only**:
|
||||||
- **Edit** beside a tile opens the preset editor for that preset, scoped to the current tab (so you can **Remove from tab** without deleting the preset from the profile).
|
- **Edit** beside a tile opens the preset editor for that preset, scoped to the current zone (so you can **Remove from zone** without deleting the preset from the profile).
|
||||||
- **Drag and drop** tiles to reorder them; order is saved for that tab.
|
- **Drag and drop** tiles to reorder them; order is saved for that zone.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
*The slider controls global brightness for the tab’s devices. Click the coloured area of a tile to select that preset.*
|
*The slider controls global brightness for the zone’s devices. Click the coloured area of a tile to select that preset.*
|
||||||
|
|
||||||
The **Presets** header button (Edit mode) opens a **profile-wide** list: **Add** new presets, **Edit**, **Send** (push definition over the transport), and **Delete** (removes the preset from the profile entirely).
|
The **Presets** header button (Edit mode) opens a **profile-wide** list: **Add** new presets, **Edit**, **Send** (push definition over the transport), and **Delete** (removes the preset from the profile entirely).
|
||||||
|
|
||||||
@@ -55,10 +55,10 @@ The **Presets** header button (Edit mode) opens a **profile-wide** list: **Add**
|
|||||||
- **Colours**: choosing a value in the colour picker **adds** a swatch when the picker closes. Swatches can be **reordered** by dragging. Changing a swatch with the picker **clears** palette linkage for that slot.
|
- **Colours**: choosing a value in the colour picker **adds** a swatch when the picker closes. Swatches can be **reordered** by dragging. Changing a swatch with the picker **clears** palette linkage for that slot.
|
||||||
- **From Palette**: inserts a colour **linked** to the current profile’s palette. Linked slots show a **P** badge; if you change that palette entry later, presets using it update.
|
- **From Palette**: inserts a colour **linked** to the current profile’s palette. Linked slots show a **P** badge; if you change that palette entry later, presets using it update.
|
||||||
- **Brightness (0–255)** and **Delay (ms)**: stored on the preset and sent with the compact preset payload.
|
- **Brightness (0–255)** and **Delay (ms)**: stored on the preset and sent with the compact preset payload.
|
||||||
- **Try**: sends the current form values to devices on the **current tab**, then selects that preset — **without** `save` on the device (good for auditioning).
|
- **Try**: sends the current form values to devices on the **current zone**, then selects that preset — **without** `save` on the device (good for auditioning).
|
||||||
- **Default**: updates the tab’s **default preset** and sends a **default** hint for those devices; it does not force the same live selection behaviour as clicking a tile.
|
- **Default**: updates the zone’s **default preset** and sends a **default** hint for those devices; it does not force the same live selection behaviour as clicking a tile.
|
||||||
- **Save & Send**: writes the preset to the server, then pushes definitions with **save** so devices may persist them. It does **not** auto-select the preset on devices (use the strip or **Try** if you want that).
|
- **Save & Send**: writes the preset to the server, then pushes definitions with **save** so devices may persist them. It does **not** auto-select the preset on devices (use the strip or **Try** if you want that).
|
||||||
- **Remove from tab** (when you opened the editor from a tab): removes the preset from **this tab’s list only**; the preset remains in the profile for other tabs.
|
- **Remove from zone** (when you opened the editor from a zone): removes the preset from **this zone’s list only**; the preset remains in the profile for other zones.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
@@ -68,21 +68,23 @@ The **Presets** header button (Edit mode) opens a **profile-wide** list: **Add**
|
|||||||
|
|
||||||
## Profiles
|
## Profiles
|
||||||
|
|
||||||
- **Apply**: sets the **current profile** in your session. Tabs and presets you see are scoped to that profile.
|
- **Apply**: sets the **current profile** in your session. Zones and presets you see are scoped to that profile.
|
||||||
- **Edit mode — Create**: new profiles always get a populated **default** tab. Optionally tick **DJ tab** to also create a `dj` tab (device name `dj`) with starter DJ-oriented presets.
|
- **Edit mode — Create**: new profiles always get a populated **default** zone. Optionally tick **DJ zone** to also create a `dj` zone (device name `dj`) with starter DJ-oriented presets.
|
||||||
- **Clone** / **Delete**: available in Edit mode from the profile list.
|
- **Clone** / **Delete**: available in Edit mode from the profile list.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Send Presets (Edit mode)
|
## Send Presets (Edit mode)
|
||||||
|
|
||||||
**Send Presets** walks **every tab** in the **current profile**, collects each tab’s preset IDs, and calls **`POST /presets/send`** per tab (including each tab’s **default** preset when set). Use this to bulk-push definitions to hardware after editing, without clicking **Send** on every preset individually.
|
**Send Presets** walks **every zone** in the **current profile**, collects each zone’s preset IDs, and calls **`POST /presets/send`** per zone (including each zone’s **default** preset when set). Use this to bulk-push definitions to hardware after editing, without clicking **Send** on every preset individually.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Patterns
|
## Patterns
|
||||||
|
|
||||||
The **Patterns** dialog (Edit mode) is a **read-only reference**: pattern names and typical **delay** ranges from the pattern definitions. It does not change device behaviour by itself; patterns are chosen inside the preset editor.
|
The **Patterns** dialog (Edit mode) lists pattern names and typical **delay** ranges from the pattern definitions. Choosing a pattern still happens inside the preset editor.
|
||||||
|
|
||||||
|
**Wi-Fi drivers** can install new pattern modules over HTTP: the REST API exposes **`/patterns/ota/*`**, **`POST /patterns/<name>/send`**, **`POST /patterns/upload`**, and **`POST /patterns/driver`** (see [API.md](API.md)). ESP-NOW devices follow the bridge/serial path you configure for preset traffic.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -98,15 +100,15 @@ The **Patterns** dialog (Edit mode) is a **read-only reference**: pattern names
|
|||||||
|
|
||||||
## Mobile layout
|
## Mobile layout
|
||||||
|
|
||||||
On narrow screens, use **Menu** to reach the same actions as the desktop header (Profiles, Tabs, Presets, Help, mode toggle, etc.).
|
On narrow screens, use **Menu** to reach the same actions as the desktop header (Profiles, Zones, Presets, Help, mode toggle, etc.).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
*Preset tiles behave the same once a tab is selected.*
|
*Preset tiles behave the same once a zone is selected.*
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Further reading
|
## Further reading
|
||||||
|
|
||||||
- **[API.md](API.md)** — REST routes, session scoping, WebSocket `/ws`, and LED driver JSON (`presets`, `select`, `save`, `default`, pattern keys).
|
- **[API.md](API.md)** — REST routes, session scoping, WebSocket `/ws`, and LED driver JSON (`presets`, `select`, `save`, `default`, pattern keys, pattern **manifest**).
|
||||||
- **README** — `pipenv run run`, port 80 setup, and high-level behaviour.
|
- **README** — `pipenv run run`, port 80 setup, and high-level behaviour.
|
||||||
Binary file not shown.
@@ -67,7 +67,7 @@
|
|||||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab {
|
.zone {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 12px 24px;
|
padding: 12px 24px;
|
||||||
border: none;
|
border: none;
|
||||||
@@ -78,16 +78,16 @@
|
|||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab.active {
|
.zone.active {
|
||||||
background: #667eea;
|
background: #667eea;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-content {
|
.zone-content {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab-content.active {
|
.zone-content.active {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,12 +249,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tabs">
|
<div class="tabs">
|
||||||
<button class="tab active" onclick="switchTab('devices')">Devices</button>
|
<button class="zone active" onclick="switchTab('devices')">Devices</button>
|
||||||
<button class="tab" onclick="switchTab('groups')">Groups</button>
|
<button class="zone" onclick="switchTab('groups')">Groups</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Devices Tab -->
|
<!-- Devices Zone -->
|
||||||
<div id="devices-tab" class="tab-content active">
|
<div id="devices-zone" class="zone-content active">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h2>Connected Devices</h2>
|
<h2>Connected Devices</h2>
|
||||||
<div class="device-item">
|
<div class="device-item">
|
||||||
@@ -313,8 +313,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Groups Tab -->
|
<!-- Groups Zone -->
|
||||||
<div id="groups-tab" class="tab-content">
|
<div id="groups-zone" class="zone-content">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
|
||||||
<h2>Groups</h2>
|
<h2>Groups</h2>
|
||||||
@@ -386,12 +386,12 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function switchTab(tab) {
|
function switchTab(zone) {
|
||||||
document.querySelectorAll('.tab').forEach(t => t.classList.remove('active'));
|
document.querySelectorAll('.zone').forEach(t => t.classList.remove('active'));
|
||||||
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
|
document.querySelectorAll('.zone-content').forEach(c => c.classList.remove('active'));
|
||||||
|
|
||||||
event.target.classList.add('active');
|
event.target.classList.add('active');
|
||||||
document.getElementById(tab + '-tab').classList.add('active');
|
document.getElementById(zone + '-zone').classList.add('active');
|
||||||
}
|
}
|
||||||
|
|
||||||
function showAddDeviceModal() {
|
function showAddDeviceModal() {
|
||||||
|
|||||||
@@ -1,112 +0,0 @@
|
|||||||
# Benchmark: LRU eviction vs add-then-remove-after-use on ESP32.
|
|
||||||
# Run on device: mpremote run esp32/benchmark_peers.py
|
|
||||||
# (add/del_peer are timed; send() may fail if no peer is listening - timing still valid)
|
|
||||||
import espnow
|
|
||||||
import network
|
|
||||||
import time
|
|
||||||
|
|
||||||
BROADCAST = b"\xff\xff\xff\xff\xff\xff"
|
|
||||||
MAX_PEERS = 20
|
|
||||||
ITERATIONS = 50
|
|
||||||
PAYLOAD = b"x" * 32 # small payload
|
|
||||||
|
|
||||||
network.WLAN(network.STA_IF).active(True)
|
|
||||||
esp = espnow.ESPNow()
|
|
||||||
esp.active(True)
|
|
||||||
esp.add_peer(BROADCAST)
|
|
||||||
|
|
||||||
# Build 19 dummy MACs so we have 20 peers total (broadcast + 19).
|
|
||||||
def mac(i):
|
|
||||||
return bytes([0, 0, 0, 0, 0, i])
|
|
||||||
peers_list = [mac(i) for i in range(1, 20)]
|
|
||||||
for p in peers_list:
|
|
||||||
esp.add_peer(p)
|
|
||||||
|
|
||||||
# One "new" MAC we'll add/remove.
|
|
||||||
new_mac = bytes([0, 0, 0, 0, 0, 99])
|
|
||||||
|
|
||||||
def bench_lru():
|
|
||||||
"""LRU: ensure_peer (evict oldest + add new), send, update last_used."""
|
|
||||||
last_used = {BROADCAST: time.ticks_ms()}
|
|
||||||
for p in peers_list:
|
|
||||||
last_used[p] = time.ticks_ms()
|
|
||||||
# Pre-remove one so we have 19; ensure_peer(new) will add 20th.
|
|
||||||
esp.del_peer(peers_list[-1])
|
|
||||||
last_used.pop(peers_list[-1], None)
|
|
||||||
# Now 19 peers. Each iteration: ensure_peer(new) -> add_peer(new), send, update.
|
|
||||||
# Next iter: ensure_peer(new) -> already there, just send. So we need to force
|
|
||||||
# eviction each time: use a different "new" each time so we always evict+add.
|
|
||||||
t0 = time.ticks_us()
|
|
||||||
for i in range(ITERATIONS):
|
|
||||||
addr = bytes([0, 0, 0, 0, 0, 50 + (i % 30)]) # 30 different "new" MACs
|
|
||||||
peers = esp.get_peers()
|
|
||||||
peer_macs = [p[0] for p in peers]
|
|
||||||
if addr not in peer_macs:
|
|
||||||
if len(peer_macs) >= MAX_PEERS:
|
|
||||||
oldest_mac = None
|
|
||||||
oldest_ts = time.ticks_ms()
|
|
||||||
for m in peer_macs:
|
|
||||||
if m == BROADCAST:
|
|
||||||
continue
|
|
||||||
ts = last_used.get(m, 0)
|
|
||||||
if ts <= oldest_ts:
|
|
||||||
oldest_ts = ts
|
|
||||||
oldest_mac = m
|
|
||||||
if oldest_mac is not None:
|
|
||||||
esp.del_peer(oldest_mac)
|
|
||||||
last_used.pop(oldest_mac, None)
|
|
||||||
esp.add_peer(addr)
|
|
||||||
esp.send(addr, PAYLOAD)
|
|
||||||
last_used[addr] = time.ticks_ms()
|
|
||||||
t1 = time.ticks_us()
|
|
||||||
return time.ticks_diff(t1, t0)
|
|
||||||
|
|
||||||
def bench_add_then_remove():
|
|
||||||
"""Add peer, send, del_peer (remove after use). At 20 we must del one first."""
|
|
||||||
# Start full: 20 peers. To add new we del any one, add new, send, del new.
|
|
||||||
victim = peers_list[0]
|
|
||||||
t0 = time.ticks_us()
|
|
||||||
for i in range(ITERATIONS):
|
|
||||||
esp.del_peer(victim) # make room
|
|
||||||
esp.add_peer(new_mac)
|
|
||||||
esp.send(new_mac, PAYLOAD)
|
|
||||||
esp.del_peer(new_mac)
|
|
||||||
esp.add_peer(victim) # put victim back so we're at 20 again
|
|
||||||
t1 = time.ticks_us()
|
|
||||||
return time.ticks_diff(t1, t0)
|
|
||||||
|
|
||||||
def bench_send_existing():
|
|
||||||
"""Baseline: send to existing peer only (no add/del)."""
|
|
||||||
t0 = time.ticks_us()
|
|
||||||
for _ in range(ITERATIONS):
|
|
||||||
esp.send(peers_list[0], PAYLOAD)
|
|
||||||
t1 = time.ticks_us()
|
|
||||||
return time.ticks_diff(t1, t0)
|
|
||||||
|
|
||||||
print("ESP-NOW peer benchmark ({} iterations)".format(ITERATIONS))
|
|
||||||
print()
|
|
||||||
|
|
||||||
# Baseline: send to existing peer
|
|
||||||
try:
|
|
||||||
us = bench_send_existing()
|
|
||||||
print("Send to existing peer only: {:>8} us total {:>7.1f} us/iter".format(us, us / ITERATIONS))
|
|
||||||
except Exception as e:
|
|
||||||
print("Send existing failed:", e)
|
|
||||||
print()
|
|
||||||
|
|
||||||
# LRU: evict oldest then add new, send
|
|
||||||
try:
|
|
||||||
us = bench_lru()
|
|
||||||
print("LRU (evict oldest + add + send): {:>8} us total {:>7.1f} us/iter".format(us, us / ITERATIONS))
|
|
||||||
except Exception as e:
|
|
||||||
print("LRU failed:", e)
|
|
||||||
print()
|
|
||||||
|
|
||||||
# Add then remove after use
|
|
||||||
try:
|
|
||||||
us = bench_add_then_remove()
|
|
||||||
print("Add then remove after use: {:>8} us total {:>7.1f} us/iter".format(us, us / ITERATIONS))
|
|
||||||
except Exception as e:
|
|
||||||
print("Add-then-remove failed:", e)
|
|
||||||
print()
|
|
||||||
print("Done.")
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
# Serial-to-ESP-NOW bridge: receives from Pi on UART, forwards to ESP-NOW peers.
|
|
||||||
# Wire format: first 6 bytes = destination MAC, rest = payload. Address is always 6 bytes.
|
|
||||||
from machine import Pin, UART
|
|
||||||
import espnow
|
|
||||||
import network
|
|
||||||
import time
|
|
||||||
|
|
||||||
UART_BAUD = 912000
|
|
||||||
BROADCAST = b"\xff\xff\xff\xff\xff\xff"
|
|
||||||
MAX_PEERS = 20
|
|
||||||
# Match led-driver / controller default settings wifi_channel (1–11)
|
|
||||||
WIFI_CHANNEL = 6
|
|
||||||
|
|
||||||
sta = network.WLAN(network.STA_IF)
|
|
||||||
sta.active(True)
|
|
||||||
sta.config(pm=network.WLAN.PM_NONE, channel=WIFI_CHANNEL)
|
|
||||||
print("WiFi STA channel:", sta.config("channel"), "(WIFI_CHANNEL=%s)" % WIFI_CHANNEL)
|
|
||||||
|
|
||||||
esp = espnow.ESPNow()
|
|
||||||
esp.active(True)
|
|
||||||
esp.add_peer(BROADCAST)
|
|
||||||
|
|
||||||
uart = UART(1, UART_BAUD, tx=Pin(21), rx=Pin(6))
|
|
||||||
|
|
||||||
# Track last send time per peer for LRU eviction (remove oldest when at limit).
|
|
||||||
last_used = {BROADCAST: time.ticks_ms()}
|
|
||||||
|
|
||||||
|
|
||||||
# ESP_ERR_ESPNOW_EXIST: peer already registered (ignore when adding).
|
|
||||||
ESP_ERR_ESPNOW_EXIST = -12395
|
|
||||||
|
|
||||||
|
|
||||||
def ensure_peer(addr):
|
|
||||||
"""Ensure addr is in the peer list. When at 20 peers, remove the oldest-used (LRU)."""
|
|
||||||
peers = esp.get_peers()
|
|
||||||
peer_macs = [p[0] for p in peers]
|
|
||||||
if addr in peer_macs:
|
|
||||||
return
|
|
||||||
if len(peer_macs) >= MAX_PEERS:
|
|
||||||
# Remove the peer we used least recently (oldest).
|
|
||||||
oldest_mac = None
|
|
||||||
oldest_ts = time.ticks_ms()
|
|
||||||
for mac in peer_macs:
|
|
||||||
if mac == BROADCAST:
|
|
||||||
continue
|
|
||||||
ts = last_used.get(mac, 0)
|
|
||||||
if ts <= oldest_ts:
|
|
||||||
oldest_ts = ts
|
|
||||||
oldest_mac = mac
|
|
||||||
if oldest_mac is not None:
|
|
||||||
esp.del_peer(oldest_mac)
|
|
||||||
last_used.pop(oldest_mac, None)
|
|
||||||
try:
|
|
||||||
esp.add_peer(addr)
|
|
||||||
except OSError as e:
|
|
||||||
if e.args[0] != ESP_ERR_ESPNOW_EXIST:
|
|
||||||
raise
|
|
||||||
|
|
||||||
|
|
||||||
print("Starting ESP32 main.py")
|
|
||||||
|
|
||||||
while True:
|
|
||||||
if uart.any():
|
|
||||||
data = uart.read()
|
|
||||||
if not data or len(data) < 6:
|
|
||||||
continue
|
|
||||||
print(f"Received data: {data}")
|
|
||||||
addr = data[:6]
|
|
||||||
payload = data[6:]
|
|
||||||
ensure_peer(addr)
|
|
||||||
esp.send(addr, payload)
|
|
||||||
last_used[addr] = time.ticks_ms()
|
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
# espnow-sender
|
||||||
|
|
||||||
|
Minimal MicroPython project for receiving JSON over Microdot WebSocket.
|
||||||
|
|
||||||
|
- WebSocket endpoint: `/ws`
|
||||||
|
- Entry point: `main.py`
|
||||||
|
- Message template: `msg.json`
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
import asyncio
|
||||||
|
import json
|
||||||
|
|
||||||
|
from microdot import Microdot
|
||||||
|
from microdot.websocket import WebSocketError, with_websocket
|
||||||
|
|
||||||
|
import espnow
|
||||||
|
import network
|
||||||
|
from util import format_mac, parse_mac
|
||||||
|
|
||||||
|
|
||||||
|
app = Microdot()
|
||||||
|
_esp = None
|
||||||
|
_known_peers = set()
|
||||||
|
_ws_clients = set()
|
||||||
|
|
||||||
|
|
||||||
|
def _init_espnow():
|
||||||
|
global _esp
|
||||||
|
sta = network.WLAN(network.STA_IF)
|
||||||
|
sta.active(True)
|
||||||
|
_esp = espnow.ESPNow()
|
||||||
|
_esp.active(True)
|
||||||
|
|
||||||
|
|
||||||
|
def _validate_envelope(obj):
|
||||||
|
if obj.get("v") != "1":
|
||||||
|
raise ValueError("message.v must be '1'")
|
||||||
|
devices = obj["devices"]
|
||||||
|
for address in devices.keys():
|
||||||
|
parse_mac(address)
|
||||||
|
return obj
|
||||||
|
|
||||||
|
|
||||||
|
def _send_espnow(address, payload):
|
||||||
|
if _esp is None:
|
||||||
|
raise ValueError("espnow is not initialized")
|
||||||
|
mac = parse_mac(address)
|
||||||
|
msg = json.dumps(payload, separators=(",", ":")).encode("utf-8")
|
||||||
|
if mac not in _known_peers:
|
||||||
|
_esp.add_peer(mac)
|
||||||
|
_known_peers.add(mac)
|
||||||
|
_esp.send(mac, msg)
|
||||||
|
return mac, len(msg)
|
||||||
|
|
||||||
|
|
||||||
|
async def _broadcast_ws(obj):
|
||||||
|
text = json.dumps(obj)
|
||||||
|
dead = []
|
||||||
|
for client in list(_ws_clients):
|
||||||
|
try:
|
||||||
|
await client.send(text)
|
||||||
|
except Exception:
|
||||||
|
dead.append(client)
|
||||||
|
for client in dead:
|
||||||
|
_ws_clients.discard(client)
|
||||||
|
|
||||||
|
|
||||||
|
async def _espnow_receive_loop():
|
||||||
|
while True:
|
||||||
|
host, msg = _esp.recv(0)
|
||||||
|
if not host:
|
||||||
|
await asyncio.sleep(0.01)
|
||||||
|
continue
|
||||||
|
await _broadcast_ws(
|
||||||
|
{
|
||||||
|
"from": format_mac(host),
|
||||||
|
"payload": msg.decode("utf-8"),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/ws")
|
||||||
|
@with_websocket
|
||||||
|
async def ws(request, ws):
|
||||||
|
_ws_clients.add(ws)
|
||||||
|
while True:
|
||||||
|
try:
|
||||||
|
raw = await ws.receive()
|
||||||
|
except WebSocketError:
|
||||||
|
break
|
||||||
|
|
||||||
|
if not raw:
|
||||||
|
break
|
||||||
|
|
||||||
|
try:
|
||||||
|
parsed = json.loads(raw)
|
||||||
|
env = _validate_envelope(parsed)
|
||||||
|
sent = []
|
||||||
|
for address, payload in env["devices"].items():
|
||||||
|
mac, payload_size = _send_espnow(address, payload)
|
||||||
|
sent.append(
|
||||||
|
{
|
||||||
|
"address": format_mac(mac),
|
||||||
|
"bytes": payload_size,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
except (ValueError, TypeError) as e:
|
||||||
|
await ws.send(json.dumps({"ok": False, "error": str(e)}))
|
||||||
|
continue
|
||||||
|
|
||||||
|
await ws.send(
|
||||||
|
json.dumps(
|
||||||
|
{
|
||||||
|
"ok": True,
|
||||||
|
"sent": sent,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
_ws_clients.discard(ws)
|
||||||
|
|
||||||
|
|
||||||
|
async def main(port=80):
|
||||||
|
_init_espnow()
|
||||||
|
asyncio.create_task(_espnow_receive_loop())
|
||||||
|
await app.start_server(host="0.0.0.0", port=port)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
asyncio.run(main(port=80))
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"v": "1",
|
||||||
|
"devices": {
|
||||||
|
"ff:ff:ff:ff:ff:ff": {
|
||||||
|
"presets": {
|
||||||
|
"preset_id": {
|
||||||
|
"pattern": "on",
|
||||||
|
"colors": ["#FF0000"],
|
||||||
|
"delay": 100,
|
||||||
|
"brightness": 255,
|
||||||
|
"auto": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"select": {
|
||||||
|
"preset": "preset_id",
|
||||||
|
"step": 0
|
||||||
|
},
|
||||||
|
"save": true,
|
||||||
|
"default": "preset_id",
|
||||||
|
"b": 255
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
def parse_mac(value):
|
||||||
|
raw = value.strip().lower().replace(":", "").replace("-", "")
|
||||||
|
if len(raw) != 12:
|
||||||
|
raise ValueError("address must be 12 hex chars or aa:bb:cc:dd:ee:ff")
|
||||||
|
try:
|
||||||
|
return bytes.fromhex(raw)
|
||||||
|
except ValueError:
|
||||||
|
raise ValueError("address contains non-hex characters")
|
||||||
|
|
||||||
|
|
||||||
|
def format_mac(mac_bytes):
|
||||||
|
return ":".join("{:02x}".format(b) for b in mac_bytes)
|
||||||
+1
-1
Submodule led-driver updated: dc19877132...2fcaf2f064.
Submodule
+1
Submodule led-simulator added at 7ce56b64df.
+1
-1
Submodule led-tool updated: 3844aa9d6a...d6331a105c.
@@ -0,0 +1,123 @@
|
|||||||
|
// Parametric LED bar vertical stand socket
|
||||||
|
// For a bar nominally 14 x 17 mm, 2 m long.
|
||||||
|
// This part is intended to be screwed to an MDF base.
|
||||||
|
|
||||||
|
// -------------------------
|
||||||
|
// User parameters
|
||||||
|
// -------------------------
|
||||||
|
bar_w = 14; // Bar width (mm)
|
||||||
|
bar_d = 17; // Bar depth (mm)
|
||||||
|
clearance = 0.4; // Total clearance added to each axis (mm)
|
||||||
|
|
||||||
|
socket_height = 36; // Height of printed socket body (mm)
|
||||||
|
wall = 3.2; // Socket wall thickness (mm)
|
||||||
|
base_thickness = 5; // Printed bottom plate thickness (mm)
|
||||||
|
|
||||||
|
// USB cable/connector side opening
|
||||||
|
usb_notch_enable = true;
|
||||||
|
usb_notch_w = 11;
|
||||||
|
usb_notch_h = 9;
|
||||||
|
usb_notch_from_bottom = 6;
|
||||||
|
usb_notch_side = "right"; // "right" or "left"
|
||||||
|
|
||||||
|
// Mounting ears for MDF screws
|
||||||
|
ear_enable = true;
|
||||||
|
ear_len = 16;
|
||||||
|
ear_w = 16;
|
||||||
|
ear_thickness = base_thickness;
|
||||||
|
screw_hole_d = 4.2; // M4 clearance. Use 3.4 for M3.
|
||||||
|
screw_hole_edge = 5.5; // Hole center offset from ear outer corner
|
||||||
|
|
||||||
|
// Optional clamp lip at top to reduce wobble
|
||||||
|
top_lip_enable = true;
|
||||||
|
top_lip_depth = 2.0; // Intrudes into opening on each side
|
||||||
|
top_lip_height = 3.0;
|
||||||
|
|
||||||
|
$fn = 48;
|
||||||
|
|
||||||
|
// -------------------------
|
||||||
|
// Derived
|
||||||
|
// -------------------------
|
||||||
|
inner_w = bar_w + clearance;
|
||||||
|
inner_d = bar_d + clearance;
|
||||||
|
|
||||||
|
outer_w = inner_w + wall * 2;
|
||||||
|
outer_d = inner_d + wall * 2;
|
||||||
|
outer_h = socket_height;
|
||||||
|
|
||||||
|
module screw_hole() {
|
||||||
|
cylinder(h = ear_thickness + 0.2, d = screw_hole_d);
|
||||||
|
}
|
||||||
|
|
||||||
|
module mounting_ear(sign_y = 1) {
|
||||||
|
translate([outer_w / 2, sign_y * (outer_d / 2), 0])
|
||||||
|
cube([ear_len, ear_w, ear_thickness], center = false);
|
||||||
|
}
|
||||||
|
|
||||||
|
module top_lip() {
|
||||||
|
if (top_lip_enable) {
|
||||||
|
// Front and back lips at the top of the socket.
|
||||||
|
translate([wall, wall, outer_h - top_lip_height])
|
||||||
|
cube([top_lip_depth, inner_d, top_lip_height]);
|
||||||
|
|
||||||
|
translate([outer_w - wall - top_lip_depth, wall, outer_h - top_lip_height])
|
||||||
|
cube([top_lip_depth, inner_d, top_lip_height]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
difference() {
|
||||||
|
union() {
|
||||||
|
// Main body
|
||||||
|
cube([outer_w, outer_d, outer_h], center = false);
|
||||||
|
|
||||||
|
// Base plate under socket for stiffness
|
||||||
|
translate([0, 0, -base_thickness])
|
||||||
|
cube([outer_w, outer_d, base_thickness], center = false);
|
||||||
|
|
||||||
|
// Mounting ears
|
||||||
|
if (ear_enable) {
|
||||||
|
translate([0, 0, -ear_thickness]) {
|
||||||
|
mounting_ear(1);
|
||||||
|
mounting_ear(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
top_lip();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main bar cavity
|
||||||
|
translate([wall, wall, 0])
|
||||||
|
cube([inner_w, inner_d, outer_h + 0.2], center = false);
|
||||||
|
|
||||||
|
// USB side notch
|
||||||
|
if (usb_notch_enable) {
|
||||||
|
if (usb_notch_side == "right") {
|
||||||
|
translate([outer_w - wall - 0.1, (outer_d - usb_notch_w) / 2, usb_notch_from_bottom])
|
||||||
|
cube([wall + 0.3, usb_notch_w, usb_notch_h], center = false);
|
||||||
|
} else {
|
||||||
|
translate([-0.2, (outer_d - usb_notch_w) / 2, usb_notch_from_bottom])
|
||||||
|
cube([wall + 0.3, usb_notch_w, usb_notch_h], center = false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Screw holes in ears
|
||||||
|
if (ear_enable) {
|
||||||
|
// Upper ear hole
|
||||||
|
translate([
|
||||||
|
outer_w / 2 + ear_len - screw_hole_edge,
|
||||||
|
outer_d / 2 + ear_w - screw_hole_edge,
|
||||||
|
-ear_thickness - 0.05
|
||||||
|
]) screw_hole();
|
||||||
|
|
||||||
|
// Lower ear hole
|
||||||
|
translate([
|
||||||
|
outer_w / 2 + ear_len - screw_hole_edge,
|
||||||
|
-outer_d / 2 + screw_hole_edge,
|
||||||
|
-ear_thickness - 0.05
|
||||||
|
]) screw_hole();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Print orientation helper:
|
||||||
|
// Keep the base/ears on the bed.
|
||||||
|
// If fit is tight, increase clearance to 0.5 or 0.6.
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
[tool.pytest.ini_options]
|
||||||
|
testpaths = ["tests"]
|
||||||
|
python_files = ["test_endpoints_pytest.py", "engine_tests/test_*.py"]
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
[pytest]
|
|
||||||
testpaths = tests
|
|
||||||
python_files = test_endpoints_pytest.py
|
|
||||||
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# Copy esp32/main.py to the connected ESP32 as /main.py (single line, no wrap).
|
|
||||||
cd "$(dirname "$0")/.."
|
|
||||||
pipenv run mpremote fs cp esp32/main.py :/main.py
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
PORT="${PORT:-80}"
|
||||||
|
|
||||||
|
# On watchfiles restarts the previous process can linger briefly.
|
||||||
|
# Proactively terminate any listener on the target port before boot.
|
||||||
|
pids="$(ss -ltnp "sport = :$PORT" 2>/dev/null | sed -n 's/.*pid=\([0-9]\+\).*/\1/p' | sort -u)"
|
||||||
|
if [ -n "${pids}" ]; then
|
||||||
|
kill -TERM ${pids} 2>/dev/null || true
|
||||||
|
sleep 0.3
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$ROOT_DIR/src"
|
||||||
|
exec python main.py
|
||||||
@@ -10,6 +10,18 @@ if [ ! -f "scripts/led-controller.service" ]; then
|
|||||||
echo "Run this script from the repo root."
|
echo "Run this script from the repo root."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
export PIPENV_VENV_IN_PROJECT="${PIPENV_VENV_IN_PROJECT:-1}"
|
||||||
|
if command -v pipenv >/dev/null 2>&1; then
|
||||||
|
PY="$(command -v python3)"
|
||||||
|
if [ -z "$PY" ]; then
|
||||||
|
echo "python3 not found; install python3." >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Ensuring Pipenv deps with $PY (venv in project: .venv when PIPENV_VENV_IN_PROJECT=1)…"
|
||||||
|
# --skip-lock: install from Pipfile only (avoids lock/Python hash mismatches on device).
|
||||||
|
pipenv install --quiet --skip-lock --python "$PY"
|
||||||
|
pipenv --venv > scripts/.led-controller-venv
|
||||||
|
fi
|
||||||
chmod +x scripts/start.sh
|
chmod +x scripts/start.sh
|
||||||
sudo cp "scripts/led-controller.service" "$UNIT_PATH"
|
sudo cp "scripts/led-controller.service" "$UNIT_PATH"
|
||||||
sudo systemctl daemon-reload
|
sudo systemctl daemon-reload
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=LED Controller web server
|
Description=LED Controller web server
|
||||||
After=network-online.target
|
# Use network.target only. Ordering after network-online.target can block `systemctl start`
|
||||||
Wants=network-online.target
|
# until wait-online finishes; Wi‑Fi/DHCP delays then look like a hung start job.
|
||||||
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
@@ -12,6 +13,8 @@ Environment=PATH=/home/pi/.local/bin:/usr/local/bin:/usr/bin:/bin
|
|||||||
ExecStart=/bin/bash /home/pi/led-controller/scripts/start.sh
|
ExecStart=/bin/bash /home/pi/led-controller/scripts/start.sh
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
# pipenv/first bind can be slow; avoid misleading "activating" forever if misconfigured
|
||||||
|
TimeoutStartSec=120
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
+35
-2
@@ -1,5 +1,38 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# Start the LED controller web server (port 80 by default).
|
# Start the LED controller web server (port 80 by default).
|
||||||
cd "$(dirname "$0")/.."
|
# Avoid `pipenv run` on the hot path — it re-resolves the env every time and is slow on a Pi.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||||
|
cd "$ROOT"
|
||||||
export PORT="${PORT:-80}"
|
export PORT="${PORT:-80}"
|
||||||
pipenv run run
|
export PIPENV_VENV_IN_PROJECT="${PIPENV_VENV_IN_PROJECT:-1}"
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||||
|
CACHE="$SCRIPT_DIR/.led-controller-venv"
|
||||||
|
PYTHON=""
|
||||||
|
|
||||||
|
if [ -x "$ROOT/.venv/bin/python" ]; then
|
||||||
|
PYTHON="$ROOT/.venv/bin/python"
|
||||||
|
elif [ -f "$CACHE" ]; then
|
||||||
|
_v="$(tr -d '\r\n' < "$CACHE")"
|
||||||
|
if [ -n "$_v" ] && [ -x "$_v/bin/python" ]; then
|
||||||
|
PYTHON="$_v/bin/python"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$PYTHON" ] && command -v pipenv >/dev/null 2>&1; then
|
||||||
|
_v="$(cd "$ROOT" && pipenv --venv 2>/dev/null || true)"
|
||||||
|
if [ -n "${_v:-}" ] && [ -x "$_v/bin/python" ]; then
|
||||||
|
PYTHON="$_v/bin/python"
|
||||||
|
printf '%s\n' "$_v" > "$CACHE" || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "$PYTHON" ]; then
|
||||||
|
echo 'led-controller: no venv resolved; using pipenv run (slow). Run: cd '"$ROOT"' && PIPENV_VENV_IN_PROJECT=1 pipenv install --skip-lock --python "$(command -v python3)"' >&2
|
||||||
|
exec pipenv run run
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "$ROOT/src"
|
||||||
|
exec "$PYTHON" -u main.py
|
||||||
+344
-19
@@ -1,29 +1,170 @@
|
|||||||
from microdot import Microdot
|
from microdot import Microdot
|
||||||
from models.device import Device
|
from models.device import (
|
||||||
|
Device,
|
||||||
|
derive_device_mac,
|
||||||
|
validate_device_transport,
|
||||||
|
validate_device_type,
|
||||||
|
)
|
||||||
|
from models.transport import get_current_sender
|
||||||
|
from models.wifi_ws_clients import (
|
||||||
|
normalize_tcp_peer_ip,
|
||||||
|
send_json_line_to_ip,
|
||||||
|
tcp_client_connected,
|
||||||
|
)
|
||||||
|
from util.driver_patterns import driver_patterns_dir
|
||||||
|
from util.espnow_message import build_message
|
||||||
|
import asyncio
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
import socket
|
||||||
|
from urllib.parse import quote
|
||||||
|
|
||||||
|
# Ephemeral driver preset name (never written to Pi preset store; ``save`` not set on wire).
|
||||||
|
_IDENTIFY_PRESET_KEY = "__identify"
|
||||||
|
|
||||||
|
# Short-key payload: 10 Hz full cycle = 50 ms on + 50 ms off (driver ``blink`` toggles each ``d`` ms).
|
||||||
|
_IDENTIFY_DRIVER_PRESET = {
|
||||||
|
"p": "blink",
|
||||||
|
"c": ["#ff0000"],
|
||||||
|
"d": 50,
|
||||||
|
"b": 128,
|
||||||
|
"a": True,
|
||||||
|
"n1": 0,
|
||||||
|
"n2": 0,
|
||||||
|
"n3": 0,
|
||||||
|
"n4": 0,
|
||||||
|
"n5": 0,
|
||||||
|
"n6": 0,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def _compact_v1_json(*, presets=None, select=None, save=False):
|
||||||
|
"""Single-line v1 object; compact so serial/ESP-NOW stays small."""
|
||||||
|
body = {"v": "1"}
|
||||||
|
if presets is not None:
|
||||||
|
body["presets"] = presets
|
||||||
|
if save:
|
||||||
|
body["save"] = True
|
||||||
|
if select is not None:
|
||||||
|
body["select"] = select
|
||||||
|
return json.dumps(body, separators=(",", ":"))
|
||||||
|
|
||||||
|
# Seconds after identify blink before selecting built-in ``off`` (tests may monkeypatch).
|
||||||
|
IDENTIFY_OFF_DELAY_S = 2.0
|
||||||
|
|
||||||
controller = Microdot()
|
controller = Microdot()
|
||||||
devices = Device()
|
devices = Device()
|
||||||
|
|
||||||
|
|
||||||
|
def _device_live_connected(dev_dict):
|
||||||
|
"""
|
||||||
|
Wi-Fi: whether the controller has an outbound WebSocket to this device's IP.
|
||||||
|
ESP-NOW: None (no Wi-Fi session on the Pi for that transport).
|
||||||
|
"""
|
||||||
|
tr = (dev_dict.get("transport") or "espnow").strip().lower()
|
||||||
|
if tr != "wifi":
|
||||||
|
return None
|
||||||
|
ip = normalize_tcp_peer_ip(dev_dict.get("address") or "")
|
||||||
|
if not ip:
|
||||||
|
return False
|
||||||
|
return tcp_client_connected(ip)
|
||||||
|
|
||||||
|
|
||||||
|
def _device_json_with_live_status(dev_dict):
|
||||||
|
row = dict(dev_dict)
|
||||||
|
row["connected"] = _device_live_connected(dev_dict)
|
||||||
|
return row
|
||||||
|
|
||||||
|
|
||||||
|
def _safe_pattern_filename(name):
|
||||||
|
if not isinstance(name, str):
|
||||||
|
return False
|
||||||
|
if not name.endswith(".py"):
|
||||||
|
return False
|
||||||
|
if "/" in name or "\\" in name or ".." in name:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
def _http_post_pattern_source(ip, filename, code_text, reload_patterns=True, timeout_s=10.0):
|
||||||
|
"""POST source to driver /patterns/upload?name=...&reload=...; return True on 2xx."""
|
||||||
|
if not isinstance(ip, str) or not ip.strip():
|
||||||
|
return False
|
||||||
|
if not isinstance(filename, str) or not filename:
|
||||||
|
return False
|
||||||
|
if not isinstance(code_text, str):
|
||||||
|
return False
|
||||||
|
|
||||||
|
name_q = quote(filename, safe="")
|
||||||
|
reload_q = "1" if reload_patterns else "0"
|
||||||
|
path = "/patterns/upload?name=%s&reload=%s" % (name_q, reload_q)
|
||||||
|
body = code_text.encode("utf-8")
|
||||||
|
req = (
|
||||||
|
"POST %s HTTP/1.1\r\n"
|
||||||
|
"Host: %s\r\n"
|
||||||
|
"Content-Type: text/plain; charset=utf-8\r\n"
|
||||||
|
"Content-Length: %d\r\n"
|
||||||
|
"Connection: close\r\n"
|
||||||
|
"\r\n" % (path, ip, len(body))
|
||||||
|
).encode("utf-8") + body
|
||||||
|
|
||||||
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
try:
|
||||||
|
sock.settimeout(timeout_s)
|
||||||
|
sock.connect((ip.strip(), 80))
|
||||||
|
sock.sendall(req)
|
||||||
|
data = b""
|
||||||
|
while True:
|
||||||
|
chunk = sock.recv(1024)
|
||||||
|
if not chunk:
|
||||||
|
break
|
||||||
|
data += chunk
|
||||||
|
except OSError:
|
||||||
|
return False
|
||||||
|
finally:
|
||||||
|
try:
|
||||||
|
sock.close()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
first_line = data.split(b"\r\n", 1)[0] if data else b""
|
||||||
|
return b" 2" in first_line
|
||||||
|
|
||||||
|
|
||||||
|
async def _identify_send_off_after_delay(sender, transport, wifi_ip, dev_id, name):
|
||||||
|
try:
|
||||||
|
await asyncio.sleep(IDENTIFY_OFF_DELAY_S)
|
||||||
|
off_msg = build_message(select={name: ["off"]})
|
||||||
|
if transport == "wifi":
|
||||||
|
await send_json_line_to_ip(wifi_ip, off_msg)
|
||||||
|
else:
|
||||||
|
await sender.send(off_msg, addr=dev_id)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
@controller.get("")
|
@controller.get("")
|
||||||
async def list_devices(request):
|
async def list_devices(request):
|
||||||
"""List all devices."""
|
"""List all devices (includes ``connected`` for live Wi-Fi WebSocket presence)."""
|
||||||
devices_data = {}
|
devices_data = {}
|
||||||
for dev_id in devices.list():
|
for dev_id in devices.list():
|
||||||
d = devices.read(dev_id)
|
d = devices.read(dev_id)
|
||||||
if d:
|
if d:
|
||||||
devices_data[dev_id] = d
|
devices_data[dev_id] = _device_json_with_live_status(d)
|
||||||
return json.dumps(devices_data), 200, {"Content-Type": "application/json"}
|
return json.dumps(devices_data), 200, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
@controller.get("/<id>")
|
@controller.get("/<id>")
|
||||||
async def get_device(request, id):
|
async def get_device(request, id):
|
||||||
"""Get a device by ID."""
|
"""Get a device by ID (includes ``connected`` for live Wi-Fi WebSocket presence)."""
|
||||||
dev = devices.read(id)
|
dev = devices.read(id)
|
||||||
if dev:
|
if dev:
|
||||||
return json.dumps(dev), 200, {"Content-Type": "application/json"}
|
return json.dumps(_device_json_with_live_status(dev)), 200, {
|
||||||
return json.dumps({"error": "Device not found"}), 404
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
return json.dumps({"error": "Device not found"}), 404, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@controller.post("")
|
@controller.post("")
|
||||||
@@ -32,37 +173,221 @@ async def create_device(request):
|
|||||||
try:
|
try:
|
||||||
data = request.json or {}
|
data = request.json or {}
|
||||||
name = data.get("name", "").strip()
|
name = data.get("name", "").strip()
|
||||||
|
if not name:
|
||||||
|
return json.dumps({"error": "name is required"}), 400, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
try:
|
||||||
|
device_type = validate_device_type(data.get("type", "led"))
|
||||||
|
transport = validate_device_transport(data.get("transport", "espnow"))
|
||||||
|
except ValueError as e:
|
||||||
|
return json.dumps({"error": str(e)}), 400, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
address = data.get("address")
|
address = data.get("address")
|
||||||
|
mac = data.get("mac")
|
||||||
|
if derive_device_mac(mac=mac, address=address, transport=transport) is None:
|
||||||
|
return json.dumps(
|
||||||
|
{
|
||||||
|
"error": "mac is required (12 hex digits); for Wi-Fi include mac plus IP in address"
|
||||||
|
}
|
||||||
|
), 400, {"Content-Type": "application/json"}
|
||||||
default_pattern = data.get("default_pattern")
|
default_pattern = data.get("default_pattern")
|
||||||
tabs = data.get("tabs")
|
zl = data.get("zones")
|
||||||
if isinstance(tabs, list):
|
if isinstance(zl, list):
|
||||||
tabs = [str(t) for t in tabs]
|
zl = [str(t) for t in zl]
|
||||||
else:
|
else:
|
||||||
tabs = []
|
zl = []
|
||||||
dev_id = devices.create(name=name, address=address, default_pattern=default_pattern, tabs=tabs)
|
dev_id = devices.create(
|
||||||
|
name=name,
|
||||||
|
address=address,
|
||||||
|
mac=mac,
|
||||||
|
default_pattern=default_pattern,
|
||||||
|
zones=zl,
|
||||||
|
device_type=device_type,
|
||||||
|
transport=transport,
|
||||||
|
)
|
||||||
dev = devices.read(dev_id)
|
dev = devices.read(dev_id)
|
||||||
return json.dumps({dev_id: dev}), 201, {"Content-Type": "application/json"}
|
return json.dumps({dev_id: dev}), 201, {"Content-Type": "application/json"}
|
||||||
|
except ValueError as e:
|
||||||
|
msg = str(e)
|
||||||
|
code = 409 if "already exists" in msg.lower() else 400
|
||||||
|
return json.dumps({"error": msg}), code, {"Content-Type": "application/json"}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return json.dumps({"error": str(e)}), 400
|
return json.dumps({"error": str(e)}), 400, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
@controller.put("/<id>")
|
@controller.put("/<id>")
|
||||||
async def update_device(request, id):
|
async def update_device(request, id):
|
||||||
"""Update a device."""
|
"""Update a device."""
|
||||||
try:
|
try:
|
||||||
data = request.json or {}
|
raw = request.json or {}
|
||||||
if "tabs" in data and isinstance(data["tabs"], list):
|
data = dict(raw)
|
||||||
data["tabs"] = [str(t) for t in data["tabs"]]
|
data.pop("id", None)
|
||||||
|
data.pop("addresses", None)
|
||||||
|
data.pop("connected", None)
|
||||||
|
if "name" in data:
|
||||||
|
n = (data.get("name") or "").strip()
|
||||||
|
if not n:
|
||||||
|
return json.dumps({"error": "name cannot be empty"}), 400, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
data["name"] = n
|
||||||
|
if "type" in data:
|
||||||
|
data["type"] = validate_device_type(data.get("type"))
|
||||||
|
if "transport" in data:
|
||||||
|
data["transport"] = validate_device_transport(data.get("transport"))
|
||||||
|
if "zones" in data and isinstance(data["zones"], list):
|
||||||
|
data["zones"] = [str(t) for t in data["zones"]]
|
||||||
if devices.update(id, data):
|
if devices.update(id, data):
|
||||||
return json.dumps(devices.read(id)), 200, {"Content-Type": "application/json"}
|
return json.dumps(devices.read(id)), 200, {"Content-Type": "application/json"}
|
||||||
return json.dumps({"error": "Device not found"}), 404
|
return json.dumps({"error": "Device not found"}), 404, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
except ValueError as e:
|
||||||
|
return json.dumps({"error": str(e)}), 400, {"Content-Type": "application/json"}
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return json.dumps({"error": str(e)}), 400
|
return json.dumps({"error": str(e)}), 400, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
@controller.delete("/<id>")
|
@controller.delete("/<id>")
|
||||||
async def delete_device(request, id):
|
async def delete_device(request, id):
|
||||||
"""Delete a device."""
|
"""Delete a device."""
|
||||||
if devices.delete(id):
|
if devices.delete(id):
|
||||||
return json.dumps({"message": "Device deleted successfully"}), 200
|
return (
|
||||||
return json.dumps({"error": "Device not found"}), 404
|
json.dumps({"message": "Device deleted successfully"}),
|
||||||
|
200,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
return json.dumps({"error": "Device not found"}), 404, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post("/<id>/identify")
|
||||||
|
async def identify_device(request, id):
|
||||||
|
"""
|
||||||
|
One v1 JSON object: ``presets.__identify`` (``d``=50 ms → 10 Hz blink) plus ``select`` for
|
||||||
|
this device name — same combined shape as profile sends the driver already accepts over TCP
|
||||||
|
/ ESP-NOW. No ``save``. After ``IDENTIFY_OFF_DELAY_S``, a background task selects ``off``.
|
||||||
|
"""
|
||||||
|
dev = devices.read(id)
|
||||||
|
if not dev:
|
||||||
|
return json.dumps({"error": "Device not found"}), 404, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
sender = get_current_sender()
|
||||||
|
if not sender:
|
||||||
|
return json.dumps({"error": "Transport not configured"}), 503, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
name = str(dev.get("name") or "").strip()
|
||||||
|
if not name:
|
||||||
|
return json.dumps({"error": "Device must have a name to identify"}), 400, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
|
||||||
|
transport = dev.get("transport") or "espnow"
|
||||||
|
wifi_ip = None
|
||||||
|
if transport == "wifi":
|
||||||
|
wifi_ip = dev.get("address")
|
||||||
|
if not wifi_ip:
|
||||||
|
return json.dumps({"error": "Device has no IP address"}), 400, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
msg = _compact_v1_json(
|
||||||
|
presets={_IDENTIFY_PRESET_KEY: dict(_IDENTIFY_DRIVER_PRESET)},
|
||||||
|
select={name: [_IDENTIFY_PRESET_KEY]},
|
||||||
|
)
|
||||||
|
if transport == "wifi":
|
||||||
|
ok = await send_json_line_to_ip(wifi_ip, msg)
|
||||||
|
if not ok:
|
||||||
|
return json.dumps({"error": "Wi-Fi driver not connected"}), 503, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
await sender.send(msg, addr=id)
|
||||||
|
|
||||||
|
asyncio.create_task(
|
||||||
|
_identify_send_off_after_delay(sender, transport, wifi_ip, id, name)
|
||||||
|
)
|
||||||
|
except Exception as e:
|
||||||
|
return json.dumps({"error": str(e)}), 503, {"Content-Type": "application/json"}
|
||||||
|
return json.dumps({"message": "Identify sent"}), 200, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post("/<id>/patterns/push")
|
||||||
|
async def push_patterns_ota(request, id):
|
||||||
|
"""
|
||||||
|
Push all local pattern files directly to a Wi-Fi LED driver over HTTP upload.
|
||||||
|
"""
|
||||||
|
dev = devices.read(id)
|
||||||
|
if not dev:
|
||||||
|
return json.dumps({"error": "Device not found"}), 404, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
if (dev.get("transport") or "").lower() != "wifi":
|
||||||
|
return json.dumps({"error": "Pattern OTA push is only supported for Wi-Fi devices"}), 400, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
wifi_ip = str(dev.get("address") or "").strip()
|
||||||
|
if not wifi_ip:
|
||||||
|
return json.dumps({"error": "Device has no IP address"}), 400, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
|
||||||
|
base_dir = driver_patterns_dir()
|
||||||
|
try:
|
||||||
|
names = sorted(os.listdir(base_dir))
|
||||||
|
except OSError as e:
|
||||||
|
return json.dumps({"error": str(e)}), 500, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
|
||||||
|
files = [n for n in names if _safe_pattern_filename(n) and n != "__init__.py"]
|
||||||
|
if not files:
|
||||||
|
return json.dumps({"error": "No pattern files found"}), 404, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
|
||||||
|
sent = []
|
||||||
|
failed = []
|
||||||
|
total = len(files)
|
||||||
|
for idx, filename in enumerate(files):
|
||||||
|
path = os.path.join(base_dir, filename)
|
||||||
|
try:
|
||||||
|
with open(path, "r") as f:
|
||||||
|
code = f.read()
|
||||||
|
except OSError:
|
||||||
|
failed.append(filename)
|
||||||
|
continue
|
||||||
|
reload_patterns = idx == (total - 1)
|
||||||
|
ok = _http_post_pattern_source(
|
||||||
|
wifi_ip,
|
||||||
|
filename,
|
||||||
|
code,
|
||||||
|
reload_patterns=reload_patterns,
|
||||||
|
timeout_s=10.0,
|
||||||
|
)
|
||||||
|
if ok:
|
||||||
|
sent.append(filename)
|
||||||
|
else:
|
||||||
|
failed.append(filename)
|
||||||
|
|
||||||
|
if not sent:
|
||||||
|
return json.dumps({"error": "Wi-Fi driver did not accept pattern uploads", "failed": failed}), 503, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
|
|
||||||
|
return json.dumps({
|
||||||
|
"message": "Pattern files uploaded",
|
||||||
|
"sent_count": len(sent),
|
||||||
|
"sent": sent,
|
||||||
|
"failed": failed,
|
||||||
|
}), 200, {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
@@ -0,0 +1,189 @@
|
|||||||
|
import json
|
||||||
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from microdot import Microdot
|
||||||
|
from serial.tools import list_ports
|
||||||
|
|
||||||
|
controller = Microdot()
|
||||||
|
|
||||||
|
|
||||||
|
def _repo_root() -> str:
|
||||||
|
return os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
|
||||||
|
|
||||||
|
|
||||||
|
def _led_cli_path() -> str:
|
||||||
|
return os.path.join(_repo_root(), "led-tool", "cli.py")
|
||||||
|
|
||||||
|
|
||||||
|
def _build_led_cli_command(port: str, payload: dict):
|
||||||
|
cmd = [sys.executable, _led_cli_path(), "--port", port]
|
||||||
|
|
||||||
|
flag_map = (
|
||||||
|
("name", "--name"),
|
||||||
|
("led_pin", "--pin"),
|
||||||
|
("num_leds", "--leds"),
|
||||||
|
("brightness", "--brightness"),
|
||||||
|
("transport", "--transport"),
|
||||||
|
("ssid", "--ssid"),
|
||||||
|
("password", "--wifi-password"),
|
||||||
|
("wifi_channel", "--wifi-channel"),
|
||||||
|
("default", "--default"),
|
||||||
|
)
|
||||||
|
|
||||||
|
for key, flag in flag_map:
|
||||||
|
value = payload.get(key)
|
||||||
|
if value is None:
|
||||||
|
continue
|
||||||
|
value_str = str(value).strip()
|
||||||
|
if value_str == "":
|
||||||
|
continue
|
||||||
|
cmd.extend([flag, value_str])
|
||||||
|
|
||||||
|
return cmd
|
||||||
|
|
||||||
|
|
||||||
|
def _run_led_cli_command(cmd, cli_path: str, timeout_s=180):
|
||||||
|
try:
|
||||||
|
result = subprocess.run(
|
||||||
|
cmd,
|
||||||
|
capture_output=True,
|
||||||
|
text=True,
|
||||||
|
timeout=timeout_s,
|
||||||
|
cwd=os.path.dirname(cli_path),
|
||||||
|
)
|
||||||
|
except subprocess.TimeoutExpired:
|
||||||
|
return (
|
||||||
|
json.dumps({"error": "led-tool command timed out after 180 seconds"}),
|
||||||
|
504,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
except Exception as exc:
|
||||||
|
return (
|
||||||
|
json.dumps({"error": str(exc)}),
|
||||||
|
500,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
return (
|
||||||
|
json.dumps(
|
||||||
|
{
|
||||||
|
"ok": result.returncode == 0,
|
||||||
|
"returncode": result.returncode,
|
||||||
|
"stdout": result.stdout,
|
||||||
|
"stderr": result.stderr,
|
||||||
|
"command": cmd,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
200,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _extract_settings_from_stdout(stdout: str):
|
||||||
|
text = (stdout or "").strip()
|
||||||
|
if not text:
|
||||||
|
return None
|
||||||
|
try:
|
||||||
|
parsed = json.loads(text)
|
||||||
|
return parsed if isinstance(parsed, dict) else None
|
||||||
|
except Exception:
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get("/ports")
|
||||||
|
async def list_serial_ports(request):
|
||||||
|
ports = []
|
||||||
|
for info in list_ports.comports():
|
||||||
|
ports.append(
|
||||||
|
{
|
||||||
|
"device": info.device,
|
||||||
|
"description": info.description,
|
||||||
|
"hwid": info.hwid,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
return (
|
||||||
|
json.dumps(
|
||||||
|
{
|
||||||
|
"ports": ports,
|
||||||
|
"led_cli_exists": os.path.exists(_led_cli_path()),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
200,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post("/settings")
|
||||||
|
async def apply_settings(request):
|
||||||
|
data = request.json or {}
|
||||||
|
port = str(data.get("port") or "").strip()
|
||||||
|
if not port:
|
||||||
|
return (
|
||||||
|
json.dumps({"error": "port is required"}),
|
||||||
|
400,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
cli_path = _led_cli_path()
|
||||||
|
if not os.path.exists(cli_path):
|
||||||
|
return (
|
||||||
|
json.dumps({"error": "led-tool/cli.py not found"}),
|
||||||
|
500,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
cmd = _build_led_cli_command(port, data) + ["--follow"]
|
||||||
|
return _run_led_cli_command(cmd, cli_path, timeout_s=None)
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post("/reset")
|
||||||
|
@controller.post("/reset/")
|
||||||
|
async def reset_device(request):
|
||||||
|
data = request.json or {}
|
||||||
|
port = str(data.get("port") or "").strip()
|
||||||
|
if not port:
|
||||||
|
return (
|
||||||
|
json.dumps({"error": "port is required"}),
|
||||||
|
400,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
cli_path = _led_cli_path()
|
||||||
|
if not os.path.exists(cli_path):
|
||||||
|
return (
|
||||||
|
json.dumps({"error": "led-tool/cli.py not found"}),
|
||||||
|
500,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
cmd = [sys.executable, cli_path, "--port", port, "--reset", "--follow"]
|
||||||
|
return _run_led_cli_command(cmd, cli_path, timeout_s=None)
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get("/settings")
|
||||||
|
async def read_settings(request):
|
||||||
|
port = str(request.args.get("port") or "").strip()
|
||||||
|
if not port:
|
||||||
|
return (
|
||||||
|
json.dumps({"error": "port is required"}),
|
||||||
|
400,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
cli_path = _led_cli_path()
|
||||||
|
if not os.path.exists(cli_path):
|
||||||
|
return (
|
||||||
|
json.dumps({"error": "led-tool/cli.py not found"}),
|
||||||
|
500,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
cmd = [sys.executable, cli_path, "--port", port, "--show"]
|
||||||
|
body, status, headers = _run_led_cli_command(cmd, cli_path)
|
||||||
|
if status != 200:
|
||||||
|
return body, status, headers
|
||||||
|
data = json.loads(body)
|
||||||
|
data["settings"] = _extract_settings_from_stdout(data.get("stdout") or "")
|
||||||
|
return json.dumps(data), status, headers
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
from microdot import Microdot
|
||||||
|
from models.output import Output
|
||||||
|
from engine.outputs import open_output
|
||||||
|
import asyncio
|
||||||
|
import json
|
||||||
|
|
||||||
|
controller = Microdot()
|
||||||
|
outputs = Output()
|
||||||
|
|
||||||
|
_JSON = {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
TEST_COLORS = ((255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 255, 255))
|
||||||
|
|
||||||
|
|
||||||
|
async def run_output_test(out, step_s=1.0):
|
||||||
|
"""Red, green, blue, white for ``step_s`` each, then black."""
|
||||||
|
await out.open()
|
||||||
|
try:
|
||||||
|
for color in TEST_COLORS:
|
||||||
|
frame = bytes(color) * out.pixel_count
|
||||||
|
end = asyncio.get_running_loop().time() + step_s
|
||||||
|
while asyncio.get_running_loop().time() < end:
|
||||||
|
await out.send(frame)
|
||||||
|
await asyncio.sleep(1.0 / out.fps)
|
||||||
|
finally:
|
||||||
|
await out.close()
|
||||||
|
return out.status()
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get('')
|
||||||
|
async def list_outputs(request):
|
||||||
|
"""List all pixel outputs."""
|
||||||
|
return json.dumps(outputs), 200, _JSON
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get('/<id>')
|
||||||
|
async def get_output(request, id):
|
||||||
|
doc = outputs.read(id)
|
||||||
|
if doc:
|
||||||
|
return json.dumps(doc), 200, _JSON
|
||||||
|
return json.dumps({"error": "Output not found"}), 404, _JSON
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('')
|
||||||
|
async def create_output(request):
|
||||||
|
try:
|
||||||
|
output_id = outputs.create(request.json or {})
|
||||||
|
return json.dumps(outputs.read(output_id)), 201, _JSON
|
||||||
|
except ValueError as e:
|
||||||
|
return json.dumps({"error": str(e)}), 400, _JSON
|
||||||
|
|
||||||
|
|
||||||
|
@controller.put('/<id>')
|
||||||
|
async def update_output(request, id):
|
||||||
|
try:
|
||||||
|
if outputs.update(id, request.json or {}):
|
||||||
|
return json.dumps(outputs.read(id)), 200, _JSON
|
||||||
|
return json.dumps({"error": "Output not found"}), 404, _JSON
|
||||||
|
except ValueError as e:
|
||||||
|
return json.dumps({"error": str(e)}), 400, _JSON
|
||||||
|
|
||||||
|
|
||||||
|
@controller.delete('/<id>')
|
||||||
|
async def delete_output(request, id):
|
||||||
|
if outputs.delete(id):
|
||||||
|
return json.dumps({"message": "Output deleted successfully"}), 200, _JSON
|
||||||
|
return json.dumps({"error": "Output not found"}), 404, _JSON
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('/<id>/test')
|
||||||
|
async def test_output(request, id):
|
||||||
|
"""Send a short red/green/blue/white test sequence, then black."""
|
||||||
|
doc = outputs.read(id)
|
||||||
|
if not doc:
|
||||||
|
return json.dumps({"error": "Output not found"}), 404, _JSON
|
||||||
|
data = request.json or {}
|
||||||
|
try:
|
||||||
|
step_s = max(0.1, min(5.0, float(data.get("step_s", 1.0))))
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
step_s = 1.0
|
||||||
|
try:
|
||||||
|
status = await run_output_test(open_output(doc), step_s=step_s)
|
||||||
|
except Exception as e:
|
||||||
|
return json.dumps({"error": f"Test failed: {e}"}), 503, _JSON
|
||||||
|
return json.dumps({"message": "Test sent", "status": status}), 200, _JSON
|
||||||
+419
-8
@@ -1,19 +1,113 @@
|
|||||||
from microdot import Microdot
|
from microdot import Microdot
|
||||||
from models.pattern import Pattern
|
from models.pattern import Pattern
|
||||||
|
from models.device import Device
|
||||||
|
from util.driver_patterns import (
|
||||||
|
driver_patterns_dir,
|
||||||
|
is_firmware_builtin_pattern_module,
|
||||||
|
normalize_pattern_py_filename,
|
||||||
|
)
|
||||||
import json
|
import json
|
||||||
import sys
|
import re
|
||||||
|
import os
|
||||||
|
import socket
|
||||||
|
from urllib.parse import quote
|
||||||
|
|
||||||
controller = Microdot()
|
controller = Microdot()
|
||||||
patterns = Pattern()
|
patterns = Pattern()
|
||||||
|
|
||||||
|
|
||||||
|
def _project_root():
|
||||||
|
"""Project root (parent of ``src/``). CWD is often ``src/`` when running ``main.py``."""
|
||||||
|
here = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
return os.path.abspath(os.path.join(here, "..", ".."))
|
||||||
|
|
||||||
|
|
||||||
|
def _safe_pattern_filename(name):
|
||||||
|
if not isinstance(name, str):
|
||||||
|
return False
|
||||||
|
if not name.endswith(".py"):
|
||||||
|
return False
|
||||||
|
if "/" in name or "\\" in name or ".." in name:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
_PATTERN_KEY_RE = re.compile(r"^[a-zA-Z_][a-zA-Z0-9_]{0,63}$")
|
||||||
|
|
||||||
|
|
||||||
|
def _normalize_pattern_key(raw):
|
||||||
|
"""Pattern id / module basename (no .py)."""
|
||||||
|
if not isinstance(raw, str):
|
||||||
|
return ""
|
||||||
|
s = raw.strip()
|
||||||
|
if s.lower().endswith(".py"):
|
||||||
|
s = s[:-3].strip()
|
||||||
|
return s
|
||||||
|
|
||||||
|
|
||||||
|
def _valid_pattern_key(key):
|
||||||
|
return bool(key and _PATTERN_KEY_RE.match(key))
|
||||||
|
|
||||||
|
|
||||||
|
def _http_post_pattern_source(ip, filename, code_text, reload_patterns=True, timeout_s=10.0):
|
||||||
|
"""POST source to driver /patterns/upload?name=...&reload=...; return True on 2xx."""
|
||||||
|
if not isinstance(ip, str) or not ip.strip():
|
||||||
|
return False
|
||||||
|
if not isinstance(filename, str) or not filename:
|
||||||
|
return False
|
||||||
|
if not isinstance(code_text, str):
|
||||||
|
return False
|
||||||
|
|
||||||
|
name_q = quote(filename, safe="")
|
||||||
|
reload_q = "1" if reload_patterns else "0"
|
||||||
|
path = "/patterns/upload?name=%s&reload=%s" % (name_q, reload_q)
|
||||||
|
body = code_text.encode("utf-8")
|
||||||
|
req = (
|
||||||
|
"POST %s HTTP/1.1\r\n"
|
||||||
|
"Host: %s\r\n"
|
||||||
|
"Content-Type: text/plain; charset=utf-8\r\n"
|
||||||
|
"Content-Length: %d\r\n"
|
||||||
|
"Connection: close\r\n"
|
||||||
|
"\r\n" % (path, ip, len(body))
|
||||||
|
).encode("utf-8") + body
|
||||||
|
|
||||||
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
try:
|
||||||
|
sock.settimeout(timeout_s)
|
||||||
|
sock.connect((ip.strip(), 80))
|
||||||
|
sock.sendall(req)
|
||||||
|
data = b""
|
||||||
|
while True:
|
||||||
|
chunk = sock.recv(1024)
|
||||||
|
if not chunk:
|
||||||
|
break
|
||||||
|
data += chunk
|
||||||
|
except OSError:
|
||||||
|
return False
|
||||||
|
finally:
|
||||||
|
try:
|
||||||
|
sock.close()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
first_line = data.split(b"\r\n", 1)[0] if data else b""
|
||||||
|
# Accept any 2xx status.
|
||||||
|
return b" 2" in first_line
|
||||||
|
|
||||||
def load_pattern_definitions():
|
def load_pattern_definitions():
|
||||||
"""Load pattern definitions from pattern.json file."""
|
"""Load pattern definitions from pattern.json file."""
|
||||||
try:
|
try:
|
||||||
# Try different paths for local development vs MicroPython
|
root = _project_root()
|
||||||
paths = ['db/pattern.json', 'pattern.json', '/db/pattern.json']
|
paths = [
|
||||||
|
os.path.join(root, "db", "pattern.json"),
|
||||||
|
os.path.join(root, "pattern.json"),
|
||||||
|
"db/pattern.json",
|
||||||
|
"pattern.json",
|
||||||
|
"/db/pattern.json",
|
||||||
|
]
|
||||||
for path in paths:
|
for path in paths:
|
||||||
try:
|
try:
|
||||||
with open(path, 'r') as f:
|
with open(path, "r") as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
except OSError:
|
except OSError:
|
||||||
continue
|
continue
|
||||||
@@ -22,16 +116,333 @@ def load_pattern_definitions():
|
|||||||
print(f"Error loading pattern.json: {e}")
|
print(f"Error loading pattern.json: {e}")
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
|
def load_driver_pattern_names():
|
||||||
|
"""List available pattern module names from led-driver/src/patterns."""
|
||||||
|
try:
|
||||||
|
names = []
|
||||||
|
for filename in os.listdir(driver_patterns_dir()):
|
||||||
|
if not _safe_pattern_filename(filename) or filename == "__init__.py":
|
||||||
|
continue
|
||||||
|
names.append(filename[:-3])
|
||||||
|
names.sort()
|
||||||
|
return names
|
||||||
|
except OSError:
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def build_runtime_pattern_map():
|
||||||
|
"""
|
||||||
|
Runtime pattern map for UI menus.
|
||||||
|
Keep pattern DB metadata as primary, then add any local driver pattern files
|
||||||
|
missing from the DB so new OTA files still appear in menus.
|
||||||
|
"""
|
||||||
|
definitions = load_pattern_definitions()
|
||||||
|
available = load_driver_pattern_names()
|
||||||
|
result = {}
|
||||||
|
for name, meta in definitions.items():
|
||||||
|
result[name] = dict(meta) if isinstance(meta, dict) else {}
|
||||||
|
for name in available:
|
||||||
|
if name not in result:
|
||||||
|
result[name] = {}
|
||||||
|
return result
|
||||||
|
|
||||||
@controller.get('/definitions')
|
@controller.get('/definitions')
|
||||||
async def get_pattern_definitions(request):
|
async def get_pattern_definitions(request):
|
||||||
"""Get pattern definitions from pattern.json."""
|
"""Get definitions for patterns currently available on the driver."""
|
||||||
definitions = load_pattern_definitions()
|
definitions = build_runtime_pattern_map()
|
||||||
return json.dumps(definitions), 200, {'Content-Type': 'application/json'}
|
return json.dumps(definitions), 200, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get('/ota/manifest')
|
||||||
|
async def ota_manifest(request):
|
||||||
|
"""Manifest of driver pattern source files for OTA pulls."""
|
||||||
|
base_dir = driver_patterns_dir()
|
||||||
|
host = request.headers.get("Host", "")
|
||||||
|
if not host:
|
||||||
|
return json.dumps({"error": "Missing Host header"}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
try:
|
||||||
|
names = sorted(os.listdir(base_dir))
|
||||||
|
except OSError as e:
|
||||||
|
return json.dumps({"error": str(e)}), 500, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
files = []
|
||||||
|
for name in names:
|
||||||
|
if not _safe_pattern_filename(name) or name == "__init__.py":
|
||||||
|
continue
|
||||||
|
files.append({
|
||||||
|
"name": name,
|
||||||
|
"url": "http://%s/patterns/ota/file/%s" % (host, name),
|
||||||
|
})
|
||||||
|
|
||||||
|
return json.dumps({"files": files}), 200, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get('/ota/file/<name>')
|
||||||
|
async def ota_pattern_file(request, name):
|
||||||
|
"""Serve one driver pattern source file for OTA pulls."""
|
||||||
|
fname = normalize_pattern_py_filename(name)
|
||||||
|
if not fname or not _safe_pattern_filename(fname) or fname == "__init__.py":
|
||||||
|
return json.dumps({"error": "Invalid filename"}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
if is_firmware_builtin_pattern_module(fname):
|
||||||
|
return json.dumps(
|
||||||
|
{
|
||||||
|
"error": "on and off are built into the driver firmware; there is no module file to serve.",
|
||||||
|
}
|
||||||
|
), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
base = driver_patterns_dir()
|
||||||
|
path = os.path.join(base, fname)
|
||||||
|
try:
|
||||||
|
with open(path, "r") as f:
|
||||||
|
content = f.read()
|
||||||
|
except OSError:
|
||||||
|
return json.dumps(
|
||||||
|
{
|
||||||
|
"error": "Pattern file not found",
|
||||||
|
"path": path,
|
||||||
|
"hint": "Ensure led-driver is present or set LED_CONTROLLER_PATTERNS_DIR.",
|
||||||
|
}
|
||||||
|
), 404, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
return content, 200, {"Content-Type": "text/plain; charset=utf-8"}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('/<name>/send')
|
||||||
|
async def send_pattern_to_device(request, name):
|
||||||
|
"""Push one pattern source file directly to Wi-Fi driver(s) over HTTP."""
|
||||||
|
if not isinstance(name, str):
|
||||||
|
return json.dumps({"error": "Invalid pattern name"}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
filename = normalize_pattern_py_filename(name)
|
||||||
|
if not filename or not _safe_pattern_filename(filename) or filename == "__init__.py":
|
||||||
|
return json.dumps({"error": "Invalid pattern filename"}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
if is_firmware_builtin_pattern_module(filename):
|
||||||
|
return json.dumps(
|
||||||
|
{
|
||||||
|
"error": "on and off are built into the driver firmware; send does not apply.",
|
||||||
|
}
|
||||||
|
), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
devices = Device()
|
||||||
|
body = request.json or {}
|
||||||
|
requested_device_id = str(body.get("device_id") or "").strip()
|
||||||
|
|
||||||
|
base = driver_patterns_dir()
|
||||||
|
path = os.path.join(base, filename)
|
||||||
|
if not os.path.exists(path):
|
||||||
|
return json.dumps(
|
||||||
|
{
|
||||||
|
"error": "Pattern file not found",
|
||||||
|
"path": path,
|
||||||
|
"hint": "Ensure led-driver is present or set LED_CONTROLLER_PATTERNS_DIR.",
|
||||||
|
}
|
||||||
|
), 404, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(path, "r") as f:
|
||||||
|
source = f.read()
|
||||||
|
except OSError as e:
|
||||||
|
return json.dumps({"error": str(e)}), 500, {"Content-Type": "application/json"}
|
||||||
|
target_ids = []
|
||||||
|
if requested_device_id:
|
||||||
|
dev = devices.read(requested_device_id)
|
||||||
|
if not dev:
|
||||||
|
return json.dumps({"error": "Device not found"}), 404, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
if (dev.get("transport") or "").lower() != "wifi":
|
||||||
|
return json.dumps({"error": "Pattern send is only supported for Wi-Fi devices"}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
target_ids = [requested_device_id]
|
||||||
|
else:
|
||||||
|
for did in devices.list():
|
||||||
|
dev = devices.read(did) or {}
|
||||||
|
if (dev.get("transport") or "").lower() == "wifi":
|
||||||
|
target_ids.append(str(did))
|
||||||
|
if not target_ids:
|
||||||
|
return json.dumps({"error": "No Wi-Fi devices found"}), 404, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
sent_ids = []
|
||||||
|
for did in target_ids:
|
||||||
|
dev = devices.read(did) or {}
|
||||||
|
ip = str(dev.get("address") or "").strip()
|
||||||
|
if not ip:
|
||||||
|
continue
|
||||||
|
ok = _http_post_pattern_source(ip, filename, source, reload_patterns=True, timeout_s=10.0)
|
||||||
|
if ok:
|
||||||
|
sent_ids.append(did)
|
||||||
|
|
||||||
|
if not sent_ids:
|
||||||
|
return json.dumps({"error": "No Wi-Fi drivers accepted pattern upload"}), 503, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
return json.dumps({"message": "Pattern sent", "pattern": filename, "device_ids": sent_ids, "sent_count": len(sent_ids)}), 200, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('/upload')
|
||||||
|
async def upload_pattern_file(request):
|
||||||
|
"""
|
||||||
|
Upload a pattern source file to led-controller local storage.
|
||||||
|
|
||||||
|
Body JSON:
|
||||||
|
{
|
||||||
|
"name": "sparkle.py" | "sparkle",
|
||||||
|
"code": "class Sparkle: ...",
|
||||||
|
"overwrite": true | false # optional, default true
|
||||||
|
}
|
||||||
|
"""
|
||||||
|
data = request.json or {}
|
||||||
|
raw_name = data.get("name") or data.get("filename")
|
||||||
|
code = data.get("code")
|
||||||
|
overwrite = data.get("overwrite", True)
|
||||||
|
overwrite = bool(overwrite)
|
||||||
|
|
||||||
|
if not isinstance(raw_name, str) or not raw_name.strip():
|
||||||
|
return json.dumps({"error": "name is required"}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
filename = raw_name.strip()
|
||||||
|
if not filename.endswith(".py"):
|
||||||
|
filename += ".py"
|
||||||
|
if not _safe_pattern_filename(filename) or filename == "__init__.py":
|
||||||
|
return json.dumps({"error": "invalid pattern filename"}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
if is_firmware_builtin_pattern_module(filename):
|
||||||
|
return json.dumps(
|
||||||
|
{"error": "on and off are built into the driver firmware; use a different pattern name."}
|
||||||
|
), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
if not isinstance(code, str) or not code.strip():
|
||||||
|
return json.dumps({"error": "code is required"}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
path = os.path.join(driver_patterns_dir(), filename)
|
||||||
|
exists = os.path.exists(path)
|
||||||
|
if exists and not overwrite:
|
||||||
|
return json.dumps({"error": "pattern file already exists", "name": filename}), 409, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(path, "w") as f:
|
||||||
|
f.write(code)
|
||||||
|
except OSError as e:
|
||||||
|
return json.dumps({"error": str(e)}), 500, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
return json.dumps({
|
||||||
|
"message": "Pattern uploaded",
|
||||||
|
"name": filename,
|
||||||
|
"overwrote": bool(exists),
|
||||||
|
}), 201, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('/driver')
|
||||||
|
async def create_driver_pattern(request):
|
||||||
|
"""
|
||||||
|
Create a driver pattern: save ``.py`` under led-driver/src/patterns and
|
||||||
|
metadata in db/pattern.json (Pattern model).
|
||||||
|
|
||||||
|
Body JSON:
|
||||||
|
name, code (required),
|
||||||
|
min_delay, max_delay, max_colors (optional numbers),
|
||||||
|
n1..n8 (optional string labels),
|
||||||
|
overwrite (optional, default true).
|
||||||
|
"""
|
||||||
|
data = request.json or {}
|
||||||
|
key = _normalize_pattern_key(data.get("name") or "")
|
||||||
|
if not _valid_pattern_key(key):
|
||||||
|
return json.dumps({
|
||||||
|
"error": "name must be a valid Python identifier (e.g. sparkle, my_pattern)",
|
||||||
|
}), 400, {"Content-Type": "application/json"}
|
||||||
|
if is_firmware_builtin_pattern_module(key):
|
||||||
|
return json.dumps(
|
||||||
|
{"error": "on and off are built into the driver firmware; use a different pattern name."}
|
||||||
|
), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
code = data.get("code")
|
||||||
|
if not isinstance(code, str) or not code.strip():
|
||||||
|
return json.dumps({"error": "code is required (upload a .py file or paste source)"}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
overwrite = bool(data.get("overwrite", True))
|
||||||
|
|
||||||
|
filename = key + ".py"
|
||||||
|
py_path = os.path.join(driver_patterns_dir(), filename)
|
||||||
|
if os.path.exists(py_path) and not overwrite:
|
||||||
|
return json.dumps({"error": "pattern file already exists", "name": filename}), 409, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
meta = {}
|
||||||
|
for fld in ("min_delay", "max_delay", "max_colors"):
|
||||||
|
if fld not in data:
|
||||||
|
continue
|
||||||
|
try:
|
||||||
|
meta[fld] = int(data[fld])
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
return json.dumps({"error": "%s must be an integer" % fld}), 400, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
for i in range(1, 9):
|
||||||
|
nk = "n%d" % i
|
||||||
|
if nk not in data:
|
||||||
|
continue
|
||||||
|
lab = data[nk]
|
||||||
|
if lab is None:
|
||||||
|
continue
|
||||||
|
s = str(lab).strip()
|
||||||
|
if s:
|
||||||
|
meta[nk] = s
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(py_path, "w") as f:
|
||||||
|
f.write(code)
|
||||||
|
except OSError as e:
|
||||||
|
return json.dumps({"error": str(e)}), 500, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
if patterns.read(key):
|
||||||
|
patterns.update(key, meta)
|
||||||
|
else:
|
||||||
|
patterns.create(key, meta)
|
||||||
|
|
||||||
|
return json.dumps({
|
||||||
|
"message": "Pattern created",
|
||||||
|
"name": key,
|
||||||
|
"file": filename,
|
||||||
|
"metadata": patterns.read(key),
|
||||||
|
}), 201, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
@controller.get('')
|
@controller.get('')
|
||||||
async def list_patterns(request):
|
async def list_patterns(request):
|
||||||
"""List all patterns."""
|
"""List patterns for UI (DB metadata + local driver additions)."""
|
||||||
return json.dumps(patterns), 200, {'Content-Type': 'application/json'}
|
return json.dumps(build_runtime_pattern_map()), 200, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
@controller.get('/<id>')
|
@controller.get('/<id>')
|
||||||
|
|||||||
+130
-31
@@ -2,9 +2,10 @@ from microdot import Microdot
|
|||||||
from microdot.session import with_session
|
from microdot.session import with_session
|
||||||
from models.preset import Preset
|
from models.preset import Preset
|
||||||
from models.profile import Profile
|
from models.profile import Profile
|
||||||
|
from models.device import Device, normalize_mac
|
||||||
from models.transport import get_current_sender
|
from models.transport import get_current_sender
|
||||||
|
from util.driver_delivery import deliver_json_messages, deliver_preset_broadcast_then_per_device
|
||||||
from util.espnow_message import build_message, build_preset_dict
|
from util.espnow_message import build_message, build_preset_dict
|
||||||
import asyncio
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
controller = Microdot()
|
controller = Microdot()
|
||||||
@@ -125,13 +126,17 @@ async def delete_preset(request, *args, **kwargs):
|
|||||||
@with_session
|
@with_session
|
||||||
async def send_presets(request, session):
|
async def send_presets(request, session):
|
||||||
"""
|
"""
|
||||||
Send one or more presets to the LED driver (via serial transport).
|
Send one or more presets to LED drivers (serial/ESP-NOW and/or TCP Wi-Fi clients).
|
||||||
|
|
||||||
Body JSON:
|
Body JSON:
|
||||||
{"preset_ids": ["1", "2", ...]} or {"ids": ["1", "2", ...]}
|
{"preset_ids": ["1", "2", ...]} or {"ids": ["1", "2", ...]}
|
||||||
|
Optional "targets": ["aabbccddeeff", ...] — registry MACs. When set: preset
|
||||||
|
chunks are ESP-NOW broadcast once each; Wi-Fi drivers get the same chunks
|
||||||
|
over TCP; if "default" is set, each target then gets a unicast default
|
||||||
|
message (serial or TCP) with that device name in "targets".
|
||||||
|
Omit targets for broadcast-only serial (legacy).
|
||||||
|
|
||||||
The controller looks up each preset, converts to API format, chunks into
|
Optional "destination_mac" / "to": single MAC when targets is omitted.
|
||||||
<= 240-byte messages, and sends them over the configured transport.
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
data = request.json or {}
|
data = request.json or {}
|
||||||
@@ -144,7 +149,6 @@ async def send_presets(request, session):
|
|||||||
save_flag = data.get('save', True)
|
save_flag = data.get('save', True)
|
||||||
save_flag = bool(save_flag)
|
save_flag = bool(save_flag)
|
||||||
default_id = data.get('default')
|
default_id = data.get('default')
|
||||||
# Optional 12-char hex MAC to send to one device; omit for default (e.g. broadcast).
|
|
||||||
destination_mac = data.get('destination_mac') or data.get('to')
|
destination_mac = data.get('destination_mac') or data.get('to')
|
||||||
|
|
||||||
# Build API-compliant preset map keyed by preset ID, include name
|
# Build API-compliant preset map keyed by preset ID, include name
|
||||||
@@ -171,23 +175,13 @@ async def send_presets(request, session):
|
|||||||
if not sender:
|
if not sender:
|
||||||
return json.dumps({"error": "Transport not configured"}), 503, {'Content-Type': 'application/json'}
|
return json.dumps({"error": "Transport not configured"}), 503, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
async def send_chunk(chunk_presets, is_last):
|
|
||||||
# Save/default should only be sent with the final presets chunk.
|
|
||||||
msg = build_message(
|
|
||||||
presets=chunk_presets,
|
|
||||||
save=save_flag and is_last,
|
|
||||||
default=default_id if is_last else None,
|
|
||||||
)
|
|
||||||
await sender.send(msg, addr=destination_mac)
|
|
||||||
|
|
||||||
MAX_BYTES = 240
|
MAX_BYTES = 240
|
||||||
send_delay_s = 0.1
|
send_delay_s = 0.1
|
||||||
entries = list(presets_by_name.items())
|
entries = list(presets_by_name.items())
|
||||||
total_presets = len(entries)
|
total_presets = len(entries)
|
||||||
messages_sent = 0
|
|
||||||
|
|
||||||
batch = {}
|
batch = {}
|
||||||
last_msg = None
|
chunk_messages = []
|
||||||
for name, preset_obj in entries:
|
for name, preset_obj in entries:
|
||||||
test_batch = dict(batch)
|
test_batch = dict(batch)
|
||||||
test_batch[name] = preset_obj
|
test_batch[name] = preset_obj
|
||||||
@@ -196,28 +190,133 @@ async def send_presets(request, session):
|
|||||||
|
|
||||||
if size <= MAX_BYTES or not batch:
|
if size <= MAX_BYTES or not batch:
|
||||||
batch = test_batch
|
batch = test_batch
|
||||||
last_msg = test_msg
|
|
||||||
else:
|
else:
|
||||||
try:
|
chunk_messages.append(
|
||||||
await send_chunk(batch, False)
|
build_message(
|
||||||
except Exception:
|
presets=dict(batch),
|
||||||
return json.dumps({"error": "Send failed"}), 503, {'Content-Type': 'application/json'}
|
save=False,
|
||||||
await asyncio.sleep(send_delay_s)
|
default=None,
|
||||||
messages_sent += 1
|
)
|
||||||
|
)
|
||||||
batch = {name: preset_obj}
|
batch = {name: preset_obj}
|
||||||
last_msg = build_message(presets=batch, save=save_flag, default=default_id)
|
|
||||||
|
|
||||||
if batch:
|
if batch:
|
||||||
try:
|
chunk_messages.append(
|
||||||
await send_chunk(batch, True)
|
build_message(
|
||||||
except Exception:
|
presets=dict(batch),
|
||||||
return json.dumps({"error": "Send failed"}), 503, {'Content-Type': 'application/json'}
|
save=save_flag,
|
||||||
await asyncio.sleep(send_delay_s)
|
default=default_id,
|
||||||
messages_sent += 1
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
target_list = None
|
||||||
|
raw_targets = data.get("targets")
|
||||||
|
if isinstance(raw_targets, list) and raw_targets:
|
||||||
|
target_list = []
|
||||||
|
for t in raw_targets:
|
||||||
|
m = normalize_mac(str(t))
|
||||||
|
if m:
|
||||||
|
target_list.append(m)
|
||||||
|
target_list = list(dict.fromkeys(target_list))
|
||||||
|
if not target_list:
|
||||||
|
target_list = None
|
||||||
|
elif destination_mac:
|
||||||
|
dm = normalize_mac(str(destination_mac))
|
||||||
|
target_list = [dm] if dm else None
|
||||||
|
|
||||||
|
try:
|
||||||
|
if target_list:
|
||||||
|
deliveries = await deliver_preset_broadcast_then_per_device(
|
||||||
|
sender,
|
||||||
|
chunk_messages,
|
||||||
|
target_list,
|
||||||
|
Device(),
|
||||||
|
str(default_id) if default_id is not None else None,
|
||||||
|
delay_s=send_delay_s,
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
deliveries, _chunks = await deliver_json_messages(
|
||||||
|
sender,
|
||||||
|
chunk_messages,
|
||||||
|
None,
|
||||||
|
Device(),
|
||||||
|
delay_s=send_delay_s,
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
return json.dumps({"error": "Send failed"}), 503, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
return json.dumps({
|
return json.dumps({
|
||||||
"message": "Presets sent",
|
"message": "Presets sent",
|
||||||
"presets_sent": total_presets,
|
"presets_sent": total_presets,
|
||||||
"messages_sent": messages_sent
|
"messages_sent": deliveries,
|
||||||
|
}), 200, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('/push')
|
||||||
|
@with_session
|
||||||
|
async def push_driver_messages(request, session):
|
||||||
|
"""
|
||||||
|
Deliver one or more raw v1 JSON objects to devices (ESP-NOW and/or TCP).
|
||||||
|
|
||||||
|
Body:
|
||||||
|
{"sequence": [{ "v": "1", ... }, ...], "targets": ["mac", ...]}
|
||||||
|
or a single {"payload": {...}, "targets": [...]}.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
data = request.json or {}
|
||||||
|
except Exception:
|
||||||
|
return json.dumps({"error": "Invalid JSON"}), 400, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
seq = data.get("sequence")
|
||||||
|
if not seq and data.get("payload") is not None:
|
||||||
|
seq = [data["payload"]]
|
||||||
|
if not isinstance(seq, list) or not seq:
|
||||||
|
return json.dumps({"error": "sequence or payload required"}), 400, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
raw_targets = data.get("targets")
|
||||||
|
target_list = None
|
||||||
|
if isinstance(raw_targets, list) and raw_targets:
|
||||||
|
target_list = []
|
||||||
|
for t in raw_targets:
|
||||||
|
m = normalize_mac(str(t))
|
||||||
|
if m:
|
||||||
|
target_list.append(m)
|
||||||
|
target_list = list(dict.fromkeys(target_list))
|
||||||
|
if not target_list:
|
||||||
|
target_list = None
|
||||||
|
|
||||||
|
sender = get_current_sender()
|
||||||
|
if not sender:
|
||||||
|
return json.dumps({"error": "Transport not configured"}), 503, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
messages = []
|
||||||
|
for item in seq:
|
||||||
|
if isinstance(item, dict):
|
||||||
|
messages.append(json.dumps(item))
|
||||||
|
elif isinstance(item, str):
|
||||||
|
messages.append(item)
|
||||||
|
else:
|
||||||
|
return json.dumps({"error": "sequence items must be objects or strings"}), 400, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
delay_s = data.get("delay_s", 0.05)
|
||||||
|
try:
|
||||||
|
delay_s = float(delay_s)
|
||||||
|
except (TypeError, ValueError):
|
||||||
|
delay_s = 0.05
|
||||||
|
|
||||||
|
try:
|
||||||
|
deliveries, _chunks = await deliver_json_messages(
|
||||||
|
sender,
|
||||||
|
messages,
|
||||||
|
target_list,
|
||||||
|
Device(),
|
||||||
|
delay_s=delay_s,
|
||||||
|
)
|
||||||
|
except Exception:
|
||||||
|
return json.dumps({"error": "Send failed"}), 503, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
return json.dumps({
|
||||||
|
"message": "Delivered",
|
||||||
|
"deliveries": deliveries,
|
||||||
}), 200, {'Content-Type': 'application/json'}
|
}), 200, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
+71
-29
@@ -1,13 +1,13 @@
|
|||||||
from microdot import Microdot
|
from microdot import Microdot
|
||||||
from microdot.session import with_session
|
from microdot.session import with_session
|
||||||
from models.profile import Profile
|
from models.profile import Profile
|
||||||
from models.tab import Tab
|
from models.zone import Zone
|
||||||
from models.preset import Preset
|
from models.preset import Preset
|
||||||
import json
|
import json
|
||||||
|
|
||||||
controller = Microdot()
|
controller = Microdot()
|
||||||
profiles = Profile()
|
profiles = Profile()
|
||||||
tabs = Tab()
|
zones = Zone()
|
||||||
presets = Preset()
|
presets = Preset()
|
||||||
|
|
||||||
@controller.get('')
|
@controller.get('')
|
||||||
@@ -83,20 +83,20 @@ async def create_profile(request):
|
|||||||
try:
|
try:
|
||||||
data = dict(request.json or {})
|
data = dict(request.json or {})
|
||||||
name = data.get("name", "")
|
name = data.get("name", "")
|
||||||
seed_raw = data.get("seed_dj_tab", False)
|
seed_raw = data.get("seed_dj_zone", False)
|
||||||
if isinstance(seed_raw, str):
|
if isinstance(seed_raw, str):
|
||||||
seed_dj_tab = seed_raw.strip().lower() in ("1", "true", "yes", "on")
|
seed_dj_zone = seed_raw.strip().lower() in ("1", "true", "yes", "on")
|
||||||
else:
|
else:
|
||||||
seed_dj_tab = bool(seed_raw)
|
seed_dj_zone = bool(seed_raw)
|
||||||
# Request-only flag: do not persist on profile records.
|
# Request-only flag: do not persist on profile records.
|
||||||
data.pop("seed_dj_tab", None)
|
data.pop("seed_dj_zone", None)
|
||||||
profile_id = profiles.create(name)
|
profile_id = profiles.create(name)
|
||||||
# Avoid persisting request-only fields.
|
# Avoid persisting request-only fields.
|
||||||
data.pop("name", None)
|
data.pop("name", None)
|
||||||
if data:
|
if data:
|
||||||
profiles.update(profile_id, data)
|
profiles.update(profile_id, data)
|
||||||
|
|
||||||
# New profiles always start with a default tab pre-populated with starter presets.
|
# New profiles always start with a default zone pre-populated with starter presets.
|
||||||
default_preset_ids = []
|
default_preset_ids = []
|
||||||
default_preset_defs = [
|
default_preset_defs = [
|
||||||
{
|
{
|
||||||
@@ -124,6 +124,15 @@ async def create_profile(request):
|
|||||||
"auto": True,
|
"auto": True,
|
||||||
"n1": 2,
|
"n1": 2,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Colour Cycle",
|
||||||
|
"pattern": "colour_cycle",
|
||||||
|
"colors": ["#FF0000", "#00FF00", "#0000FF"],
|
||||||
|
"brightness": 255,
|
||||||
|
"delay": 100,
|
||||||
|
"auto": True,
|
||||||
|
"n1": 1,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "transition",
|
"name": "transition",
|
||||||
"pattern": "transition",
|
"pattern": "transition",
|
||||||
@@ -132,6 +141,39 @@ async def create_profile(request):
|
|||||||
"delay": 500,
|
"delay": 500,
|
||||||
"auto": True,
|
"auto": True,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "flicker",
|
||||||
|
"pattern": "flicker",
|
||||||
|
"colors": ["#FFB84D"],
|
||||||
|
"brightness": 255,
|
||||||
|
"delay": 80,
|
||||||
|
"auto": True,
|
||||||
|
"n1": 30,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "flame",
|
||||||
|
"pattern": "flame",
|
||||||
|
"colors": [],
|
||||||
|
"brightness": 255,
|
||||||
|
"delay": 50,
|
||||||
|
"auto": True,
|
||||||
|
"n1": 35,
|
||||||
|
"n2": 2600,
|
||||||
|
"n3": 0,
|
||||||
|
"n4": 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "twinkle",
|
||||||
|
"pattern": "twinkle",
|
||||||
|
"colors": ["#78C8FF", "#508CFF", "#B478FF", "#64DCE8", "#A0C8FF"],
|
||||||
|
"brightness": 255,
|
||||||
|
"delay": 55,
|
||||||
|
"auto": True,
|
||||||
|
"n1": 72,
|
||||||
|
"n2": 140,
|
||||||
|
"n3": 2,
|
||||||
|
"n4": 6,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
for preset_data in default_preset_defs:
|
for preset_data in default_preset_defs:
|
||||||
@@ -139,18 +181,18 @@ async def create_profile(request):
|
|||||||
presets.update(pid, preset_data)
|
presets.update(pid, preset_data)
|
||||||
default_preset_ids.append(str(pid))
|
default_preset_ids.append(str(pid))
|
||||||
|
|
||||||
default_tab_id = tabs.create(name="default", names=["1"], presets=[default_preset_ids])
|
default_tab_id = zones.create(name="default", names=["1"], presets=[default_preset_ids])
|
||||||
tabs.update(default_tab_id, {
|
zones.update(default_tab_id, {
|
||||||
"presets_flat": default_preset_ids,
|
"presets_flat": default_preset_ids,
|
||||||
"default_preset": default_preset_ids[0] if default_preset_ids else None,
|
"default_preset": default_preset_ids[0] if default_preset_ids else None,
|
||||||
})
|
})
|
||||||
|
|
||||||
profile = profiles.read(profile_id) or {}
|
profile = profiles.read(profile_id) or {}
|
||||||
profile_tabs = profile.get("tabs", []) if isinstance(profile.get("tabs", []), list) else []
|
profile_tabs = profile.get("zones", []) if isinstance(profile.get("zones", []), list) else []
|
||||||
profile_tabs.append(str(default_tab_id))
|
profile_tabs.append(str(default_tab_id))
|
||||||
|
|
||||||
if seed_dj_tab:
|
if seed_dj_zone:
|
||||||
# Seed a DJ-focused tab with three starter presets.
|
# Seed a DJ-focused zone with three starter presets.
|
||||||
seeded_preset_ids = []
|
seeded_preset_ids = []
|
||||||
preset_defs = [
|
preset_defs = [
|
||||||
{
|
{
|
||||||
@@ -182,15 +224,15 @@ async def create_profile(request):
|
|||||||
presets.update(pid, preset_data)
|
presets.update(pid, preset_data)
|
||||||
seeded_preset_ids.append(str(pid))
|
seeded_preset_ids.append(str(pid))
|
||||||
|
|
||||||
dj_tab_id = tabs.create(name="dj", names=["dj"], presets=[seeded_preset_ids])
|
dj_tab_id = zones.create(name="dj", names=["dj"], presets=[seeded_preset_ids])
|
||||||
tabs.update(dj_tab_id, {
|
zones.update(dj_tab_id, {
|
||||||
"presets_flat": seeded_preset_ids,
|
"presets_flat": seeded_preset_ids,
|
||||||
"default_preset": seeded_preset_ids[0] if seeded_preset_ids else None,
|
"default_preset": seeded_preset_ids[0] if seeded_preset_ids else None,
|
||||||
})
|
})
|
||||||
|
|
||||||
profile_tabs.append(str(dj_tab_id))
|
profile_tabs.append(str(dj_tab_id))
|
||||||
|
|
||||||
profiles.update(profile_id, {"tabs": profile_tabs})
|
profiles.update(profile_id, {"zones": profile_tabs})
|
||||||
|
|
||||||
profile_data = profiles.read(profile_id)
|
profile_data = profiles.read(profile_id)
|
||||||
return json.dumps({profile_id: profile_data}), 201, {'Content-Type': 'application/json'}
|
return json.dumps({profile_id: profile_data}), 201, {'Content-Type': 'application/json'}
|
||||||
@@ -208,7 +250,7 @@ async def clone_profile(request, id):
|
|||||||
data = request.json or {}
|
data = request.json or {}
|
||||||
source_name = source.get("name") or f"Profile {id}"
|
source_name = source.get("name") or f"Profile {id}"
|
||||||
new_name = data.get("name") or source_name
|
new_name = data.get("name") or source_name
|
||||||
profile_type = source.get("type", "tabs")
|
profile_type = source.get("type", "zones")
|
||||||
|
|
||||||
def allocate_id(model, cache):
|
def allocate_id(model, cache):
|
||||||
if "next" not in cache:
|
if "next" not in cache:
|
||||||
@@ -255,28 +297,28 @@ async def clone_profile(request, id):
|
|||||||
palette_colors = []
|
palette_colors = []
|
||||||
|
|
||||||
# Clone tabs and presets used by those tabs
|
# Clone tabs and presets used by those tabs
|
||||||
source_tabs = source.get("tabs")
|
source_tabs = source.get("zones")
|
||||||
if not isinstance(source_tabs, list) or len(source_tabs) == 0:
|
if not isinstance(source_tabs, list) or len(source_tabs) == 0:
|
||||||
source_tabs = source.get("tab_order", [])
|
source_tabs = source.get("zone_order", [])
|
||||||
source_tabs = source_tabs or []
|
source_tabs = source_tabs or []
|
||||||
cloned_tab_ids = []
|
cloned_tab_ids = []
|
||||||
preset_id_map = {}
|
preset_id_map = {}
|
||||||
new_tabs = {}
|
new_tabs = {}
|
||||||
new_presets = {}
|
new_presets = {}
|
||||||
for tab_id in source_tabs:
|
for zone_id in source_tabs:
|
||||||
tab = tabs.read(tab_id)
|
zone = zones.read(zone_id)
|
||||||
if not tab:
|
if not zone:
|
||||||
continue
|
continue
|
||||||
tab_name = tab.get("name") or f"Tab {tab_id}"
|
tab_name = zone.get("name") or f"Zone {zone_id}"
|
||||||
clone_name = tab_name
|
clone_name = tab_name
|
||||||
mapped_presets = map_preset_container(tab.get("presets"), preset_id_map, preset_cache, new_profile_id, new_presets)
|
mapped_presets = map_preset_container(zone.get("presets"), preset_id_map, preset_cache, new_profile_id, new_presets)
|
||||||
clone_id = allocate_id(tabs, tab_cache)
|
clone_id = allocate_id(zones, tab_cache)
|
||||||
clone_data = {
|
clone_data = {
|
||||||
"name": clone_name,
|
"name": clone_name,
|
||||||
"names": tab.get("names") or [],
|
"names": zone.get("names") or [],
|
||||||
"presets": mapped_presets if mapped_presets is not None else []
|
"presets": mapped_presets if mapped_presets is not None else []
|
||||||
}
|
}
|
||||||
extra = {k: v for k, v in tab.items() if k not in ("name", "names", "presets")}
|
extra = {k: v for k, v in zone.items() if k not in ("name", "names", "presets")}
|
||||||
if "presets_flat" in extra:
|
if "presets_flat" in extra:
|
||||||
extra["presets_flat"] = map_preset_container(extra.get("presets_flat"), preset_id_map, preset_cache, new_profile_id, new_presets)
|
extra["presets_flat"] = map_preset_container(extra.get("presets_flat"), preset_id_map, preset_cache, new_profile_id, new_presets)
|
||||||
if extra:
|
if extra:
|
||||||
@@ -287,7 +329,7 @@ async def clone_profile(request, id):
|
|||||||
new_profile_data = {
|
new_profile_data = {
|
||||||
"name": new_name,
|
"name": new_name,
|
||||||
"type": profile_type,
|
"type": profile_type,
|
||||||
"tabs": cloned_tab_ids,
|
"zones": cloned_tab_ids,
|
||||||
"scenes": list(source.get("scenes", [])) if isinstance(source.get("scenes", []), list) else [],
|
"scenes": list(source.get("scenes", [])) if isinstance(source.get("scenes", []), list) else [],
|
||||||
"palette_id": str(new_palette_id),
|
"palette_id": str(new_palette_id),
|
||||||
}
|
}
|
||||||
@@ -297,12 +339,12 @@ async def clone_profile(request, id):
|
|||||||
for pid, pdata in new_presets.items():
|
for pid, pdata in new_presets.items():
|
||||||
presets[pid] = pdata
|
presets[pid] = pdata
|
||||||
for tid, tdata in new_tabs.items():
|
for tid, tdata in new_tabs.items():
|
||||||
tabs[tid] = tdata
|
zones[tid] = tdata
|
||||||
profiles[str(new_profile_id)] = new_profile_data
|
profiles[str(new_profile_id)] = new_profile_data
|
||||||
|
|
||||||
profiles._palette_model.save()
|
profiles._palette_model.save()
|
||||||
presets.save()
|
presets.save()
|
||||||
tabs.save()
|
zones.save()
|
||||||
profiles.save()
|
profiles.save()
|
||||||
|
|
||||||
return json.dumps({new_profile_id: new_profile_data}), 201, {'Content-Type': 'application/json'}
|
return json.dumps({new_profile_id: new_profile_data}), 201, {'Content-Type': 'application/json'}
|
||||||
|
|||||||
@@ -47,3 +47,37 @@ async def delete_scene(request, id):
|
|||||||
if scenes.delete(id):
|
if scenes.delete(id):
|
||||||
return json.dumps({"message": "Scene deleted successfully"}), 200
|
return json.dumps({"message": "Scene deleted successfully"}), 200
|
||||||
return json.dumps({"error": "Scene not found"}), 404
|
return json.dumps({"error": "Scene not found"}), 404
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('/<id>/play')
|
||||||
|
async def play_scene(request, id):
|
||||||
|
"""Start every sequence in the scene (one per zone; later ones win a shared zone)."""
|
||||||
|
from engine import get_engine
|
||||||
|
from engine.core import EngineError
|
||||||
|
|
||||||
|
scene = scenes.read(id)
|
||||||
|
if not scene:
|
||||||
|
return json.dumps({"error": "Scene not found"}), 404, {'Content-Type': 'application/json'}
|
||||||
|
started, errors = [], {}
|
||||||
|
for sid in scene.get("sequences") or []:
|
||||||
|
try:
|
||||||
|
await get_engine().sequences.play(sid)
|
||||||
|
started.append(str(sid))
|
||||||
|
except EngineError as e:
|
||||||
|
errors[str(sid)] = str(e)
|
||||||
|
return json.dumps({"started": started, "errors": errors}), 200, {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('/<id>/stop')
|
||||||
|
async def stop_scene(request, id):
|
||||||
|
"""Stop every sequence in the scene."""
|
||||||
|
from engine import get_engine
|
||||||
|
|
||||||
|
scene = scenes.read(id)
|
||||||
|
if not scene:
|
||||||
|
return json.dumps({"error": "Scene not found"}), 404, {'Content-Type': 'application/json'}
|
||||||
|
stopped = []
|
||||||
|
for sid in scene.get("sequences") or []:
|
||||||
|
if await get_engine().sequences.stop(sid):
|
||||||
|
stopped.append(str(sid))
|
||||||
|
return json.dumps({"stopped": stopped}), 200, {'Content-Type': 'application/json'}
|
||||||
+49
-22
@@ -1,51 +1,78 @@
|
|||||||
from microdot import Microdot
|
from microdot import Microdot
|
||||||
from models.squence import Sequence
|
from models.squence import Sequence
|
||||||
|
from engine import get_engine
|
||||||
|
from engine.core import EngineError
|
||||||
import json
|
import json
|
||||||
|
|
||||||
controller = Microdot()
|
controller = Microdot()
|
||||||
sequences = Sequence()
|
sequences = Sequence()
|
||||||
|
|
||||||
|
_JSON = {'Content-Type': 'application/json'}
|
||||||
|
|
||||||
|
|
||||||
@controller.get('')
|
@controller.get('')
|
||||||
async def list_sequences(request):
|
async def list_sequences(request):
|
||||||
"""List all sequences."""
|
"""List all sequences."""
|
||||||
return json.dumps(sequences), 200, {'Content-Type': 'application/json'}
|
return json.dumps(sequences), 200, _JSON
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get('/status')
|
||||||
|
async def sequences_status(request):
|
||||||
|
"""Running state of every sequence started since boot."""
|
||||||
|
return json.dumps(get_engine().sequences.status()), 200, _JSON
|
||||||
|
|
||||||
|
|
||||||
@controller.get('/<id>')
|
@controller.get('/<id>')
|
||||||
async def get_sequence(request, id):
|
async def get_sequence(request, id):
|
||||||
"""Get a specific sequence by ID."""
|
"""Get a specific sequence by ID."""
|
||||||
sequence = sequences.read(id)
|
sequence = sequences.read(id)
|
||||||
if sequence:
|
if sequence:
|
||||||
return json.dumps(sequence), 200, {'Content-Type': 'application/json'}
|
return json.dumps(sequence), 200, _JSON
|
||||||
return json.dumps({"error": "Sequence not found"}), 404
|
return json.dumps({"error": "Sequence not found"}), 404, _JSON
|
||||||
|
|
||||||
|
|
||||||
@controller.post('')
|
@controller.post('')
|
||||||
async def create_sequence(request):
|
async def create_sequence(request):
|
||||||
"""Create a new sequence."""
|
"""Create a sequence: {name, zone_id, loop, repeat_count, steps: [{preset_id, duration_s}]}."""
|
||||||
try:
|
try:
|
||||||
data = request.json or {}
|
sequence_id = sequences.create(request.json or {})
|
||||||
group_name = data.get("group_name", "")
|
return json.dumps(sequences.read(sequence_id)), 201, _JSON
|
||||||
preset_names = data.get("presets", None)
|
except ValueError as e:
|
||||||
sequence_id = sequences.create(group_name, preset_names)
|
return json.dumps({"error": str(e)}), 400, _JSON
|
||||||
if data:
|
|
||||||
sequences.update(sequence_id, data)
|
|
||||||
return json.dumps(sequences.read(sequence_id)), 201, {'Content-Type': 'application/json'}
|
|
||||||
except Exception as e:
|
|
||||||
return json.dumps({"error": str(e)}), 400
|
|
||||||
|
|
||||||
@controller.put('/<id>')
|
@controller.put('/<id>')
|
||||||
async def update_sequence(request, id):
|
async def update_sequence(request, id):
|
||||||
"""Update an existing sequence."""
|
"""Update an existing sequence."""
|
||||||
try:
|
try:
|
||||||
data = request.json
|
if sequences.update(id, request.json or {}):
|
||||||
if sequences.update(id, data):
|
return json.dumps(sequences.read(id)), 200, _JSON
|
||||||
return json.dumps(sequences.read(id)), 200, {'Content-Type': 'application/json'}
|
return json.dumps({"error": "Sequence not found"}), 404, _JSON
|
||||||
return json.dumps({"error": "Sequence not found"}), 404
|
except ValueError as e:
|
||||||
except Exception as e:
|
return json.dumps({"error": str(e)}), 400, _JSON
|
||||||
return json.dumps({"error": str(e)}), 400
|
|
||||||
|
|
||||||
@controller.delete('/<id>')
|
@controller.delete('/<id>')
|
||||||
async def delete_sequence(request, id):
|
async def delete_sequence(request, id):
|
||||||
"""Delete a sequence."""
|
"""Delete a sequence (stops it first if running)."""
|
||||||
|
await get_engine().sequences.stop(id)
|
||||||
if sequences.delete(id):
|
if sequences.delete(id):
|
||||||
return json.dumps({"message": "Sequence deleted successfully"}), 200
|
return json.dumps({"message": "Sequence deleted successfully"}), 200, _JSON
|
||||||
return json.dumps({"error": "Sequence not found"}), 404
|
return json.dumps({"error": "Sequence not found"}), 404, _JSON
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('/<id>/play')
|
||||||
|
async def play_sequence(request, id):
|
||||||
|
"""Start the sequence on its zone (replaces any sequence already running there)."""
|
||||||
|
try:
|
||||||
|
state = await get_engine().sequences.play(id)
|
||||||
|
return json.dumps(state), 200, _JSON
|
||||||
|
except EngineError as e:
|
||||||
|
return json.dumps({"error": str(e)}), e.status, _JSON
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post('/<id>/stop')
|
||||||
|
async def stop_sequence(request, id):
|
||||||
|
"""Stop the sequence; the zone keeps showing its current preset."""
|
||||||
|
stopped = await get_engine().sequences.stop(id)
|
||||||
|
return json.dumps({"stopped": stopped}), 200, _JSON
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
from microdot import Microdot, send_file
|
import asyncio
|
||||||
from settings import Settings
|
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from microdot import Microdot, send_file
|
||||||
|
|
||||||
|
from models import wifi_ws_clients
|
||||||
|
from settings import Settings
|
||||||
|
|
||||||
controller = Microdot()
|
controller = Microdot()
|
||||||
settings = Settings()
|
settings = Settings()
|
||||||
|
|
||||||
@@ -63,17 +67,36 @@ def _validate_wifi_channel(value):
|
|||||||
return ch
|
return ch
|
||||||
|
|
||||||
|
|
||||||
|
def _validate_global_brightness(value):
|
||||||
|
"""Return int 0–255 or raise ValueError."""
|
||||||
|
v = int(value)
|
||||||
|
if v < 0 or v > 255:
|
||||||
|
raise ValueError("global_brightness must be between 0 and 255")
|
||||||
|
return v
|
||||||
|
|
||||||
|
|
||||||
@controller.put('/settings')
|
@controller.put('/settings')
|
||||||
async def update_settings(request):
|
async def update_settings(request):
|
||||||
"""Update general settings."""
|
"""Update general settings."""
|
||||||
try:
|
try:
|
||||||
data = request.json
|
data = request.json
|
||||||
|
global_brightness_changed = False
|
||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
if key == 'wifi_channel' and value is not None:
|
if key == 'wifi_channel' and value is not None:
|
||||||
settings[key] = _validate_wifi_channel(value)
|
settings[key] = _validate_wifi_channel(value)
|
||||||
|
elif key == 'global_brightness' and value is not None:
|
||||||
|
settings[key] = _validate_global_brightness(value)
|
||||||
|
global_brightness_changed = True
|
||||||
else:
|
else:
|
||||||
settings[key] = value
|
settings[key] = value
|
||||||
settings.save()
|
settings.save()
|
||||||
|
if global_brightness_changed:
|
||||||
|
try:
|
||||||
|
asyncio.get_running_loop().create_task(
|
||||||
|
wifi_ws_clients.broadcast_global_brightness_to_tcp_drivers()
|
||||||
|
)
|
||||||
|
except RuntimeError:
|
||||||
|
pass
|
||||||
return json.dumps({"message": "Settings updated successfully"}), 200, {'Content-Type': 'application/json'}
|
return json.dumps({"message": "Settings updated successfully"}), 200, {'Content-Type': 'application/json'}
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
return json.dumps({"error": str(e)}), 400
|
return json.dumps({"error": str(e)}), 400
|
||||||
|
|||||||
@@ -1,346 +0,0 @@
|
|||||||
from microdot import Microdot, send_file
|
|
||||||
from microdot.session import with_session
|
|
||||||
from models.tab import Tab
|
|
||||||
from models.profile import Profile
|
|
||||||
import json
|
|
||||||
import os
|
|
||||||
import time
|
|
||||||
|
|
||||||
controller = Microdot()
|
|
||||||
tabs = Tab()
|
|
||||||
profiles = Profile()
|
|
||||||
|
|
||||||
def get_current_profile_id(session=None):
|
|
||||||
"""Get the current active profile ID from session or fallback to first."""
|
|
||||||
profile_list = profiles.list()
|
|
||||||
session_profile = None
|
|
||||||
if session is not None:
|
|
||||||
session_profile = session.get('current_profile')
|
|
||||||
if session_profile and session_profile in profile_list:
|
|
||||||
return session_profile
|
|
||||||
if profile_list:
|
|
||||||
return profile_list[0]
|
|
||||||
return None
|
|
||||||
|
|
||||||
def get_profile_tab_order(profile_id):
|
|
||||||
"""Get the tab order for a profile."""
|
|
||||||
if not profile_id:
|
|
||||||
return []
|
|
||||||
profile = profiles.read(profile_id)
|
|
||||||
if profile:
|
|
||||||
# Support both "tab_order" (old) and "tabs" (new) format
|
|
||||||
return profile.get("tabs", profile.get("tab_order", []))
|
|
||||||
return []
|
|
||||||
|
|
||||||
def get_current_tab_id(request, session=None):
|
|
||||||
"""Get the current tab ID from cookie."""
|
|
||||||
# Read from cookie first
|
|
||||||
current_tab = request.cookies.get('current_tab')
|
|
||||||
if current_tab:
|
|
||||||
return current_tab
|
|
||||||
|
|
||||||
# Fallback to first tab in current profile
|
|
||||||
profile_id = get_current_profile_id(session)
|
|
||||||
if profile_id:
|
|
||||||
profile = profiles.read(profile_id)
|
|
||||||
if profile:
|
|
||||||
# Support both "tabs" (new) and "tab_order" (old) format
|
|
||||||
tabs_list = profile.get("tabs", profile.get("tab_order", []))
|
|
||||||
if tabs_list:
|
|
||||||
return tabs_list[0]
|
|
||||||
return None
|
|
||||||
|
|
||||||
def _render_tabs_list_fragment(request, session):
|
|
||||||
"""Helper function to render tabs list HTML fragment."""
|
|
||||||
profile_id = get_current_profile_id(session)
|
|
||||||
# #region agent log
|
|
||||||
try:
|
|
||||||
os.makedirs('/home/pi/led-controller/.cursor', exist_ok=True)
|
|
||||||
with open('/home/pi/led-controller/.cursor/debug.log', 'a') as _log:
|
|
||||||
_log.write(json.dumps({
|
|
||||||
"sessionId": "debug-session",
|
|
||||||
"runId": "tabs-pre-fix",
|
|
||||||
"hypothesisId": "H1",
|
|
||||||
"location": "src/controllers/tab.py:_render_tabs_list_fragment",
|
|
||||||
"message": "tabs list fragment",
|
|
||||||
"data": {
|
|
||||||
"profile_id": profile_id,
|
|
||||||
"profile_count": len(profiles.list())
|
|
||||||
},
|
|
||||||
"timestamp": int(time.time() * 1000)
|
|
||||||
}) + "\n")
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
# #endregion
|
|
||||||
if not profile_id:
|
|
||||||
return '<div class="tabs-list">No profile selected</div>', 200, {'Content-Type': 'text/html'}
|
|
||||||
|
|
||||||
tab_order = get_profile_tab_order(profile_id)
|
|
||||||
current_tab_id = get_current_tab_id(request, session)
|
|
||||||
|
|
||||||
html = '<div class="tabs-list">'
|
|
||||||
for tab_id in tab_order:
|
|
||||||
tab_data = tabs.read(tab_id)
|
|
||||||
if tab_data:
|
|
||||||
active_class = 'active' if str(tab_id) == str(current_tab_id) else ''
|
|
||||||
tab_name = tab_data.get('name', 'Tab ' + str(tab_id))
|
|
||||||
html += (
|
|
||||||
'<button class="tab-button ' + active_class + '" '
|
|
||||||
'hx-get="/tabs/' + str(tab_id) + '/content-fragment" '
|
|
||||||
'hx-target="#tab-content" '
|
|
||||||
'hx-swap="innerHTML" '
|
|
||||||
'hx-push-url="true" '
|
|
||||||
'hx-trigger="click" '
|
|
||||||
'onclick="document.querySelectorAll(\'.tab-button\').forEach(b => b.classList.remove(\'active\')); this.classList.add(\'active\');">'
|
|
||||||
+ tab_name +
|
|
||||||
'</button>'
|
|
||||||
)
|
|
||||||
html += '</div>'
|
|
||||||
return html, 200, {'Content-Type': 'text/html'}
|
|
||||||
|
|
||||||
def _render_tab_content_fragment(request, session, id):
|
|
||||||
"""Helper function to render tab content HTML fragment."""
|
|
||||||
# Handle 'current' as a special case
|
|
||||||
if id == 'current':
|
|
||||||
current_tab_id = get_current_tab_id(request, session)
|
|
||||||
if not current_tab_id:
|
|
||||||
accept_header = request.headers.get('Accept', '')
|
|
||||||
wants_html = 'text/html' in accept_header
|
|
||||||
if wants_html:
|
|
||||||
return '<div class="error">No current tab set</div>', 404, {'Content-Type': 'text/html'}
|
|
||||||
return json.dumps({"error": "No current tab set"}), 404
|
|
||||||
id = current_tab_id
|
|
||||||
|
|
||||||
tab = tabs.read(id)
|
|
||||||
if not tab:
|
|
||||||
return '<div>Tab not found</div>', 404, {'Content-Type': 'text/html'}
|
|
||||||
|
|
||||||
# Set this tab as the current tab in session
|
|
||||||
session['current_tab'] = str(id)
|
|
||||||
session.save()
|
|
||||||
|
|
||||||
# If this is a direct page load (not HTMX), return full UI so CSS loads.
|
|
||||||
if not request.headers.get('HX-Request'):
|
|
||||||
return send_file('templates/index.html')
|
|
||||||
|
|
||||||
tab_name = tab.get('name', 'Tab ' + str(id))
|
|
||||||
|
|
||||||
html = (
|
|
||||||
'<div class="presets-section" data-tab-id="' + str(id) + '">'
|
|
||||||
'<h3>Presets</h3>'
|
|
||||||
'<div class="profiles-actions" style="margin-bottom: 1rem;"></div>'
|
|
||||||
'<div id="presets-list-tab" class="presets-list">'
|
|
||||||
'<!-- Presets will be loaded here -->'
|
|
||||||
'</div>'
|
|
||||||
'</div>'
|
|
||||||
)
|
|
||||||
return html, 200, {'Content-Type': 'text/html'}
|
|
||||||
|
|
||||||
@controller.get('')
|
|
||||||
@with_session
|
|
||||||
async def list_tabs(request, session):
|
|
||||||
"""List all tabs with current tab info."""
|
|
||||||
profile_id = get_current_profile_id(session)
|
|
||||||
current_tab_id = get_current_tab_id(request, session)
|
|
||||||
|
|
||||||
# Get tab order for current profile
|
|
||||||
tab_order = get_profile_tab_order(profile_id) if profile_id else []
|
|
||||||
|
|
||||||
# Build tabs list with metadata
|
|
||||||
tabs_data = {}
|
|
||||||
for tab_id in tabs.list():
|
|
||||||
tab_data = tabs.read(tab_id)
|
|
||||||
if tab_data:
|
|
||||||
tabs_data[tab_id] = tab_data
|
|
||||||
|
|
||||||
return json.dumps({
|
|
||||||
"tabs": tabs_data,
|
|
||||||
"tab_order": tab_order,
|
|
||||||
"current_tab_id": current_tab_id,
|
|
||||||
"profile_id": profile_id
|
|
||||||
}), 200, {'Content-Type': 'application/json'}
|
|
||||||
|
|
||||||
# Get current tab - returns JSON with tab data and content info
|
|
||||||
@controller.get('/current')
|
|
||||||
@with_session
|
|
||||||
async def get_current_tab(request, session):
|
|
||||||
"""Get the current tab from session."""
|
|
||||||
current_tab_id = get_current_tab_id(request, session)
|
|
||||||
if not current_tab_id:
|
|
||||||
return json.dumps({"error": "No current tab set", "tab": None, "tab_id": None}), 404
|
|
||||||
|
|
||||||
tab = tabs.read(current_tab_id)
|
|
||||||
if tab:
|
|
||||||
return json.dumps({
|
|
||||||
"tab": tab,
|
|
||||||
"tab_id": current_tab_id
|
|
||||||
}), 200, {'Content-Type': 'application/json'}
|
|
||||||
return json.dumps({"error": "Tab not found", "tab": None, "tab_id": None}), 404
|
|
||||||
|
|
||||||
@controller.post('/<id>/set-current')
|
|
||||||
async def set_current_tab(request, id):
|
|
||||||
"""Set a tab as the current tab in cookie."""
|
|
||||||
tab = tabs.read(id)
|
|
||||||
if not tab:
|
|
||||||
return json.dumps({"error": "Tab not found"}), 404
|
|
||||||
|
|
||||||
# Set cookie with current tab
|
|
||||||
response_data = json.dumps({"message": "Current tab set", "tab_id": id})
|
|
||||||
response = response_data, 200, {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Set-Cookie': f'current_tab={id}; Path=/; Max-Age=31536000' # 1 year expiry
|
|
||||||
}
|
|
||||||
return response
|
|
||||||
|
|
||||||
@controller.get('/<id>')
|
|
||||||
async def get_tab(request, id):
|
|
||||||
"""Get a specific tab by ID."""
|
|
||||||
tab = tabs.read(id)
|
|
||||||
if tab:
|
|
||||||
return json.dumps(tab), 200, {'Content-Type': 'application/json'}
|
|
||||||
return json.dumps({"error": "Tab not found"}), 404
|
|
||||||
|
|
||||||
@controller.put('/<id>')
|
|
||||||
async def update_tab(request, id):
|
|
||||||
"""Update an existing tab."""
|
|
||||||
try:
|
|
||||||
data = request.json
|
|
||||||
if tabs.update(id, data):
|
|
||||||
return json.dumps(tabs.read(id)), 200, {'Content-Type': 'application/json'}
|
|
||||||
return json.dumps({"error": "Tab not found"}), 404
|
|
||||||
except Exception as e:
|
|
||||||
return json.dumps({"error": str(e)}), 400
|
|
||||||
|
|
||||||
@controller.delete('/<id>')
|
|
||||||
@with_session
|
|
||||||
async def delete_tab(request, session, id):
|
|
||||||
"""Delete a tab."""
|
|
||||||
try:
|
|
||||||
# Handle 'current' tab ID
|
|
||||||
if id == 'current':
|
|
||||||
current_tab_id = get_current_tab_id(request, session)
|
|
||||||
if current_tab_id:
|
|
||||||
id = current_tab_id
|
|
||||||
else:
|
|
||||||
return json.dumps({"error": "No current tab to delete"}), 404
|
|
||||||
|
|
||||||
if tabs.delete(id):
|
|
||||||
# Remove from profile's tabs
|
|
||||||
profile_id = get_current_profile_id(session)
|
|
||||||
if profile_id:
|
|
||||||
profile = profiles.read(profile_id)
|
|
||||||
if profile:
|
|
||||||
# Support both "tabs" (new) and "tab_order" (old) format
|
|
||||||
tabs_list = profile.get('tabs', profile.get('tab_order', []))
|
|
||||||
if id in tabs_list:
|
|
||||||
tabs_list.remove(id)
|
|
||||||
profile['tabs'] = tabs_list
|
|
||||||
# Remove old tab_order if it exists
|
|
||||||
if 'tab_order' in profile:
|
|
||||||
del profile['tab_order']
|
|
||||||
profiles.update(profile_id, profile)
|
|
||||||
|
|
||||||
# Clear cookie if the deleted tab was the current tab
|
|
||||||
current_tab_id = get_current_tab_id(request, session)
|
|
||||||
if current_tab_id == id:
|
|
||||||
response_data = json.dumps({"message": "Tab deleted successfully"})
|
|
||||||
response = response_data, 200, {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
'Set-Cookie': 'current_tab=; Path=/; Max-Age=0' # Clear cookie
|
|
||||||
}
|
|
||||||
return response
|
|
||||||
|
|
||||||
return json.dumps({"message": "Tab deleted successfully"}), 200, {'Content-Type': 'application/json'}
|
|
||||||
|
|
||||||
return json.dumps({"error": "Tab not found"}), 404
|
|
||||||
except Exception as e:
|
|
||||||
import sys
|
|
||||||
try:
|
|
||||||
sys.print_exception(e)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return json.dumps({"error": str(e)}), 500, {'Content-Type': 'application/json'}
|
|
||||||
|
|
||||||
@controller.post('')
|
|
||||||
@with_session
|
|
||||||
async def create_tab(request, session):
|
|
||||||
"""Create a new tab."""
|
|
||||||
try:
|
|
||||||
# Handle form data or JSON
|
|
||||||
if request.form:
|
|
||||||
name = request.form.get('name', '').strip()
|
|
||||||
ids_str = request.form.get('ids', '1').strip()
|
|
||||||
names = [id.strip() for id in ids_str.split(',') if id.strip()]
|
|
||||||
preset_ids = None
|
|
||||||
else:
|
|
||||||
data = request.json or {}
|
|
||||||
name = data.get("name", "")
|
|
||||||
names = data.get("names", None)
|
|
||||||
preset_ids = data.get("presets", None)
|
|
||||||
|
|
||||||
if not name:
|
|
||||||
return json.dumps({"error": "Tab name cannot be empty"}), 400
|
|
||||||
|
|
||||||
tab_id = tabs.create(name, names, preset_ids)
|
|
||||||
|
|
||||||
# Add to current profile's tabs
|
|
||||||
profile_id = get_current_profile_id(session)
|
|
||||||
if profile_id:
|
|
||||||
profile = profiles.read(profile_id)
|
|
||||||
if profile:
|
|
||||||
# Support both "tabs" (new) and "tab_order" (old) format
|
|
||||||
tabs_list = profile.get('tabs', profile.get('tab_order', []))
|
|
||||||
if tab_id not in tabs_list:
|
|
||||||
tabs_list.append(tab_id)
|
|
||||||
profile['tabs'] = tabs_list
|
|
||||||
# Remove old tab_order if it exists
|
|
||||||
if 'tab_order' in profile:
|
|
||||||
del profile['tab_order']
|
|
||||||
profiles.update(profile_id, profile)
|
|
||||||
|
|
||||||
# Return JSON response with tab ID
|
|
||||||
tab_data = tabs.read(tab_id)
|
|
||||||
return json.dumps({tab_id: tab_data}), 201, {'Content-Type': 'application/json'}
|
|
||||||
except Exception as e:
|
|
||||||
import sys
|
|
||||||
sys.print_exception(e)
|
|
||||||
return json.dumps({"error": str(e)}), 400
|
|
||||||
|
|
||||||
@controller.post('/<id>/clone')
|
|
||||||
@with_session
|
|
||||||
async def clone_tab(request, session, id):
|
|
||||||
"""Clone an existing tab and add it to the current profile."""
|
|
||||||
try:
|
|
||||||
source = tabs.read(id)
|
|
||||||
if not source:
|
|
||||||
return json.dumps({"error": "Tab not found"}), 404
|
|
||||||
|
|
||||||
data = request.json or {}
|
|
||||||
source_name = source.get("name") or f"Tab {id}"
|
|
||||||
new_name = data.get("name") or f"{source_name} Copy"
|
|
||||||
clone_id = tabs.create(new_name, source.get("names"), source.get("presets"))
|
|
||||||
extra = {k: v for k, v in source.items() if k not in ("name", "names", "presets")}
|
|
||||||
if extra:
|
|
||||||
tabs.update(clone_id, extra)
|
|
||||||
|
|
||||||
profile_id = get_current_profile_id(session)
|
|
||||||
if profile_id:
|
|
||||||
profile = profiles.read(profile_id)
|
|
||||||
if profile:
|
|
||||||
tabs_list = profile.get('tabs', profile.get('tab_order', []))
|
|
||||||
if clone_id not in tabs_list:
|
|
||||||
tabs_list.append(clone_id)
|
|
||||||
profile['tabs'] = tabs_list
|
|
||||||
if 'tab_order' in profile:
|
|
||||||
del profile['tab_order']
|
|
||||||
profiles.update(profile_id, profile)
|
|
||||||
|
|
||||||
tab_data = tabs.read(clone_id)
|
|
||||||
return json.dumps({clone_id: tab_data}), 201, {'Content-Type': 'application/json'}
|
|
||||||
except Exception as e:
|
|
||||||
import sys
|
|
||||||
try:
|
|
||||||
sys.print_exception(e)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
return json.dumps({"error": str(e)}), 400
|
|
||||||
@@ -0,0 +1,400 @@
|
|||||||
|
from microdot import Microdot, send_file
|
||||||
|
from microdot.session import with_session
|
||||||
|
from models.zone import Zone
|
||||||
|
from models.profile import Profile
|
||||||
|
import json
|
||||||
|
|
||||||
|
controller = Microdot()
|
||||||
|
zones = Zone()
|
||||||
|
profiles = Profile()
|
||||||
|
|
||||||
|
|
||||||
|
def get_current_profile_id(session=None):
|
||||||
|
"""Get the current active profile ID from session or fallback to first."""
|
||||||
|
profile_list = profiles.list()
|
||||||
|
session_profile = None
|
||||||
|
if session is not None:
|
||||||
|
session_profile = session.get("current_profile")
|
||||||
|
if session_profile and session_profile in profile_list:
|
||||||
|
return session_profile
|
||||||
|
if profile_list:
|
||||||
|
return profile_list[0]
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _profile_zone_id_list(profile):
|
||||||
|
"""Ordered zone ids for a profile (``zones``, legacy ``tabs``, or ``zone_order``)."""
|
||||||
|
if not profile or not isinstance(profile, dict):
|
||||||
|
return []
|
||||||
|
z = profile.get("zones")
|
||||||
|
if isinstance(z, list) and z:
|
||||||
|
return list(z)
|
||||||
|
t = profile.get("zones")
|
||||||
|
if isinstance(t, list) and t:
|
||||||
|
return list(t)
|
||||||
|
o = profile.get("zone_order")
|
||||||
|
if isinstance(o, list) and o:
|
||||||
|
return list(o)
|
||||||
|
return []
|
||||||
|
|
||||||
|
|
||||||
|
def get_profile_zone_order(profile_id):
|
||||||
|
if not profile_id:
|
||||||
|
return []
|
||||||
|
profile = profiles.read(profile_id)
|
||||||
|
return _profile_zone_id_list(profile)
|
||||||
|
|
||||||
|
|
||||||
|
def _set_profile_zone_order(profile, ids):
|
||||||
|
profile["zones"] = list(ids)
|
||||||
|
profile.pop("tabs", None)
|
||||||
|
profile.pop("zone_order", None)
|
||||||
|
|
||||||
|
|
||||||
|
def get_current_zone_id(request, session=None):
|
||||||
|
"""Cookie ``current_zone``, legacy ``current_zone``, then first zone in profile."""
|
||||||
|
z = request.cookies.get("current_zone") or request.cookies.get("current_zone")
|
||||||
|
if z:
|
||||||
|
return z
|
||||||
|
profile_id = get_current_profile_id(session)
|
||||||
|
if profile_id:
|
||||||
|
profile = profiles.read(profile_id)
|
||||||
|
order = _profile_zone_id_list(profile)
|
||||||
|
if order:
|
||||||
|
return order[0]
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
def _render_zones_list_fragment(request, session):
|
||||||
|
"""Render zone strip HTML for HTMX / JS."""
|
||||||
|
profile_id = get_current_profile_id(session)
|
||||||
|
if not profile_id:
|
||||||
|
return (
|
||||||
|
'<div class="zones-list">No profile selected</div>',
|
||||||
|
200,
|
||||||
|
{"Content-Type": "text/html"},
|
||||||
|
)
|
||||||
|
|
||||||
|
zone_order = get_profile_zone_order(profile_id)
|
||||||
|
current_zone_id = get_current_zone_id(request, session)
|
||||||
|
|
||||||
|
html = '<div class="zones-list">'
|
||||||
|
for zid in zone_order:
|
||||||
|
zdata = zones.read(zid)
|
||||||
|
if zdata:
|
||||||
|
active_class = "active" if str(zid) == str(current_zone_id) else ""
|
||||||
|
zname = zdata.get("name", "Zone " + str(zid))
|
||||||
|
html += (
|
||||||
|
'<button class="zone-button ' + active_class + '" '
|
||||||
|
'hx-get="/zones/' + str(zid) + '/content-fragment" '
|
||||||
|
'hx-target="#zone-content" '
|
||||||
|
'hx-swap="innerHTML" '
|
||||||
|
'hx-push-url="true" '
|
||||||
|
'hx-trigger="click" '
|
||||||
|
'onclick="document.querySelectorAll(\'.zone-button\').forEach(b => b.classList.remove(\'active\')); this.classList.add(\'active\');">'
|
||||||
|
+ zname
|
||||||
|
+ "</button>"
|
||||||
|
)
|
||||||
|
html += "</div>"
|
||||||
|
return html, 200, {"Content-Type": "text/html"}
|
||||||
|
|
||||||
|
|
||||||
|
def _render_zone_content_fragment(request, session, id):
|
||||||
|
if id == "current":
|
||||||
|
current_zone_id = get_current_zone_id(request, session)
|
||||||
|
if not current_zone_id:
|
||||||
|
accept_header = request.headers.get("Accept", "")
|
||||||
|
wants_html = "text/html" in accept_header
|
||||||
|
if wants_html:
|
||||||
|
return (
|
||||||
|
'<div class="error">No current zone set</div>',
|
||||||
|
404,
|
||||||
|
{"Content-Type": "text/html"},
|
||||||
|
)
|
||||||
|
return json.dumps({"error": "No current zone set"}), 404
|
||||||
|
id = current_zone_id
|
||||||
|
|
||||||
|
z = zones.read(id)
|
||||||
|
if not z:
|
||||||
|
return '<div>Zone not found</div>', 404, {"Content-Type": "text/html"}
|
||||||
|
|
||||||
|
session["current_zone"] = str(id)
|
||||||
|
session.save()
|
||||||
|
|
||||||
|
if not request.headers.get("HX-Request"):
|
||||||
|
return send_file("templates/index.html")
|
||||||
|
|
||||||
|
html = (
|
||||||
|
'<div class="presets-section" data-zone-id="' + str(id) + '">'
|
||||||
|
"<h3>Presets</h3>"
|
||||||
|
'<div class="profiles-actions" style="margin-bottom: 1rem;"></div>'
|
||||||
|
'<div id="presets-list-zone" class="presets-list">'
|
||||||
|
"<!-- Presets will be loaded here -->"
|
||||||
|
"</div>"
|
||||||
|
"</div>"
|
||||||
|
)
|
||||||
|
return html, 200, {"Content-Type": "text/html"}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get("/<id>/content-fragment")
|
||||||
|
@with_session
|
||||||
|
async def zone_content_fragment(request, session, id):
|
||||||
|
return _render_zone_content_fragment(request, session, id)
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get("")
|
||||||
|
@with_session
|
||||||
|
async def list_zones(request, session):
|
||||||
|
profile_id = get_current_profile_id(session)
|
||||||
|
current_zone_id = get_current_zone_id(request, session)
|
||||||
|
zone_order = get_profile_zone_order(profile_id) if profile_id else []
|
||||||
|
|
||||||
|
zones_data = {}
|
||||||
|
for zid in zones.list():
|
||||||
|
zdata = zones.read(zid)
|
||||||
|
if zdata:
|
||||||
|
zones_data[zid] = zdata
|
||||||
|
|
||||||
|
return (
|
||||||
|
json.dumps(
|
||||||
|
{
|
||||||
|
"zones": zones_data,
|
||||||
|
"zone_order": zone_order,
|
||||||
|
"current_zone_id": current_zone_id,
|
||||||
|
"profile_id": profile_id,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
200,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get("/current")
|
||||||
|
@with_session
|
||||||
|
async def get_current_zone(request, session):
|
||||||
|
current_zone_id = get_current_zone_id(request, session)
|
||||||
|
if not current_zone_id:
|
||||||
|
return (
|
||||||
|
json.dumps({"error": "No current zone set", "zone": None, "zone_id": None}),
|
||||||
|
404,
|
||||||
|
)
|
||||||
|
|
||||||
|
z = zones.read(current_zone_id)
|
||||||
|
if z:
|
||||||
|
return (
|
||||||
|
json.dumps({"zone": z, "zone_id": current_zone_id}),
|
||||||
|
200,
|
||||||
|
{"Content-Type": "application/json"},
|
||||||
|
)
|
||||||
|
return (
|
||||||
|
json.dumps({"error": "Zone not found", "zone": None, "zone_id": None}),
|
||||||
|
404,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post("/<id>/set-current")
|
||||||
|
async def set_current_zone(request, id):
|
||||||
|
z = zones.read(id)
|
||||||
|
if not z:
|
||||||
|
return json.dumps({"error": "Zone not found"}), 404
|
||||||
|
|
||||||
|
response_data = json.dumps({"message": "Current zone set", "zone_id": id})
|
||||||
|
return (
|
||||||
|
response_data,
|
||||||
|
200,
|
||||||
|
{
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Set-Cookie": (
|
||||||
|
f"current_zone={id}; Path=/; Max-Age=31536000; SameSite=Lax"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get("/engine/status")
|
||||||
|
async def engine_status(request):
|
||||||
|
"""Pi-side engine state: rendering zones and running sequences."""
|
||||||
|
from engine import get_engine
|
||||||
|
|
||||||
|
return json.dumps(get_engine().status()), 200, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post("/<id>/play")
|
||||||
|
async def play_zone(request, id):
|
||||||
|
"""Run a preset on every target in the zone.
|
||||||
|
|
||||||
|
Body: {"preset_id": "16", "drivers": true}. Pixel outputs (DDP/Art-Net/sACN/DMX)
|
||||||
|
are rendered on the Pi; ESP32 led-drivers get the preset + select as before
|
||||||
|
unless ``drivers`` is false. Stops any sequence running on the zone.
|
||||||
|
"""
|
||||||
|
from engine import get_engine
|
||||||
|
from engine.core import EngineError
|
||||||
|
|
||||||
|
data = request.json or {}
|
||||||
|
preset_id = data.get("preset_id")
|
||||||
|
if preset_id in (None, ""):
|
||||||
|
return json.dumps({"error": "preset_id is required"}), 400, {"Content-Type": "application/json"}
|
||||||
|
try:
|
||||||
|
status = await get_engine().play(id, str(preset_id), drivers=data.get("drivers", True) is not False)
|
||||||
|
except EngineError as e:
|
||||||
|
return json.dumps({"error": str(e)}), e.status, {"Content-Type": "application/json"}
|
||||||
|
return json.dumps(status), 200, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post("/<id>/stop")
|
||||||
|
async def stop_zone(request, id):
|
||||||
|
"""Stop the zone's sequence and Pi rendering (pixel outputs go black)."""
|
||||||
|
from engine import get_engine
|
||||||
|
|
||||||
|
stopped = await get_engine().stop(id)
|
||||||
|
return json.dumps({"stopped": stopped}), 200, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.get("/<id>")
|
||||||
|
async def get_zone(request, id):
|
||||||
|
z = zones.read(id)
|
||||||
|
if z:
|
||||||
|
return json.dumps(z), 200, {"Content-Type": "application/json"}
|
||||||
|
return json.dumps({"error": "Zone not found"}), 404
|
||||||
|
|
||||||
|
|
||||||
|
@controller.put("/<id>")
|
||||||
|
async def update_zone(request, id):
|
||||||
|
try:
|
||||||
|
data = request.json
|
||||||
|
if zones.update(id, data):
|
||||||
|
return json.dumps(zones.read(id)), 200, {"Content-Type": "application/json"}
|
||||||
|
return json.dumps({"error": "Zone not found"}), 404
|
||||||
|
except Exception as e:
|
||||||
|
return json.dumps({"error": str(e)}), 400
|
||||||
|
|
||||||
|
|
||||||
|
@controller.delete("/<id>")
|
||||||
|
@with_session
|
||||||
|
async def delete_zone(request, session, id):
|
||||||
|
try:
|
||||||
|
if id == "current":
|
||||||
|
current_zone_id = get_current_zone_id(request, session)
|
||||||
|
if current_zone_id:
|
||||||
|
id = current_zone_id
|
||||||
|
else:
|
||||||
|
return json.dumps({"error": "No current zone to delete"}), 404
|
||||||
|
|
||||||
|
if zones.delete(id):
|
||||||
|
profile_id = get_current_profile_id(session)
|
||||||
|
if profile_id:
|
||||||
|
profile = profiles.read(profile_id)
|
||||||
|
if profile:
|
||||||
|
zlist = _profile_zone_id_list(profile)
|
||||||
|
if id in zlist:
|
||||||
|
zlist.remove(id)
|
||||||
|
_set_profile_zone_order(profile, zlist)
|
||||||
|
profiles.update(profile_id, profile)
|
||||||
|
|
||||||
|
current_zone_id = get_current_zone_id(request, session)
|
||||||
|
if current_zone_id == id:
|
||||||
|
response_data = json.dumps({"message": "Zone deleted successfully"})
|
||||||
|
return (
|
||||||
|
response_data,
|
||||||
|
200,
|
||||||
|
{
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
"Set-Cookie": (
|
||||||
|
"current_zone=; Path=/; Max-Age=0; SameSite=Lax"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
|
return json.dumps({"message": "Zone deleted successfully"}), 200, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
|
||||||
|
return json.dumps({"error": "Zone not found"}), 404
|
||||||
|
except Exception as e:
|
||||||
|
import sys
|
||||||
|
|
||||||
|
try:
|
||||||
|
sys.print_exception(e)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return json.dumps({"error": str(e)}), 500, {"Content-Type": "application/json"}
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post("")
|
||||||
|
@with_session
|
||||||
|
async def create_zone(request, session):
|
||||||
|
try:
|
||||||
|
if request.form:
|
||||||
|
name = request.form.get("name", "").strip()
|
||||||
|
ids_str = request.form.get("ids", "1").strip()
|
||||||
|
names = [i.strip() for i in ids_str.split(",") if i.strip()]
|
||||||
|
preset_ids = None
|
||||||
|
else:
|
||||||
|
data = request.json or {}
|
||||||
|
name = data.get("name", "")
|
||||||
|
names = data.get("names")
|
||||||
|
if names is None:
|
||||||
|
names = data.get("ids")
|
||||||
|
preset_ids = data.get("presets", None)
|
||||||
|
|
||||||
|
if not name:
|
||||||
|
return json.dumps({"error": "Zone name cannot be empty"}), 400
|
||||||
|
|
||||||
|
zid = zones.create(name, names, preset_ids)
|
||||||
|
|
||||||
|
profile_id = get_current_profile_id(session)
|
||||||
|
if profile_id:
|
||||||
|
profile = profiles.read(profile_id)
|
||||||
|
if profile:
|
||||||
|
zlist = _profile_zone_id_list(profile)
|
||||||
|
if zid not in zlist:
|
||||||
|
zlist.append(zid)
|
||||||
|
_set_profile_zone_order(profile, zlist)
|
||||||
|
profiles.update(profile_id, profile)
|
||||||
|
|
||||||
|
zdata = zones.read(zid)
|
||||||
|
return json.dumps({zid: zdata}), 201, {"Content-Type": "application/json"}
|
||||||
|
except Exception as e:
|
||||||
|
import sys
|
||||||
|
|
||||||
|
sys.print_exception(e)
|
||||||
|
return json.dumps({"error": str(e)}), 400
|
||||||
|
|
||||||
|
|
||||||
|
@controller.post("/<id>/clone")
|
||||||
|
@with_session
|
||||||
|
async def clone_zone(request, session, id):
|
||||||
|
try:
|
||||||
|
source = zones.read(id)
|
||||||
|
if not source:
|
||||||
|
return json.dumps({"error": "Zone not found"}), 404
|
||||||
|
|
||||||
|
data = request.json or {}
|
||||||
|
source_name = source.get("name") or f"Zone {id}"
|
||||||
|
new_name = data.get("name") or f"{source_name} Copy"
|
||||||
|
clone_id = zones.create(new_name, source.get("names"), source.get("presets"))
|
||||||
|
extra = {k: v for k, v in source.items() if k not in ("name", "names", "presets")}
|
||||||
|
if extra:
|
||||||
|
zones.update(clone_id, extra)
|
||||||
|
|
||||||
|
profile_id = get_current_profile_id(session)
|
||||||
|
if profile_id:
|
||||||
|
profile = profiles.read(profile_id)
|
||||||
|
if profile:
|
||||||
|
zlist = _profile_zone_id_list(profile)
|
||||||
|
if clone_id not in zlist:
|
||||||
|
zlist.append(clone_id)
|
||||||
|
_set_profile_zone_order(profile, zlist)
|
||||||
|
profiles.update(profile_id, profile)
|
||||||
|
|
||||||
|
zdata = zones.read(clone_id)
|
||||||
|
return json.dumps({clone_id: zdata}), 201, {"Content-Type": "application/json"}
|
||||||
|
except Exception as e:
|
||||||
|
import sys
|
||||||
|
|
||||||
|
try:
|
||||||
|
sys.print_exception(e)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
return json.dumps({"error": str(e)}), 400
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
"""Pi-side animation engine.
|
||||||
|
|
||||||
|
* ``engine.outputs`` — protocol drivers (DDP, Art-Net, sACN, USB-DMX, ESP32 presets)
|
||||||
|
* ``engine.renderer`` — runs unchanged led-driver patterns under CPython
|
||||||
|
* ``engine.player`` — per-zone frame streaming
|
||||||
|
* ``engine.sequence_runner`` — timed preset chains
|
||||||
|
|
||||||
|
``get_engine()`` returns the process-wide Engine (created on first use).
|
||||||
|
"""
|
||||||
|
|
||||||
|
_engine = None
|
||||||
|
|
||||||
|
|
||||||
|
def get_engine():
|
||||||
|
global _engine
|
||||||
|
if _engine is None:
|
||||||
|
from engine.core import Engine
|
||||||
|
_engine = Engine()
|
||||||
|
return _engine
|
||||||
|
|
||||||
|
|
||||||
|
def set_engine(engine):
|
||||||
|
global _engine
|
||||||
|
_engine = engine
|
||||||
|
return engine
|
||||||
Loaded 100 of 171 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user