feat(tv): turn the TV on and switch input over the network (Google TV / Android TV) - #93
Draft
nextestudios wants to merge 3 commits into
Draft
nextestudios wants to merge 3 commits into
nextestudios wants to merge 3 commits into
Conversation
… / Android TV) Settings → TV: console mode wakes the TV and switches it to the PC's HDMI input before the display flow, and can put it in standby after the restore. First provider: Google TV / Android TV through ADB (port 5555), with a small in-process ADB client (auth with this PC's RSA key, shell key events), so nothing has to be installed on the PC. Optional Wake-on-LAN for TVs that drop off the network in standby, and a custom input command for TVs that ignore the HDMI key codes. A TV that doesn't answer is only logged. Refs lippdev#75 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First step for #75: console mode turns the TV on and switches it to the PC's HDMI input, and can put it in standby after the restore. This PR adds the plumbing plus the Google TV / Android TV route (TCL, Sony, Hisense, Philips…), which needs no extra hardware and nothing installed on the PC.
ConsoleEngine.StartcallsTvControlService.TurnOnfirst, so the TV is up before the fresh screen read /EnsureActivewait;Stopoptionally callsTurnOffafter the desk is back. Both are bounded (30 s / 15 s) and never throw: a TV that doesn't answer is only logged, and the existing "game screen did not turn on" path does the rest.Services/Tv/AdbClient.cs) on port 5555: CNXN, AUTH with this PC's RSA-2048 key (kept in the data folder asadbkey.pem, so the TV asks "Allow debugging?" once), thenshell:input keyeventWAKEUP →TV_INPUT_HDMI_n(SLEEP for standby). No adb.exe to ship. If the TV is unreachable and a MAC is set, it sends Wake-on-LAN and retries for 20 s. "Wireless debugging" (TLS pairing) is detected and explained instead of hanging.ITvController/TvControlService.Createare the extension point for the other routes in the issue (LG webOS, Home Assistant, USB-CEC), which I'll send as separate PRs on top of this one.AdbProtocol.cs/WakeOnLan.cs(framing, checksum/magic, token signature, Android'sRSAPublicKeylayout withn0inv/rr, endpoint parsing, HDMI key codes, MAC parsing, magic packet), linked into the test project.docs/TESTING.md§3c, changelog under[Unreleased].Validation
TvControlTests(ADB framing and header validation, signature verifies as a SHA-1 digest, public key layout checked against BigInteger math, endpoint/HDMI mapping, MAC parsing, magic packet).dotnet testare left to CI.docs/TESTING.md§3c; to be run on a TCL Google TV.🤖 Generated with Claude Code