Skip to content

Commit

Permalink
Incease tplink setup timeout (home-assistant#103671)
Browse files Browse the repository at this point in the history
It can take longer than 5s to do the first update of the device
especially when the device is overloaded as seen in home-assistant#103668

Wait 10 seconds for the discovery since when the power strips are loaded they cannot respond in time
  • Loading branch information
bdraco authored Nov 9, 2023
1 parent 123f14d commit dc7d817
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/tplink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/components/tplink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ async def _discovery(*args, **kwargs):


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()
Expand Down

0 comments on commit dc7d817

Please sign in to comment.