From bf23a63ab0cae7521cfea1f45687e38efbfdc512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Sch=C3=BCssling?= Date: Tue, 23 Apr 2024 20:59:44 +0200 Subject: [PATCH 1/2] Added clause for refused connection on reconnetion --- custom_components/jablotron80/jablotron.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom_components/jablotron80/jablotron.py b/custom_components/jablotron80/jablotron.py index 1180445..259c4cf 100644 --- a/custom_components/jablotron80/jablotron.py +++ b/custom_components/jablotron80/jablotron.py @@ -888,6 +888,8 @@ def connect(self) -> None: except serial.SerialException as ex: if "timed out" in f'{ex}': LOGGER.info('Timeout, retrying') + elif "Connection refused" in f'{ex}': + LOGGER.info('Connection refused by remote host, retrying') else: raise From 18522a8ec94383fb95d50486cd51f077b4f9531e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Sch=C3=BCssling?= Date: Tue, 23 Apr 2024 21:14:33 +0200 Subject: [PATCH 2/2] Added clause for host unreachable --- custom_components/jablotron80/jablotron.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/jablotron80/jablotron.py b/custom_components/jablotron80/jablotron.py index 259c4cf..a4b487d 100644 --- a/custom_components/jablotron80/jablotron.py +++ b/custom_components/jablotron80/jablotron.py @@ -889,7 +889,9 @@ def connect(self) -> None: if "timed out" in f'{ex}': LOGGER.info('Timeout, retrying') elif "Connection refused" in f'{ex}': - LOGGER.info('Connection refused by remote host, retrying') + LOGGER.info('Connection refused by remote serial host, retrying') + elif "unreachable" in f'{ex}': + LOGGER.info('Remote serial host is currently unreachable, retrying') else: raise