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:
J. Nick Koston 2023-11-08 18:13:11 -06:00 committed by GitHub
parent 123f14dd6c
commit dc7d817398
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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()