klattimer/LGWebOSRemote

Can't find LGTVClient & getCommands

JackOLeary opened this issue · 10 comments

Hi I'm looking at using this repo to setup a flask server being able to run commands using http requests.

I am able to import LGTVScan from scan.py and it works fine. Although I am struggling to find where LGTVClient and getCommands are located, they are imported into main.py on line 6 as seen below.

from LGTV import LGTVScan, LGTVClient, getCommands.

Thanks in advance for any help!

pip install the package?

Not sure tbh you should be able to build a top the classes. That's kind of what I intended.

Hi, thanks for the quick reply, I want to preface this by saying I'm not too knowledgeable about websockets and am confused about what LGTVClient is and where it comes from.

I have pip installed the package with pip install git+https://github.com/klattimer/LGWebOSRemote
It works great if I run directly from command line, such as lgtv auth 192.168.1.31 MyTV,

Although I am trying to use specific parts such as LGTVScan in the picture below, which works, without using the command line.
image

My issue is If I try to import LGTVClient, it can't find it.
Sorry for the confusion!

Send the code (I'm not typing out a screenshot) and I'll see what you're doing wrong if I have time tomorrow.

Changes are in app.py, there's some updates to requirements.txt for flask related packages.
LGWebOSRemote zip.zip

Sorry for the confusion. I'm basically just confused about below
image

try from lgtv.LGTV import LGTVClient

I think this is because you've pip installed and are trying to modify the source too, but I can't really tell at this point, I'd need to take a longer look.

I've tried a virtual env without installing the package and get the same error, also just cloning the repo and running "python main.py auth", gives the same error:
ImportError: cannot import name 'LGTVClient' from 'LGTV'
or
from lgtv.LGTV import LGTVClient, getCommands
ModuleNotFoundError: No module named 'lgtv'

hmm, this is weird... I'll have to take a look but as I say tomorrow is first opportunity.

Sorry but I'm not able to replicate this, as it seems to be an issue with how your library imports have happened.

I'd suggest spending some time checking out how things are arranged on your filesystem and looking for how the libraries may not be correctly installed, then we can probably work through the bug from there.