This commit is contained in:
Pascal Vizeli 2018-04-13 23:11:20 +02:00
parent ef7a375396
commit 5becd51b50

View File

@ -40,15 +40,15 @@ class AlsaAudio(CoreSysAttributes):
def _update_device(self): def _update_device(self):
"""Update Internal device DB.""" """Update Internal device DB."""
#current_id = hash(frozenset(self._hardware.audio_devices)) current_id = hash(frozenset(self._hardware.audio_devices))
# Need rebuild? # Need rebuild?
#if current_id == self._cache: if current_id == self._cache:
# return return
# Init database # Init database
_LOGGER.info("Update ALSA device list") _LOGGER.info("Update ALSA device list")
database = self._audio_database() #database = self._audio_database()
# Process devices # Process devices
for dev_id, dev_data in self._hardware.audio_devices.items(): for dev_id, dev_data in self._hardware.audio_devices.items():
@ -62,8 +62,8 @@ class AlsaAudio(CoreSysAttributes):
_LOGGER.warning("Unknown channel type: %s", chan_type) _LOGGER.warning("Unknown channel type: %s", chan_type)
continue continue
self._data[key][alsa_id] = database.get(self._machine, {}).get( #self._data[key][alsa_id] = database.get(self._machine, {}).get(
alsa_id, f"{dev_data[ATTR_NAME]}: {chan_id}") # alsa_id, f"{dev_data[ATTR_NAME]}: {chan_id}")
self._cache = current_id self._cache = current_id