From d0c5bfa8497855304a9bb8ad4a952103804d460d Mon Sep 17 00:00:00 2001 From: Christian Lackas Date: Tue, 28 Apr 2026 22:29:59 +0200 Subject: [PATCH 1/2] fix: catch all exceptions during Zigbee device enrichment GATEWAY_OFFLINE (PyViCareDeviceCommunicationError) was not caught, crashing client initialization when a RoomControl device is offline. Enrichment is best-effort and should never prevent startup. --- PyViCare/PyViCare.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PyViCare/PyViCare.py b/PyViCare/PyViCare.py index ec41d5df..95c871b0 100644 --- a/PyViCare/PyViCare.py +++ b/PyViCare/PyViCare.py @@ -8,7 +8,7 @@ from PyViCare.PyViCareOAuthManager import ViCareOAuthManager from PyViCare.PyViCareRoomControl import RoomControl from PyViCare.PyViCareService import ViCareDeviceAccessor, ViCareService -from PyViCare.PyViCareUtils import PyViCareInvalidDataError, PyViCareNotSupportedFeatureError +from PyViCare.PyViCareUtils import PyViCareInvalidDataError logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) @@ -86,7 +86,7 @@ def __enrichZigbeeDevices(self): room_control = RoomControl(device_config.service) try: actor_map = room_control.buildActorRoomMap() - except (KeyError, IndexError, PyViCareNotSupportedFeatureError): + except Exception: logger.debug("Could not build actor map for %s", device_config.getModel(), exc_info=True) continue From 2396b0a1d43066b774094fdbc026d67b67e089e0 Mon Sep 17 00:00:00 2001 From: Christian Lackas Date: Tue, 28 Apr 2026 23:08:10 +0200 Subject: [PATCH 2/2] fix: suppress pylint broad-exception-caught for enrichment --- PyViCare/PyViCare.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyViCare/PyViCare.py b/PyViCare/PyViCare.py index 95c871b0..b408eea8 100644 --- a/PyViCare/PyViCare.py +++ b/PyViCare/PyViCare.py @@ -86,7 +86,7 @@ def __enrichZigbeeDevices(self): room_control = RoomControl(device_config.service) try: actor_map = room_control.buildActorRoomMap() - except Exception: + except Exception: # pylint: disable=broad-exception-caught logger.debug("Could not build actor map for %s", device_config.getModel(), exc_info=True) continue