The shiny new TV I bought recently has an irritating "feature" that you can't select the HDMI input by a single remote control command. That means that using my Logitech Harmony do-everything remote, when switching to say HDMI4 to go to one of my set top boxes, I have to send the input command, then half a dozen down presses to make sure it's at the bottom of the inputs list, then an up command (as HDMI4 is one up from the bottom of the list) then an OK. That is scripted on the Harmony (choose "watch Freeview" and it automatically turns on all the right things and does that input selection), but it takes quite a bit of time and is irritating when switching between sources. It also sometimes gets out of sync and doesn't do the right thing.
So, figured out (with a bit of help from Mr Google) that you can directly choose an input on the TV by sending a command over ADB (Android Debug Bridge) to it - it's an AndroidTV. So, enable developer options on the TV and turn on ADB. Add the AndroidTV integration to my Home Assistant box. Figure out the incantation to send the right ADB command.
Add an emulated Roku box to Home Assistant - it pretends to be a Roku set top box and is visible to the Harmony remote control over Wifi, but routes key presses to Home Assistant as events, which you can use to trigger actions - like sending ADB commands out to the TV over ethernet! Add a bunch of automations into Home Assistant to receive each key press and convert to an ADB command for the relevant TV input.
Reprogram the Harmony remote so that when I want to watch each device it sends the relevant key press to the virtual Roku which Home Assistant converts to the correct HDMI ADB command using the automation scripts and flips the TV input.
And I now get instant input switching!
Easy - can't think why I didn't try this before
And there's a special part of hell reserved for TV designers who removed functionality like this (apparently you used to be able to do it directly a few firmware updates prior to me buying my set) - that place is right next to the car designers who put service part access (like bulb replacement) in places that aren't accessible once the car is built and off the assembly line.