Guard for timeout errors during wled discovery (#64130)

This commit is contained in:
Paulus Schoutsen
2022-01-14 14:32:07 -08:00
committed by GitHub
parent dee843bf6e
commit b0387efee3

View File

@@ -1,6 +1,7 @@
"""Config flow to configure the WLED integration."""
from __future__ import annotations
import asyncio
from typing import Any
import voluptuous as vol
@@ -74,7 +75,7 @@ class WLEDFlowHandler(ConfigFlow, domain=DOMAIN):
self.discovered_host = discovery_info.host
try:
self.discovered_device = await self._async_get_device(discovery_info.host)
except WLEDConnectionError:
except (WLEDConnectionError, asyncio.TimeoutError):
return self.async_abort(reason="cannot_connect")
await self.async_set_unique_id(self.discovered_device.info.mac_address)