From 8c6387373b47e323577b346ec445437890ca3ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olive=CC=81r=20Falvai?= Date: Fri, 8 Oct 2021 20:37:49 +0200 Subject: [PATCH] Log retries with correct logger --- custom_components/candy/__init__.py | 2 +- custom_components/candy/client/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/candy/__init__.py b/custom_components/candy/__init__.py index 9cdc53e..9f44f0a 100644 --- a/custom_components/candy/__init__.py +++ b/custom_components/candy/__init__.py @@ -30,7 +30,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b async def update_status(): try: - async with async_timeout.timeout(20): + async with async_timeout.timeout(40): status = await client.status_with_retry() _LOGGER.debug("Fetched status: %s", status) return status diff --git a/custom_components/candy/client/__init__.py b/custom_components/candy/client/__init__.py index 05a9d0e..5617265 100644 --- a/custom_components/candy/client/__init__.py +++ b/custom_components/candy/client/__init__.py @@ -20,8 +20,8 @@ def __init__(self, session: ClientSession, device_ip: str, encryption_key: str, self.encryption_key = encryption_key self.use_encryption = use_encryption - @backoff.on_exception(backoff.expo, aiohttp.ClientError, max_tries=10) - @backoff.on_exception(backoff.expo, TimeoutError, max_tries=10) + @backoff.on_exception(backoff.expo, aiohttp.ClientError, max_tries=10, logger=__name__) + @backoff.on_exception(backoff.expo, TimeoutError, max_tries=10, logger=__name__) async def status_with_retry(self) -> Union[WashingMachineStatus, TumbleDryerStatus]: return await self.status()