diff --git a/pylgtv/webos_client.py b/pylgtv/webos_client.py index 69ff373..d41107a 100644 --- a/pylgtv/webos_client.py +++ b/pylgtv/webos_client.py @@ -27,9 +27,6 @@ def __init__(self, ip): self.command_count = 0 self.last_response = None - loop = asyncio.new_event_loop() - asyncio.set_event_loop(loop) - self.load_key_file() @staticmethod @@ -115,7 +112,9 @@ def _register(self): def register(self): """Pair client with tv.""" - asyncio.get_event_loop().run_until_complete(self._register()) + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + loop.run_until_complete(self._register()) @asyncio.coroutine def _command(self, msg): @@ -153,7 +152,9 @@ def command(self, request_type, uri, payload): } self.last_response = None - asyncio.get_event_loop().run_until_complete(self._command(message)) + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + loop.run_until_complete(self._command(message)) def request(self, uri, payload=None): """Send a request.""" diff --git a/setup.py b/setup.py index ac6e75b..a408d6d 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup setup(name='pylgtv', - version='0.1.0', + version='0.1.1', description='Library to control webOS based LG Tv devices', url='https://github.com/TheRealLink/pylgtv', author='Dennis Karpienski',