From 0f5da18108c3534d00e327471be4e76724c9e0e7 Mon Sep 17 00:00:00 2001 From: Paul Shawn <32349595+topsworld@users.noreply.github.com> Date: Tue, 24 Dec 2024 21:02:36 +0800 Subject: [PATCH] fix: fix unit convert attribute error (#396) --- custom_components/xiaomi_home/miot/miot_device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/xiaomi_home/miot/miot_device.py b/custom_components/xiaomi_home/miot/miot_device.py index 6144d57..103a7c3 100644 --- a/custom_components/xiaomi_home/miot/miot_device.py +++ b/custom_components/xiaomi_home/miot/miot_device.py @@ -628,7 +628,7 @@ def unit_convert(self, spec_unit: str) -> Optional[str]: # pylint: disable=import-outside-toplevel from homeassistant.const import UnitOfConductivity unit_map['μS/cm'] = UnitOfConductivity.MICROSIEMENS_PER_CM - except ImportError: + except Exception: # pylint: disable=broad-except unit_map['μS/cm'] = 'μS/cm' return unit_map.get(spec_unit, None)