Devices may publish to their own out ports' messages (a level set on the device itself)
Docs / docs (push) Successful in 23s
Playwright Tests / test-playwright (1, 2) (push) Failing after 36s
Playwright Tests / test-playwright (2, 2) (push) Failing after 20s
pre-commit / pre-commit (push) Failing after 2m13s
Test Backend / test-backend (3.12) (push) Successful in 4m32s
Test Backend / test-backend (3.14) (push) Successful in 4m18s
Compose Smoke Test / test-compose (push) Failing after 26s
Playwright Tests / merge-reports (push) Failing after 2m16s

This commit is contained in:
Melvin Strobl
2026-10-29 21:58:38 +01:00
parent d2e8c01785
commit e0f5ddc3a4
3 changed files with 18 additions and 11 deletions
+9 -5
View File
@@ -139,15 +139,19 @@ def _device_writable(device: DeviceDef, request: Request) -> set[str]:
one is what entitles the screen to it. Reads are untouched — read-only is
not blind, and a locked dashboard has to keep drawing live data.
The device's own ``in`` ports, as flows wire them, are added outside the
lock: it covers the controls on a dashboard, not the sensors on the
device. Its ``out`` ports are read, not written, unless a widget targets
them too.
The device's own ports, as flows wire them, are added outside the lock:
it covers the controls on a dashboard, not the device itself. Its ``in``
ports are its sensors; its ``out`` ports it publishes when set on the
device (a panel's brightness on its config page), so what follows the
message hears of it.
"""
store: DashboardStore | None = getattr(request.app.state, "dashboard_store", None)
if store is None:
return set()
writable = _device_in(device, request)
owned: DeviceStore | None = getattr(request.app.state, "device_store", None)
writable = (
{b.message for b in owned.bound(device.id)} if owned is not None else set()
)
defns = devices.dashboards_for(device, store)
bound = sorted(
{s.message for d in defns if (s := d.settings.get("locked")) and s.message}