This commit is contained in:
Li Shuzhen
2025-04-29 09:11:17 +08:00
committed by GitHub
parent b0204ad9b7
commit f384034854
3 changed files with 19 additions and 3 deletions

View File

@ -779,8 +779,10 @@ class MIoTDevice:
# pylint: disable=import-outside-toplevel
from homeassistant.const import UnitOfConductivity # type: ignore
unit_map['μS/cm'] = UnitOfConductivity.MICROSIEMENS_PER_CM
unit_map['mWh'] = UnitOfEnergy.MILLIWATT_HOUR
except Exception: # pylint: disable=broad-except
unit_map['μS/cm'] = 'μS/cm'
unit_map['mWh'] = 'mWh'
return unit_map.get(spec_unit, None)