mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00: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."""
|
"""Set up TPLink from a config entry."""
|
||||||
host = entry.data[CONF_HOST]
|
host = entry.data[CONF_HOST]
|
||||||
try:
|
try:
|
||||||
device: SmartDevice = await Discover.discover_single(host)
|
device: SmartDevice = await Discover.discover_single(host, timeout=10)
|
||||||
except SmartDeviceException as ex:
|
except SmartDeviceException as ex:
|
||||||
raise ConfigEntryNotReady from 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):
|
def _patch_single_discovery(device=None, no_device=False):
|
||||||
async def _discover_single(*_):
|
async def _discover_single(*args, **kwargs):
|
||||||
if no_device:
|
if no_device:
|
||||||
raise SmartDeviceException
|
raise SmartDeviceException
|
||||||
return device if device else _mocked_bulb()
|
return device if device else _mocked_bulb()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user