From 2ba1ba9e7add25bdf6f77041a50f7b9f2932bce3 Mon Sep 17 00:00:00 2001 From: mdeweerd Date: Thu, 1 Aug 2024 18:01:00 +0200 Subject: [PATCH] Add more specific exception: ImportError --- custom_components/zha_toolkit/__init__.py | 4 ++-- custom_components/zha_toolkit/utils.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/custom_components/zha_toolkit/__init__.py b/custom_components/zha_toolkit/__init__.py index 9170042..96121bd 100644 --- a/custom_components/zha_toolkit/__init__.py +++ b/custom_components/zha_toolkit/__init__.py @@ -7,9 +7,9 @@ try: from homeassistant.components.zha import Gateway as ZHAGateway -except: +except ImportError: from homeassistant.components.zha.core.gateway import ZHAGateway - + from homeassistant.util import dt as dt_util from zigpy import types as t from zigpy.exceptions import DeliveryError diff --git a/custom_components/zha_toolkit/utils.py b/custom_components/zha_toolkit/utils.py index 48e6877..e897df6 100644 --- a/custom_components/zha_toolkit/utils.py +++ b/custom_components/zha_toolkit/utils.py @@ -13,7 +13,7 @@ try: from homeassistant.components.zha import Gateway as ZHAGateway -except: +except ImportError: from homeassistant.components.zha.core.gateway import ZHAGateway from homeassistant.util import dt as dt_util