mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
Fix missing default reconnect interval in dsmr (#53760)
This commit is contained in:
parent
bb11dc19d3
commit
1012d823a0
@ -157,7 +157,9 @@ async def async_setup_entry(
|
|||||||
update_entities_telegram({})
|
update_entities_telegram({})
|
||||||
|
|
||||||
# throttle reconnect attempts
|
# throttle reconnect attempts
|
||||||
await asyncio.sleep(entry.data[CONF_RECONNECT_INTERVAL])
|
await asyncio.sleep(
|
||||||
|
entry.data.get(CONF_RECONNECT_INTERVAL, DEFAULT_RECONNECT_INTERVAL)
|
||||||
|
)
|
||||||
|
|
||||||
except (serial.serialutil.SerialException, OSError):
|
except (serial.serialutil.SerialException, OSError):
|
||||||
# Log any error while establishing connection and drop to retry
|
# Log any error while establishing connection and drop to retry
|
||||||
@ -167,7 +169,9 @@ async def async_setup_entry(
|
|||||||
protocol = None
|
protocol = None
|
||||||
|
|
||||||
# throttle reconnect attempts
|
# throttle reconnect attempts
|
||||||
await asyncio.sleep(entry.data[CONF_RECONNECT_INTERVAL])
|
await asyncio.sleep(
|
||||||
|
entry.data.get(CONF_RECONNECT_INTERVAL, DEFAULT_RECONNECT_INTERVAL)
|
||||||
|
)
|
||||||
except CancelledError:
|
except CancelledError:
|
||||||
if stop_listener:
|
if stop_listener:
|
||||||
stop_listener() # pylint: disable=not-callable
|
stop_listener() # pylint: disable=not-callable
|
||||||
|
Loading…
x
Reference in New Issue
Block a user