diff options
| author | Luke Hoersten <[email protected]> | 2026-06-14 18:16:46 -0500 |
|---|---|---|
| committer | Luke Hoersten <[email protected]> | 2026-06-14 18:16:46 -0500 |
| commit | 4a6bbdb075a5e4f9910cb9b85e615ff8c50aa4ec (patch) | |
| tree | 39bf9c7fb9ef39d15bbad3526e16d1c3ddd88dca /main/state_machine.c | |
| parent | d4fcec3a4d012332e7c476562f9363977ac65561 (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/state_machine.c')
| -rw-r--r-- | main/state_machine.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/main/state_machine.c b/main/state_machine.c index 3d95308..a4d4dab 100644 --- a/main/state_machine.c +++ b/main/state_machine.c @@ -61,14 +61,14 @@ esp_err_t state_machine_set(viewport_run_state_t target) if (target == VIEWPORT_STATE_AWAKE) { if (display_is_up()) { display_wake(); - // Content choice: configured devices show "Loading…" until - // Scrypted pushes a /frame; unconfigured devices show the - // info screen since there's no Scrypted to push anything. + // Content choice: a configured device shows "Loading…" until + // Scrypted pushes a /frame; a device with no scrypted URL + // shows the info screen since there's no Scrypted to push. if (configured) local_screens_show_loading(); else local_screens_show_info(); } arm_idle_timer_unlocked(); - ESP_LOGI(TAG, "AWAKE (%s)", configured ? "configured" : "unconfigured"); + ESP_LOGI(TAG, "AWAKE (%s)", configured ? "configured" : "no scrypted URL"); } else { disarm_idle_timer(); if (display_is_up()) display_sleep(); @@ -89,8 +89,8 @@ void state_machine_set_local(viewport_run_state_t target) { esp_err_t err = state_machine_set(target); if (err != ESP_OK) return; - // Only POST when there's a Scrypted to talk to. Unconfigured tap toggles - // change the local display state without notifying anyone. + // Only POST when there's a Scrypted to talk to. Without a scrypted URL, + // tap toggles change the local display state without notifying anyone. viewport_state_lock(); bool configured = viewport_state_get()->configured; viewport_state_unlock(); |
