diff --git a/homeassistant/components/tomorrowio/sensor.py b/homeassistant/components/tomorrowio/sensor.py index b2179cd60f5..1f3bb74b686 100644 --- a/homeassistant/components/tomorrowio/sensor.py +++ b/homeassistant/components/tomorrowio/sensor.py @@ -39,6 +39,7 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.util import slugify from homeassistant.util.unit_conversion import DistanceConverter, SpeedConverter +from homeassistant.util.unit_system import IMPERIAL_SYSTEM from . import TomorrowioDataUpdateCoordinator, TomorrowioEntity from .const import ( @@ -327,11 +328,9 @@ class BaseTomorrowioSensorEntity(TomorrowioEntity, SensorEntity): ) self._attr_extra_state_attributes = {ATTR_ATTRIBUTION: self.attribution} if self.entity_description.native_unit_of_measurement is None: - self._attr_native_unit_of_measurement = ( - description.unit_metric - if hass.config.units.is_metric - else description.unit_imperial - ) + self._attr_native_unit_of_measurement = description.unit_metric + if hass.config.units is IMPERIAL_SYSTEM: + self._attr_native_unit_of_measurement = description.unit_imperial @property @abstractmethod @@ -359,7 +358,7 @@ class BaseTomorrowioSensorEntity(TomorrowioEntity, SensorEntity): desc.imperial_conversion and desc.unit_imperial is not None and desc.unit_imperial != desc.unit_metric - and not self.hass.config.units.is_metric + and self.hass.config.units is IMPERIAL_SYSTEM ): return handle_conversion(state, desc.imperial_conversion)