From 8aad75d9535b8dd63079e5baca1742912853d93d Mon Sep 17 00:00:00 2001 From: SukramJ Date: Sun, 17 Nov 2024 11:45:30 +0100 Subject: [PATCH] Do reconnect/reload only for affected interfaces --- changelog.md | 1 + hahomematic/central/__init__.py | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 790be872..02605cea 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # Version 2024.11.2 (2024-11-15) - Add get_data_point_path to central +- Do reconnect/reload only for affected interfaces - Ignore unknown interfaces - Remove clients for not available interfaces diff --git a/hahomematic/central/__init__.py b/hahomematic/central/__init__.py index 203fc7ad..e46f880a 100644 --- a/hahomematic/central/__init__.py +++ b/hahomematic/central/__init__.py @@ -1479,6 +1479,7 @@ async def _check_connection(self) -> None: await self._central.restart_clients() else: reconnects: list[Any] = [] + reloads: list[Any] = [] for interface_id in self._central.interface_ids: # check: # - client is available @@ -1491,10 +1492,15 @@ async def _check_connection(self) -> None: or not client.is_callback_alive() ): reconnects.append(client.reconnect()) + reloads.append( + self._central.load_and_refresh_data_point_data( + interface=client.interface + ) + ) if reconnects: await asyncio.gather(*reconnects) if self._central.available: - await self._central.load_and_refresh_data_point_data() + await asyncio.gather(*reloads) except NoConnectionException as nex: _LOGGER.error("CHECK_CONNECTION failed: no connection: %s", reduce_args(args=nex.args)) except Exception as ex: