'Update TV info.'

def update(self):

    if (not self._braviarc.is_connected()):
        if (self._braviarc.get_power_status() != 'off'):
            self._braviarc.connect(self._pin, CLIENTID_PREFIX, NICKNAME)
        if (not self._braviarc.is_connected()):
            return
    try:
        if (self._state == STATE_ON):
            self._refresh_volume()
            self._refresh_channels()
        power_status = self._braviarc.get_power_status()
        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 (not playing_info)):
                self._channel_name = 'App'
            else:
                self._program_name = playing_info.get('programTitle')
                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._duration = playing_info.get('durationSec')
                self._start_date_time = playing_info.get('startDateTime')
        else:
            self._state = STATE_OFF
    except Exception as exception_instance:
        _LOGGER.error(exception_instance)
        self._state = STATE_OFF
