Skip to content

Switch to Art Mode when the morning wake lands in TV mode - #8

Merged
brianmuse merged 3 commits into
mainfrom
wake-art-mode
Nov 30, 2026
Merged

brianmuse merged 3 commits into
mainfrom
wake-art-mode

Conversation

@brianmuse

Copy link
Copy Markdown
Owner

Problem

On 2026-11-30 a Frame TV came on in regular TV mode after Art Frames' morning wake, not in Art Mode. Every wake path read "power on, Art Mode off" as "someone is watching TV" and left the TV alone. This happened even when Art Frames' own wake packet had just turned the TV on.

Change

  • The scheduled wake now records whether the TV was off before Art Frames woke it. "Off" means confirmed standby or off, or no answer on two reads 3 s apart. One missed read does not count, so a Wi-Fi blip on a TV someone is watching does not count as off.
  • If a TV that was off comes up in TV mode, Art Frames waits for it to finish starting. It needs 2 TV-mode readings, 10 s apart, within 60 s. It then rechecks power and Art Mode and asks the TV once to switch to Art Mode. It never sends a key.
  • A slow start that still answers with an unclear state now waits inside the same wake. Before, the wake gave up and the retry blamed a viewer.
  • Only the first scheduled try switches. The retry, the room sensor wake, "Turn screen on" and "Turn on now" leave TV mode alone, as before. A person may have just turned the TV on with the remote.
  • New log text: "Wake ended in TV mode at HH:MM…". New Health row: "Last turn-on at HH:MM ended in TV mode, not Art Mode". It tells the owner to press the remote's power button once.

Tests

tests/test_wake_tv_mode.py covers: off, then TV mode, then one switch; someone watching before the wake; unknown state before the wake; one missed read; the boot race; a slow start; the switch failing; and the paths that must not switch. Full suite: 2265 passed, 3 skipped. ruff is clean.

🤖 Generated with Claude Code

brianmuse and others added 3 commits November 30, 2026 12:14
A Frame that Art Frames turned on could come up in TV mode and stay
there. Every wake path read "power on, Art Mode off" as "someone is
watching" and left it, even when Art Frames had just woken it.

Now the wake records the TV's state first. If the TV was in standby,
off or not answering before our wake signal or key, and then reads TV
mode, Art Frames:

1. Reads the state two more times, 10 seconds apart, so a TV that is
   still starting up can reach Art Mode by itself.
2. Rechecks power and Art Mode on one connection, then asks once for
   Art Mode (set_artmode). It never sends another power key.
3. Waits up to 15 seconds for Art Mode, and otherwise logs it and
   leaves the TV.

A TV that was on or in an unknown state before the wake is still left
alone. The presence wake and the scheduled wake share this step. A
wake that ends in TV mode gets its own log line, Health row and
analytics outcome, apart from "a TV programme was in progress", and
the scheduled wake does not retry it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review changes to the TV mode fix:

1. Only the scheduled wake's first try switches a TV that the wake
   turned on in TV mode (wake(switch_tv_mode=True)). The presence
   wake, Turn screen on, Turn on now and the retry leave TV mode alone,
   as before.
2. "Off before the wake" now needs confirmed standby or off, or no
   answer on two reads 3 seconds apart. One missed reply from a TV
   someone watches no longer counts.
3. A TV that was off and still answers with an unclear state after
   the checks gets the same wait for TV mode, not "state-unknown".
4. television.py logs nothing again; the controller keeps its own
   wake text.
5. The Health row gives the time and tells the owner to press the
   remote's power button once to go to Art Mode.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brianmuse
brianmuse merged commit 5edc5b0 into main Nov 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant