mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
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:
parent
4aed0b6ccf
commit
43b8353566
@ -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]))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user