Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_picture_mode() method doesn't work #30

Closed
chros73 opened this issue Jun 29, 2021 · 10 comments
Closed

set_picture_mode() method doesn't work #30

chros73 opened this issue Jun 29, 2021 · 10 comments

Comments

@chros73
Copy link

chros73 commented Jun 29, 2021

Hi Josh!

Thanks for adding these new methods!
set_current_picture_mode() works fine here: aiopylgtvcommand 192.168.1.78 set_current_picture_mode expert2
But not set_picture_mode(): aiopylgtvcommand 192.168.1.78 set_picture_mode expert2 hdmi2_pc

Basically, I try to switch to the same preset but into PC mode from non-PC mode. Does it work for you?
Thanks

TV: LG B8, fw 4.10.25, webos 4.1.0-5511

@bendavid
Copy link
Owner

This function cannot actually switch between pc and non-pc mode. What this function call will do is change the picture mode in the pc mode. So if you call that and then manually change hdmi_2 to pc-mode, then you should find that the picture mode has been set to expert2.

I'm not aware of exactly how to automatically change between pc-mode and non-pc mode (but it's likely possible by manipulating other settings through similar api calls)

@chros73
Copy link
Author

chros73 commented Jun 29, 2021

I see, and indeed works like this, thanks.
Let us know if you manage to figure out switching between PC and non-PC mode :)
(set_current_picture_mode is really handy for comparing image: no need for fool around with UI elements, that modifies the image, especially with HDR10/DoVi content, thanks for this!)

@chros73 chros73 closed this as completed Jun 29, 2021
@chros73
Copy link
Author

chros73 commented Jun 29, 2021

1 more question, how can I use set_current_picture_settings() via command line? I tried these but didn't do anything:

aiopylgtvcommand 192.168.1.78 set_current_picture_settings "\"brightness\": \"75\""
aiopylgtvcommand 192.168.1.78 set_current_picture_settings "brightness: 75"
aiopylgtvcommand 192.168.1.78 set_current_picture_settings "{"brightness": "75"}"

@bendavid
Copy link
Owner

I don't think you can do that using the command line.

Everything is possible from a python script :)

@chros73
Copy link
Author

chros73 commented Jun 29, 2021

Yes, you are right, not by default, but it can be achieved by passing dictionary via JSON string (although dunno how to automate this for every argument, maybe checking that argument string starts and ends with { ?)
This would be a nice addition, if it can be done.

And thanks, it works from a script well:

import asyncio
from aiopylgtv import WebOsClient

async def runloop():
    client = await WebOsClient.create('192.168.1.78')
    await client.connect()
    settings={"brightness": "75"}
    await client.set_current_picture_settings(settings)
    await client.disconnect()
asyncio.run(runloop())

@bendavid
Copy link
Owner

For changing pc mode I THINK it would be something like

        uri = "com.webos.settingsservice/setSystemSettings"

        params = {"category": "other", "settings": {"hdmiPcMode": {"hdmi1" : False, "hdmi2": True, "hdmi3" : False, "hdmi4" : False} }}

        await client.luna_request(uri, params)

@chros73
Copy link
Author

chros73 commented Jun 29, 2021

Thanks, but it doesn't seem to do anything (non-PC HDMI2 input is selected).

@bendavid
Copy link
Owner

Yah unfortunately this method of accessing the settings can't return any error messages, so it's a bit difficult to debug.

@chros73
Copy link
Author

chros73 commented Sep 12, 2021

Actually the PC mode trick works! :)
I just added another PR for it, thanks!

@chros73
Copy link
Author

chros73 commented Sep 12, 2021

I updated the PC mode PR to only apply to the selected HDMI input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants