supersaiyanmode / PyWebOSTV

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

Feature Request - Turn Off Screen #61

Closed benjamin-rousseau-shift closed 2 years ago

benjamin-rousseau-shift commented 3 years ago

Hi there. Thanks for this SDK ! Is there a way to turn off the screen with it , like you can do in 'Energy Saving' Menu where you can just turn the screen black by clicking on 'Screen Off'

Side Request : Do you think it's possible to return the Name you set to the TV ? The 'Device Name' The System Info do not return that.

Thanks !

jurekmroczkowski commented 2 years ago

I came here just to write this feature request. Is it possible? Maybe with some indirect script that would manually press correct buttons?

jurekmroczkowski commented 2 years ago

It's definitely possible given that klattimer supports it:

def screenOff(self):
        self.__send_command("request", "ssap://com.webos.service.tvpower/power/turnOffScreen", {"standbyMode": "active"})
def screenOn(self):
        self.__send_command("request", "ssap://com.webos.service.tvpower/power/turnOnScreen", {"standbyMode": "active"})
supersaiyanmode commented 2 years ago

Hi @jurekmroczkowski, Thank you so much!

I have just created a new PR #68 with the change. Can you folks please test it out?

supersaiyanmode commented 2 years ago

Checking in to see if anyone wants to test the patch out before I merge it with master. Cheers

harlikodasma commented 2 years ago

Checking in to see if anyone wants to test the patch out before I merge it with master. Cheers

Tested it manually, works perfectly fine.

supersaiyanmode commented 2 years ago

Thank you so much! I almost forgot about this PR. Merging this in.

harlikodasma commented 2 years ago

Thank you so much! I almost forgot about this PR. Merging this in.

Could you also update the pip package, please? Thanks!

supersaiyanmode commented 2 years ago

Done. Updated PyPI, the latest version is v0.8.7.