From a013039f54ce6ea9b1915f0d7f81a182e94449c6 Mon Sep 17 00:00:00 2001 From: Lukas Satin Date: Sat, 31 Mar 2018 16:28:24 +0200 Subject: [PATCH 1/2] Allow launch Youtube App with startup params of video id. --- pylgtv/webos_client.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pylgtv/webos_client.py b/pylgtv/webos_client.py index ccfb0fc..c20e15c 100644 --- a/pylgtv/webos_client.py +++ b/pylgtv/webos_client.py @@ -231,12 +231,18 @@ def launch_app(self, app): 'id': app }) - def launch_app_with_params(self, app, params): + def launch_app_with_params(self, app, params=None, contentId=None): """Launch an app with parameters.""" - self.request(EP_LAUNCH, { - 'id': app, - 'params': params - }) + if contentId is None: + self.request(EP_LAUNCH, { + 'id': app, + 'params': params + }) + else: + self.request(EP_LAUNCH, { + 'id': app, + 'contentId': contentId + }) def close_app(self, app): """Close the current app.""" From f7831736c9f340e2f56a113e2c4f6ac3766ffeee Mon Sep 17 00:00:00 2001 From: Lukas Satin Date: Fri, 20 Apr 2018 15:03:11 +0200 Subject: [PATCH 2/2] Allow launch Youtube App with startup params of video id. --- pylgtv/webos_client.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pylgtv/webos_client.py b/pylgtv/webos_client.py index c20e15c..8e18209 100644 --- a/pylgtv/webos_client.py +++ b/pylgtv/webos_client.py @@ -231,18 +231,19 @@ def launch_app(self, app): 'id': app }) - def launch_app_with_params(self, app, params=None, contentId=None): + def launch_app_with_params(self, app, params): """Launch an app with parameters.""" - if contentId is None: - self.request(EP_LAUNCH, { - 'id': app, - 'params': params - }) - else: - self.request(EP_LAUNCH, { - 'id': app, - 'contentId': contentId - }) + self.request(EP_LAUNCH, { + 'id': app, + 'params': params + }) + + def launch_app_with_content_id(self, app, contentId): + """Launch an app with contentId.""" + self.request(EP_LAUNCH, { + 'id': app, + 'contentId': contentId + }) def close_app(self, app): """Close the current app."""