mirror of
https://github.com/home-assistant/core
synced 2024-10-01 05:30:36 +02:00
Incease tplink setup timeout (#103671)
It can take longer than 5s to do the first update of the device especially when the device is overloaded as seen in #103668 Wait 10 seconds for the discovery since when the power strips are loaded they cannot respond in time
This commit is contained in:
parent
123f14dd6c
commit
dc7d817398
@ -87,7 +87,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
"""Set up TPLink from a config entry."""
|
||||
host = entry.data[CONF_HOST]
|
||||
try:
|
||||
device: SmartDevice = await Discover.discover_single(host)
|
||||
device: SmartDevice = await Discover.discover_single(host, timeout=10)
|
||||
except SmartDeviceException as ex:
|
||||
raise ConfigEntryNotReady from ex
|
||||
|
||||
|
@ -202,7 +202,7 @@ def _patch_discovery(device=None, no_device=False):
|
||||
|
||||
|
||||
def _patch_single_discovery(device=None, no_device=False):
|
||||
async def _discover_single(*_):
|
||||
async def _discover_single(*args, **kwargs):
|
||||
if no_device:
|
||||
raise SmartDeviceException
|
||||
return device if device else _mocked_bulb()
|
||||
|
Loading…
Reference in New Issue
Block a user