supersaiyanmode / PyWebOSTV

Python API for controlling LG TVs (Web OS)
MIT License
261 stars 50 forks source link

Request: More Remote Functions #87

Open Wawsax opened 1 year ago

Wawsax commented 1 year ago

Is it possible to add more functionality from the TV remote? I'd really love to have the 'Input' command.

I know there's source selection and I could probably write a source cycle function, but I'd prefer the prompt and choose approach as I'm working with limited buttons on an old bluetooth ATV remote. Great work on the library though, works perfectly and is surprisingly responsive.

Wawsax commented 1 year ago

Well I ended up using Shortcuts and its 'terminal over ssh' stuff to switch inputs by voice command using the SourceControl part of the library. Works better than a button, actually. If nobody else is interested this can be closed.

In case anyone finds it useful, I'm also using this to switch inputs when I don't feel like talking to Siri:

src = SourceControl(client).list_sources()  
if ApplicationControl(client).get_current()[18:] == "1":
    SourceControl(client).set_source(src[1])
elif ApplicationControl(client).get_current()[18:] == "2":
    SourceControl(client).set_source(src[2])
elif ApplicationControl(client).get_current()[18:] == "3":
    SourceControl(client).set_source(src[3])
elif ApplicationControl(client).get_current()[18:] == "4":
    SourceControl(client).set_source(src[0])