From a3c6186cd5c277921739fdd46dfb3ee71669afc9 Mon Sep 17 00:00:00 2001 From: Morg42 <43153739+Morg42@users.noreply.github.com> Date: Wed, 6 May 2026 21:10:28 +0200 Subject: [PATCH] z2m: don't start if mqtt module not loaded --- zigbee2mqtt/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/zigbee2mqtt/__init__.py b/zigbee2mqtt/__init__.py index a14747357..86cadd768 100755 --- a/zigbee2mqtt/__init__.py +++ b/zigbee2mqtt/__init__.py @@ -55,6 +55,8 @@ def __init__(self, sh, **kwargs): # Call init code of parent class (MqttPlugin) super().__init__() + if not self._init_complete: + return # self.logger = logging.getLogger(__name__) @@ -861,6 +863,5 @@ def _item_color_rgb_to_xy(self, item_r, item_g, item_b, item_xy, item_brightness try: item_xy({'x': x, 'y': y}, caller) item_brightness(bright * 254, caller) - except (ValueError, TypeError): - self.logger.warning(f"Error on assigning values {x},{y}, {bright} to items {item_xy} and {item_brightness}") - return + except (ValueError, TypeError) as e: + self.logger.warning(f"Error on assigning values {x},{y}, {bright} to items {item_xy} and {item_brightness}: {e}")