Skip to content
Merged
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
8 changes: 7 additions & 1 deletion homeassistant/components/braviatv/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ def update(self):
self._channel_name = playing_info.get("title")
self._program_media_type = playing_info.get("programMediaType")
self._channel_number = playing_info.get("dispNum")
self._source = playing_info.get("source")
self._content_uri = playing_info.get("uri")
self._source = self._get_source()
self._duration = playing_info.get("durationSec")
self._start_date_time = playing_info.get("startDateTime")
else:
Expand All @@ -229,6 +229,12 @@ def update(self):
_LOGGER.error(exception_instance)
self._state = STATE_OFF

def _get_source(self):
"""Return the name of the source."""
for key, value in self._content_mapping.items():
if value == self._content_uri:
return key

def _reset_playing_info(self):
self._program_name = None
self._channel_name = None
Expand Down