JPersson77 / LGTVCompanion

Power On and Off WebOS LG TVs together with your PC
MIT License
992 stars 40 forks source link

Return current HDMI Port in use and Power on/off status to calling script or app. #127

Closed cmattax closed 1 year ago

cmattax commented 1 year ago

Hi, I have found your application immensely useful since I use my LG C2 for gaming quite a bit. I have written several applications that call LGTVCompanion to change power state and HDMI port before launching a game and then reverting them back after the game is over. I have implemented a system that keeps track of what the last known state of these two items is but, in the case where someone changes the HDMI port or powers n/off the TV using the remote, it sometimes gets out of sync. Would it be possible to implement a "GetCurrentPowerState" and "GetCurrentHDMI"? Thanks.

dechamps commented 1 year ago

For advanced scripting use cases such as yours, you might want to consider using software that is specifically designed for LGTV scripting, such as bscpylgtv which has an extensive command line and Python API.

JPersson77 commented 1 year ago

v2.2.0 was published with the first trial/beta version of scripting support. it is not possible to query the TV for values such as the above yet, but check it out and let me know your thoughts. I'll work on extending the features when/if it sees some user adoption

JPersson77 commented 1 year ago

hi @cmattax v3 builds on the above with additional command line parameters. Querying the TV is not in final implementation yet but check it out maybe

JPersson77 commented 1 year ago

And finally we are here. Check out v3.1.5 which adds a command line interface in LGTVcli.exe to do what you want