From 0df740df6aebc2841b701a07b5a423af62477320 Mon Sep 17 00:00:00 2001 From: cjkas Date: Sun, 25 Oct 2026 20:12:54 +0100 Subject: [PATCH 1/4] feat: web UI on socket protocol 2 (step 2b) The UI talks to the device over the one socket at /ws: the sync fills the shade model, its events redraw the lists, and every read, command, edit, setting, scan and reboot is an op. Only /loginContext, /login and the file transfers stay on HTTP, so a page load opens no other connection. - The 8080 socket, editJSON/requestResult and the /controller, /rooms, /shades, /groups, /room, /shade, /group, settings and command routes are no longer used by the UI. - An edit's callback gets the item once its event is in (ProtoClient waitFor); busy edits and saves are sent again. - The token is kept in sessionStorage. When /ws is refused and /loginContext says a login is needed, the client stops retrying and the login panel opens. Backup and uploads send the token. - A banner shows when the device speaks another protocol version. - Removed dead code: the /pairShade call and its unused /unpairShade twin, loadLogin, login.html (broken, linked from nowhere), Secure Config Only's checkbox (protocol 2 has two modes) and the HTTP helpers nothing uses. Co-Authored-By: Claude Opus 5.5 --- data-src/index.html | 4 - data-src/index.js | 1407 +++++++++++++++------------------------- data-src/js/client.js | 22 +- data-src/login.html | 51 -- data-src/main.css | 11 + test/js/client.test.js | 19 + 6 files changed, 570 insertions(+), 944 deletions(-) delete mode 100644 data-src/login.html diff --git a/data-src/index.html b/data-src/index.html index 398f0f0..4772b99 100644 --- a/data-src/index.html +++ b/data-src/index.html @@ -179,10 +179,6 @@ -