mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 02:07:09 +00:00
Adding information about current TV channel to WebOS media player (#11339)
* Added Channel attribute to webos media pplayer * webostv: Current TV channel display as media_title * Added displaying information about the current TV channel for WebOS platform * Fixed PEP8 requirements
This commit is contained in:
parent
730e0a0094
commit
a3e36e6c66
@ -174,6 +174,7 @@ class LgWebOSDevice(MediaPlayerDevice):
|
|||||||
self._state = STATE_UNKNOWN
|
self._state = STATE_UNKNOWN
|
||||||
self._source_list = {}
|
self._source_list = {}
|
||||||
self._app_list = {}
|
self._app_list = {}
|
||||||
|
self._channel = None
|
||||||
|
|
||||||
@util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
|
@util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
|
||||||
def update(self):
|
def update(self):
|
||||||
@ -189,10 +190,12 @@ class LgWebOSDevice(MediaPlayerDevice):
|
|||||||
self._state = STATE_OFF
|
self._state = STATE_OFF
|
||||||
self._current_source = None
|
self._current_source = None
|
||||||
self._current_source_id = None
|
self._current_source_id = None
|
||||||
|
self._channel = None
|
||||||
|
|
||||||
if self._state is not STATE_OFF:
|
if self._state is not STATE_OFF:
|
||||||
self._muted = self._client.get_muted()
|
self._muted = self._client.get_muted()
|
||||||
self._volume = self._client.get_volume()
|
self._volume = self._client.get_volume()
|
||||||
|
self._channel = self._client.get_current_channel()
|
||||||
|
|
||||||
self._source_list = {}
|
self._source_list = {}
|
||||||
self._app_list = {}
|
self._app_list = {}
|
||||||
@ -225,6 +228,7 @@ class LgWebOSDevice(MediaPlayerDevice):
|
|||||||
self._state = STATE_OFF
|
self._state = STATE_OFF
|
||||||
self._current_source = None
|
self._current_source = None
|
||||||
self._current_source_id = None
|
self._current_source_id = None
|
||||||
|
self._channel = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -261,6 +265,14 @@ class LgWebOSDevice(MediaPlayerDevice):
|
|||||||
"""Content type of current playing media."""
|
"""Content type of current playing media."""
|
||||||
return MEDIA_TYPE_CHANNEL
|
return MEDIA_TYPE_CHANNEL
|
||||||
|
|
||||||
|
@property
|
||||||
|
def media_title(self):
|
||||||
|
"""Title of current playing media."""
|
||||||
|
if (self._channel is not None) and ('channelName' in self._channel):
|
||||||
|
return self._channel['channelName']
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def media_image_url(self):
|
def media_image_url(self):
|
||||||
"""Image url of current playing media."""
|
"""Image url of current playing media."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user