forked from home-assistant/core
Show device_id in HomeKit when the device registry entry is missing a name (#55391)
- Reported at: https://community.home-assistant.io/t/homekit-unknown-error-occurred/333385
This commit is contained in:
committed by
Paulus Schoutsen
parent
4b7803ed03
commit
69d8f94e3b
@@ -498,7 +498,10 @@ async def _async_get_supported_devices(hass):
|
|||||||
"""Return all supported devices."""
|
"""Return all supported devices."""
|
||||||
results = await device_automation.async_get_device_automations(hass, "trigger")
|
results = await device_automation.async_get_device_automations(hass, "trigger")
|
||||||
dev_reg = device_registry.async_get(hass)
|
dev_reg = device_registry.async_get(hass)
|
||||||
unsorted = {device_id: dev_reg.async_get(device_id).name for device_id in results}
|
unsorted = {
|
||||||
|
device_id: dev_reg.async_get(device_id).name or device_id
|
||||||
|
for device_id in results
|
||||||
|
}
|
||||||
return dict(sorted(unsorted.items(), key=lambda item: item[1]))
|
return dict(sorted(unsorted.items(), key=lambda item: item[1]))
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user