mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Catch upnp timeout error (#38794)
This commit is contained in:
parent
1f3b9bc70c
commit
03676693ce
@ -1,4 +1,5 @@
|
||||
"""Open ports in your router for Home Assistant and provide statistics."""
|
||||
import asyncio
|
||||
from ipaddress import ip_address
|
||||
from operator import itemgetter
|
||||
|
||||
@ -106,7 +107,11 @@ async def async_setup_entry(hass: HomeAssistantType, config_entry: ConfigEntry)
|
||||
# discover and construct
|
||||
udn = config_entry.data.get(CONFIG_ENTRY_UDN)
|
||||
st = config_entry.data.get(CONFIG_ENTRY_ST) # pylint: disable=invalid-name
|
||||
device = await async_discover_and_construct(hass, udn, st)
|
||||
try:
|
||||
device = await async_discover_and_construct(hass, udn, st)
|
||||
except asyncio.TimeoutError:
|
||||
raise ConfigEntryNotReady
|
||||
|
||||
if not device:
|
||||
_LOGGER.info("Unable to create UPnP/IGD, aborting")
|
||||
raise ConfigEntryNotReady
|
||||
|
Loading…
x
Reference in New Issue
Block a user