From 390101720d174a6b6aada1c1bb8890e0f8f9a123 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 29 Jul 2021 22:55:26 +0200 Subject: [PATCH] Fix DSMR reconnecting loop without timeout (#53722) --- homeassistant/components/dsmr/sensor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/homeassistant/components/dsmr/sensor.py b/homeassistant/components/dsmr/sensor.py index d5674b34520..5afc229a727 100644 --- a/homeassistant/components/dsmr/sensor.py +++ b/homeassistant/components/dsmr/sensor.py @@ -165,6 +165,9 @@ async def async_setup_entry( LOGGER.exception("Error connecting to DSMR") transport = None protocol = None + + # throttle reconnect attempts + await asyncio.sleep(entry.data[CONF_RECONNECT_INTERVAL]) except CancelledError: if stop_listener: stop_listener() # pylint: disable=not-callable