pylgtv
pylgtv copied to clipboard
Problem & Fix Pairing TV
I've got an 55UH850V with LGwebOS 05.30.02 and when I added the component to Hass.io he couldn't connect to the TV, because I didn't get a pair request. So I installed Python on my desktop Windows 10 PC and installed pylgtv. It gave the same issue. When I changed webos_client.py by adding the following code to the bottom off the class WebOsClient
self.load_key_file()
self.register()
self.save_key_file()
Now it gives a pair request and creates the local key file. I don't know if this is the way to fix it but it works for me. Can you commit a fix so it will be fixed in Hass.io, because I can't make file changes in Hass.io
Work for me
Thank you pvangorp
Assuming you mean at the end of the init method in WebOSClient. If that's the case, then know a couple of things:
- This is a library and as such, interactive commands (i.e. register()) should be called by the actual program code that uses this library. The example in the README.md should probably include that.
- save_key_file() is called at the end of the register() method chain and so isn't needed.
- If it were to be implemented in the init() method, then it should probably look more like
self.load_key_file()
if not self.is_registered():
self.register()