Increase timeout and log the url of the elkm1 system that time… (#34172)

* Log the url of the elkm1 system that times out

* Bump timeout to 120s
This commit is contained in:
J. Nick Koston 2020-04-13 18:16:17 -05:00 committed by Paulus Schoutsen
parent 2d8bb8e6d2
commit 2553b0d1e0
2 changed files with 6 additions and 3 deletions

View File

@ -39,7 +39,7 @@ from .const import (
ELK_ELEMENTS, ELK_ELEMENTS,
) )
SYNC_TIMEOUT = 55 SYNC_TIMEOUT = 120
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -215,7 +215,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
if not await async_wait_for_elk_to_sync(elk, SYNC_TIMEOUT): if not await async_wait_for_elk_to_sync(elk, SYNC_TIMEOUT):
_LOGGER.error( _LOGGER.error(
"Timed out after %d seconds while trying to sync with ElkM1", SYNC_TIMEOUT, "Timed out after %d seconds while trying to sync with ElkM1 at %s",
SYNC_TIMEOUT,
conf[CONF_HOST],
) )
elk.disconnect() elk.disconnect()
raise ConfigEntryNotReady raise ConfigEntryNotReady

View File

@ -64,8 +64,9 @@ async def validate_input(data):
timed_out = False timed_out = False
if not await async_wait_for_elk_to_sync(elk, VALIDATE_TIMEOUT): if not await async_wait_for_elk_to_sync(elk, VALIDATE_TIMEOUT):
_LOGGER.error( _LOGGER.error(
"Timed out after %d seconds while trying to sync with elkm1", "Timed out after %d seconds while trying to sync with ElkM1 at %s",
VALIDATE_TIMEOUT, VALIDATE_TIMEOUT,
url,
) )
timed_out = True timed_out = True