Channel up/down for LiveTV and next/previous for other apps (#13829)

This commit is contained in:
stephanerosi 2018-04-12 15:44:56 +02:00 committed by Paulus Schoutsen
parent 9bd29589d5
commit b9306a5e52

View File

@ -35,6 +35,7 @@ CONF_SOURCES = 'sources'
CONF_ON_ACTION = 'turn_on_action'
DEFAULT_NAME = 'LG webOS Smart TV'
LIVETV_APP_ID = 'com.webos.app.livetv'
WEBOSTV_CONFIG_FILE = 'webostv.conf'
@ -357,8 +358,16 @@ class LgWebOSDevice(MediaPlayerDevice):
def media_next_track(self):
"""Send next track command."""
self._client.channel_up()
current_input = self._client.get_input()
if current_input == LIVETV_APP_ID:
self._client.channel_up()
else:
self._client.fast_forward()
def media_previous_track(self):
"""Send the previous track command."""
self._client.channel_down()
current_input = self._client.get_input()
if current_input == LIVETV_APP_ID:
self._client.channel_down()
else:
self._client.rewind()