src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/local_screens.c
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-06-14 18:16:46 -0500
committerLuke Hoersten <[email protected]>2026-06-14 18:16:46 -0500
commit4a6bbdb075a5e4f9910cb9b85e615ff8c50aa4ec (patch)
tree39bf9c7fb9ef39d15bbad3526e16d1c3ddd88dca /main/local_screens.c
parentd4fcec3a4d012332e7c476562f9363977ac65561 (diff)
Drop VIEWPORT_STATE_UNCONFIGURED — state is just awake/asleep
\`state\` now reports only the screen's runtime state (awake or asleep). Whether a viewport is set up to talk to Scrypted is a separate \`configured\` flag, derived from \`viewport_name && scrypted_url\`. There's no third state. Behaviour changes: - POST /state always succeeds; the previous 409 "device unconfigured" path is gone. The screen toggles regardless of /config status. - POST /config now sets \`configured\` directly from the derived predicate instead of mutating the state enum. - Outbound state-client POST to Scrypted is still gated on a scrypted URL being present — that's the only thing the configured flag now actually controls in the runtime path. GET /state JSON unchanged in shape, but \`state\` is now never "unconfigured" — that's reported through the existing \`configured\` boolean instead.
Diffstat (limited to 'main/local_screens.c')
-rw-r--r--main/local_screens.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/main/local_screens.c b/main/local_screens.c
index 4b639ef..7459d9a 100644
--- a/main/local_screens.c
+++ b/main/local_screens.c
@@ -297,10 +297,7 @@ esp_err_t local_screens_show_info(void)
char heap_str[12]; fmt_bytes(heap_str, sizeof(heap_str), free_heap);
char psram_str[12]; fmt_bytes(psram_str, sizeof(psram_str), free_psram);
- const char *state_str =
- (state == VIEWPORT_STATE_AWAKE) ? "awake"
- : (state == VIEWPORT_STATE_ASLEEP) ? "asleep"
- : "unconfigured";
+ const char *state_str = (state == VIEWPORT_STATE_AWAKE) ? "awake" : "asleep";
// Label width is fixed at 8 chars (trailing spaces pad it). Values are
// left-aligned at column 8. Auto-scaler then picks a font scale to fit.