Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions LGTV/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from __future__ import print_function
from inspect import getfullargspec

Expand All @@ -8,10 +7,15 @@
from time import sleep
import logging
import argparse
from .scan import LGTVScan
from .remote import LGTVRemote
from .auth import LGTVAuth
from .cursor import LGTVCursor

PACKAGE_PATH = os.path.abspath(os.path.dirname(__file__))
if PACKAGE_PATH not in sys.path:
sys.path.append(PACKAGE_PATH)

from scan import LGTVScan
from remote import LGTVRemote
from auth import LGTVAuth
from cursor import LGTVCursor


config_paths = [
Expand All @@ -21,6 +25,7 @@
"/opt/venvs/lgtv/config/config.json"
]


def get_commands():
text = 'commands\n'
commands = LGTVRemote.getCommands()
Expand Down Expand Up @@ -192,3 +197,5 @@ def main():

if __name__ == '__main__':
main()


4 changes: 4 additions & 0 deletions LGTV/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from __init__ import main
if __name__ == "__main__":
main()

2 changes: 1 addition & 1 deletion LGTV/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import re
import json

from .payload import hello_data
from payload import hello_data


class LGTVAuth(WebSocketClient):
Expand Down
2 changes: 1 addition & 1 deletion LGTV/cursor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import inspect
from time import sleep

from .remote import LGTVRemote
from remote import LGTVRemote
from ws4py.client.threadedclient import WebSocketClient


Expand Down
2 changes: 1 addition & 1 deletion LGTV/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import os
import logging

from .payload import hello_data
from payload import hello_data


class LGTVRemote(WebSocketClient):
Expand Down
5 changes: 5 additions & 0 deletions build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rem builds console and gui executables stored in the ./dist directory
rem run "python -m pip install pyinstaller" to get pyinstaller

pyinstaller --clean --onefile --noconfirm --paths=.\LGTV --noconsole --name lgtv_gui lgtv.py
pyinstaller --clean --onefile --noconfirm --paths=.\LGTV lgtv.py
4 changes: 4 additions & 0 deletions lgtv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from LGTV import main
if __name__ == "__main__":
main()