mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +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."""
|
"""Open ports in your router for Home Assistant and provide statistics."""
|
||||||
|
import asyncio
|
||||||
from ipaddress import ip_address
|
from ipaddress import ip_address
|
||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
|
|
||||||
@ -106,7 +107,11 @@ async def async_setup_entry(hass: HomeAssistantType, config_entry: ConfigEntry)
|
|||||||
# discover and construct
|
# discover and construct
|
||||||
udn = config_entry.data.get(CONFIG_ENTRY_UDN)
|
udn = config_entry.data.get(CONFIG_ENTRY_UDN)
|
||||||
st = config_entry.data.get(CONFIG_ENTRY_ST) # pylint: disable=invalid-name
|
st = config_entry.data.get(CONFIG_ENTRY_ST) # pylint: disable=invalid-name
|
||||||
|
try:
|
||||||
device = await async_discover_and_construct(hass, udn, st)
|
device = await async_discover_and_construct(hass, udn, st)
|
||||||
|
except asyncio.TimeoutError:
|
||||||
|
raise ConfigEntryNotReady
|
||||||
|
|
||||||
if not device:
|
if not device:
|
||||||
_LOGGER.info("Unable to create UPnP/IGD, aborting")
|
_LOGGER.info("Unable to create UPnP/IGD, aborting")
|
||||||
raise ConfigEntryNotReady
|
raise ConfigEntryNotReady
|
||||||
|
Loading…
x
Reference in New Issue
Block a user