Added functionality for setting backlight intensity#80
Added functionality for setting backlight intensity#80Remcodebemco wants to merge 2 commits intosupersaiyanmode:masterfrom
Conversation
|
This PR sounds interesting! I have a few questions, however:
And some requests (so we can have this PR merged):
|
|
I just wanted to chime in and say this works quite well. I implemented it in my own wrapper API that handles and simplifies many LG TV commands, but I did need to make one major change. I had an issue where the initial command to set the backlight would succeed, but subsequent calls would fail. I tracked this down to the def luna_command(*args, **kwargs):
processed_payload = process_payload(cmd_info.get("payload"), *args, **kwargs)
payload = {
"uri": "ssap://system.notifications/createAlert",
"payload": {
"message": " ",
"buttons": [{"label": "", "onClick": cmd_info["uri"], "params": processed_payload}],
"onclose": {"uri": cmd_info["uri"], "params": processed_payload},
"onfail": {"uri": cmd_info["uri"], "params": processed_payload},
},
}
alert_id = original_exec_command(self, "blank", payload)()["alertId"]
payload = {
"uri": "ssap://system.notifications/closeAlert",
"payload": {
"alertId": alert_id
}
}
original_exec_command(self, "blank", payload)() |
https://github.com/bendavid/aiopylgtv found a workaround to access luna URI's that are usually hidden.
I made a script that adds onto, without changing the functionality that is already there. Basically, whever "lunahack.py" is included, it adds on to the "exec_command" function within "WebOSControlBase". Whenever the uri that's given in controls.py contains "luna://" it kicks in, and handles it with the luna hack. Otherwise, it'll behave the same as original.
Feel free to do with this whatever you want, but I think some other people might like this functionality. If this isn't the way to handle pull requests, please tell me; this is my first time ever working with github :'D