From 0872bf4f69e051e30a21f30922d1a3d7599ff932 Mon Sep 17 00:00:00 2001 From: Feng Wang Date: Sat, 21 Dec 2024 22:11:38 +0800 Subject: [PATCH] ignore broad exception warning --- custom_components/xiaomi_home/miot/miot_lan.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/xiaomi_home/miot/miot_lan.py b/custom_components/xiaomi_home/miot/miot_lan.py index 2e8255a..4db79d5 100644 --- a/custom_components/xiaomi_home/miot/miot_lan.py +++ b/custom_components/xiaomi_home/miot/miot_lan.py @@ -1341,8 +1341,9 @@ class MIoTLan: try: # Scan devices self.ping(if_name=None, target_ip='255.255.255.255') - except Exception: + except Exception as err: # pylint: disable=broad-exception-caught # Ignore any exceptions to avoid blocking the loop + _LOGGER.error('ping device error, %s', err) pass scan_time = self.__get_next_scan_time() self._scan_timer = self._internal_loop.call_later(