feat(ui): driver settings and code updates over ESP-NOW
Settings gets a Driver tab (/settings/editor). It sends a driver its settings through PUT /devices/<id>, which now forwards name too, and runs the tools/driver_ota.py session from the browser. The firmware embeds the led-driver files and a manifest of their hashes, because crypto.subtle is unavailable over plain HTTP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2f0c26e9b8
commit
06953028ab
11 files changed
+421
-8
No files matched your search
+18
-1
@@ -1,3 +1,5 @@
|
||||
import hashlib
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@@ -11,11 +13,26 @@ def test_favicon(c):
|
||||
assert c.get("/favicon.ico").status_code == 204
|
||||
|
||||
|
||||
@pytest.mark.parametrize("path", ["style.css", "zones.js", "presets.js", "profiles.js", "devices.js"])
|
||||
@pytest.mark.parametrize("path", ["style.css", "zones.js", "presets.js", "profiles.js", "devices.js",
|
||||
"settings_editor.js"])
|
||||
def test_static(c, path):
|
||||
assert c.get(f"/static/{path}").status_code == 200
|
||||
|
||||
|
||||
def test_settings_editor_page(c):
|
||||
resp = c.get("/settings/editor")
|
||||
assert resp.status_code == 200
|
||||
assert "espnow-send" in resp.text
|
||||
|
||||
|
||||
def test_driver_files(c):
|
||||
files = c.get("/static/driver/manifest.json").json()["files"]
|
||||
assert any(f["path"] == "main.py" for f in files)
|
||||
for f in (files[0], files[-1]):
|
||||
body = c.get(f"/static/driver/{f['path']}").content
|
||||
assert hashlib.sha256(body).hexdigest() == f["sha"]
|
||||
|
||||
|
||||
def test_status_reset_reason(c):
|
||||
assert c.get("/status").json()["reset_reason"]
|
||||
|
||||
|
||||
Reference in new issue
Block a user