controlling my tv from a computer finally works and it took far less magic than i assumed. the debug bridge connection to it was spotty for months and i blamed the setup, but the tv was silently killing the debug daemon whenever it went to standby. the port was closed when it slept and open again the moment it woke. once that mystery was solved the chain is a single trusted connection and then i press the exact same buttons a remote would press, just over the network.
the fun part was proving it end to end without touching anything. took a screenshot to see what was on screen, navigated through a streaming app by walking focus with directional keys and reading the ui tree instead of guessing at pixels, typed a full search into the on screen keyboard, submitted it, picked a source and hit play. the movie opened with its credits rolling and i was honestly a little thrilled that a blind remote session could do that.
the second app hosted the account list, so i opened it and there were the three profiles sitting there. selected mine, went to the home feed and played the first video, then subscriptions and played one from there. every step was verified with a screenshot so nothing happened blind. the tv still drops into standby after about ten minutes of nothing, which is by design and not a bug, and a menu plus home key combination wakes it when the power key will not.
then i researched whether the whole thing can be scripted and it can. both apps I actually use accept direct deep links, a url that jumps straight to a video or a search, turning play this exact episode into one command instead of twenty button presses. wrote a small driver with per app profiles and the lesson that stuck is the ui tree dump beats screenshots for deterministic navigation every single time.