mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-14 04:36:31 +00:00
Fix device name
This commit is contained in:
parent
41fed656c1
commit
31caed20fa
@ -56,6 +56,9 @@ class AlsaAudio(CoreSysAttributes):
|
|||||||
for dev_id, dev_data in self._hardware.audio_devices.items():
|
for dev_id, dev_data in self._hardware.audio_devices.items():
|
||||||
for chan_id, chan_type in dev_data[ATTR_DEVICES].items():
|
for chan_id, chan_type in dev_data[ATTR_DEVICES].items():
|
||||||
alsa_id = f"{dev_id},{chan_id}"
|
alsa_id = f"{dev_id},{chan_id}"
|
||||||
|
dev_name = dev_data[ATTR_NAME]
|
||||||
|
|
||||||
|
# Lookup type
|
||||||
if chan_type.endswith('playback'):
|
if chan_type.endswith('playback'):
|
||||||
key = ATTR_OUTPUT
|
key = ATTR_OUTPUT
|
||||||
elif chan_type.endswith('capture'):
|
elif chan_type.endswith('capture'):
|
||||||
@ -64,8 +67,10 @@ 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(
|
# Use name from DB or a generic name
|
||||||
alsa_id, f"{dev_data[ATTR_NAME]}: {chan_id}")
|
self._data[key][alsa_id] = database.get(
|
||||||
|
self._machine, {}).get(
|
||||||
|
dev_name, {}).get(alsa_id, f"{dev_name}: {chan_id}")
|
||||||
|
|
||||||
self._cache = current_id
|
self._cache = current_id
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user