mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-04-03 08:15:30 +08:00
fix: fix unit convert attribute error (#396)
This commit is contained in:
parent
ea9aa082b7
commit
0f5da18108
@ -628,7 +628,7 @@ class MIoTDevice:
|
|||||||
# pylint: disable=import-outside-toplevel
|
# pylint: disable=import-outside-toplevel
|
||||||
from homeassistant.const import UnitOfConductivity
|
from homeassistant.const import UnitOfConductivity
|
||||||
unit_map['μS/cm'] = UnitOfConductivity.MICROSIEMENS_PER_CM
|
unit_map['μS/cm'] = UnitOfConductivity.MICROSIEMENS_PER_CM
|
||||||
except ImportError:
|
except Exception: # pylint: disable=broad-except
|
||||||
unit_map['μS/cm'] = 'μS/cm'
|
unit_map['μS/cm'] = 'μS/cm'
|
||||||
|
|
||||||
return unit_map.get(spec_unit, None)
|
return unit_map.get(spec_unit, None)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user