'Retrieve the latest data.'

@util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS)
def update(self):

    from websockets.exceptions import ConnectionClosed
    try:
        current_input = self._client.get_input()
        if (current_input is not None):
            self._current_source_id = current_input
            if (self._state in (STATE_UNKNOWN, STATE_OFF)):
                self._state = STATE_PLAYING
        else:
            self._state = STATE_OFF
            self._current_source = None
            self._current_source_id = None
        if (self._state is not STATE_OFF):
            self._muted = self._client.get_muted()
            self._volume = self._client.get_volume()
            self._source_list = {}
            self._app_list = {}
            conf_sources = self._customize.get(CONF_SOURCES, [])
            for app in self._client.get_apps():
                self._app_list[app['id']] = app
                if conf_sources:
                    if (app['id'] == self._current_source_id):
                        self._current_source = app['title']
                        self._source_list[app['title']] = app
                    elif ((app['id'] in conf_sources) or any(((word in app['title']) for word in conf_sources)) or any(((word in app['id']) for word in conf_sources))):
                        self._source_list[app['title']] = app
                else:
                    self._current_source = app['title']
                    self._source_list[app['title']] = app
            for source in self._client.get_inputs():
                if conf_sources:
                    if (source['id'] == self._current_source_id):
                        self._source_list[source['label']] = source
                    elif ((source['label'] in conf_sources) or any(((source['label'].find(word) != (-1)) for word in conf_sources))):
                        self._source_list[source['label']] = source
                else:
                    self._source_list[source['label']] = source
    except (OSError, ConnectionClosed, TypeError, asyncio.TimeoutError):
        self._state = STATE_OFF
        self._current_source = None
        self._current_source_id = None
