Reset Bravia playing info to ensure state reflects correctly (#3903)

pull/3884/merge
Lewis Juggins 2016-10-18 07:13:35 +01:00 committed by Paulus Schoutsen
parent 14ef0ca786
commit 09bcd7321a
1 changed files with 11 additions and 0 deletions

View File

@ -236,6 +236,7 @@ class BraviaTVDevice(MediaPlayerDevice):
if power_status == 'active':
self._state = STATE_ON
playing_info = self._braviarc.get_playing_info()
self._reset_playing_info()
if playing_info is None or len(playing_info) == 0:
self._channel_name = 'App'
else:
@ -255,6 +256,16 @@ class BraviaTVDevice(MediaPlayerDevice):
_LOGGER.error(exception_instance)
self._state = STATE_OFF
def _reset_playing_info(self):
self._program_name = None
self._channel_name = None
self._program_media_type = None
self._channel_number = None
self._source = None
self._content_uri = None
self._duration = None
self._start_date_time = None
def _refresh_volume(self):
"""Refresh volume information."""
volume_info = self._braviarc.get_volume_info()