src.nth.io/

summaryrefslogtreecommitdiff
path: root/main/viewport_state.h
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/viewport_state.h
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/viewport_state.h')
-rw-r--r--main/viewport_state.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/main/viewport_state.h b/main/viewport_state.h
index b580ff7..3f6147f 100644
--- a/main/viewport_state.h
+++ b/main/viewport_state.h
@@ -13,9 +13,8 @@ typedef enum {
} viewport_orientation_t;
typedef enum {
- VIEWPORT_STATE_UNCONFIGURED = 0,
+ VIEWPORT_STATE_ASLEEP = 0, // boot default; backlight off
VIEWPORT_STATE_AWAKE,
- VIEWPORT_STATE_ASLEEP,
} viewport_run_state_t;
// Read-mostly snapshot of device state used by /state. Counters are