mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Fix error when trying to log used UPnP device, if multiple found (#19875)
This commit is contained in:
parent
acdf9c7ce2
commit
cc6e70a270
@ -102,8 +102,10 @@ async def async_discover_and_construct(hass, udn=None) -> Device:
|
|||||||
# get the first/any
|
# get the first/any
|
||||||
discovery_info = discovery_infos[0]
|
discovery_info = discovery_infos[0]
|
||||||
if len(discovery_infos) > 1:
|
if len(discovery_infos) > 1:
|
||||||
|
device_name = discovery_info.get(
|
||||||
|
'usn', discovery_info.get('ssdp_description', ''))
|
||||||
_LOGGER.info('Detected multiple UPnP/IGD devices, using: %s',
|
_LOGGER.info('Detected multiple UPnP/IGD devices, using: %s',
|
||||||
discovery_info['igd_name'])
|
device_name)
|
||||||
|
|
||||||
ssdp_description = discovery_info['ssdp_description']
|
ssdp_description = discovery_info['ssdp_description']
|
||||||
return await Device.async_create_device(hass, ssdp_description)
|
return await Device.async_create_device(hass, ssdp_description)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user