From 721179fc21ebb382ac9eafcd85eaaf96973dc77b Mon Sep 17 00:00:00 2001 From: Smitplaza <96470489+Smitplaza@users.noreply.github.com> Date: Sat, 22 Jan 2022 16:41:35 +0100 Subject: [PATCH] Catch the asyncio timout exception too In my HomeAssistant this timout exception is thrown if the device is not available (e.g. during the night) and it will not reconnect otherwise. --- pysaj/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pysaj/__init__.py b/pysaj/__init__.py index 42c6016..1787e2b 100644 --- a/pysaj/__init__.py +++ b/pysaj/__init__.py @@ -223,7 +223,7 @@ async def read(self, sensors): sen.name, sen.value) return True - except (aiohttp.client_exceptions.ClientConnectorError, + except (aiohttp.client_exceptions.ClientConnectorError, asyncio.exceptions.TimeoutError, concurrent.futures._base.TimeoutError): # Connection to inverter not possible. # This can be "normal" - so warning instead of error - as SAJ