external python files (LG WebOS TV via lan)

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
V_J
Experienced User
Posts: 165
Joined: Tue Mar 04, 2014 9:00 am

external python files (LG WebOS TV via lan)

Post by V_J » Sun Dec 17, 2017 7:49 pm

Hello,

I'm trying to control my LG TV (WebOS) using Eventghost. I've found some threads on EventGhost control of LG TV's, e.g. here, but they relate to older pre-WebOS LG TV's and the standard changed. The script finds the TV but the TV shows no connection dialog so the pairing fails.

I've found Python code that should allow control of a WebOS based TV, here on github, and am wondering how to use it. It requires the ws4py, which works with Python 2.7 and up.

Basically, how do I import external .py files in a script or plugin? I need the ws4py, but don't know if I should install it in the EventGhost folder or somewhere else. And then it would be great if it were directly possible to use the python code from github, so an lg plugin could directly use those commands. So, any thoughts?

Thanks,

Jörg

User avatar
kgschlosser
Site Admin
Posts: 5146
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: external python files (LG WebOS TV via lan)

Post by kgschlosser » Mon Dec 18, 2017 2:24 am

I am on my way home now. I will take a look when I get home
If you like the work I have been doing then feel free to Image

V_J
Experienced User
Posts: 165
Joined: Tue Mar 04, 2014 9:00 am

Re: external python files (LG WebOS TV via lan)

Post by V_J » Mon Dec 18, 2017 7:33 am

Nothing urgent... Mainly just wondering if you can import an python file in a script... and if so, where do you put it that it will be found. But I'll soon on for Christmas holidays, so it really is nothing urgent. :)

User avatar
kgschlosser
Site Admin
Posts: 5146
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: external python files (LG WebOS TV via lan)

Post by kgschlosser » Mon Dec 18, 2017 4:43 pm

if you are using EG 0.5 then you would put the library right into you lib27\site-packages folder and then you can simply do an import libraryname
If you like the work I have been doing then feel free to Image

V_J
Experienced User
Posts: 165
Joined: Tue Mar 04, 2014 9:00 am

Re: external python files (LG WebOS TV via lan)

Post by V_J » Tue Dec 19, 2017 8:34 am

Thanks!
I will need to check a few more things, but hopefully I can manage to control an LG WebOS tv... :)
(of course I'll post back)

Happy holidays! (I'm not sure I'll be back before the new year)

Post Reply