pylgtv icon indicating copy to clipboard operation
pylgtv copied to clipboard

Problem & Fix Pairing TV

Open pvangorp opened this issue 7 years ago • 2 comments

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

pvangorp avatar Aug 07 '17 09:08 pvangorp

Work for me

Thank you pvangorp

Qlinkwisp avatar Nov 21 '17 16:11 Qlinkwisp

Assuming you mean at the end of the init method in WebOSClient. If that's the case, then know a couple of things:

  1. 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.
  2. save_key_file() is called at the end of the register() method chain and so isn't needed.
  3. 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()

jheiselman avatar Jun 11 '18 15:06 jheiselman