From 7b47f12f48b2a431a2390734ef5f528a68b00d8d Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Fri, 14 Oct 2022 12:53:24 +0200 Subject: [PATCH] Drop use of `is_metric` in ecowitt (#80267) --- homeassistant/components/ecowitt/sensor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/ecowitt/sensor.py b/homeassistant/components/ecowitt/sensor.py index a644cd3ca7a..3139a033289 100644 --- a/homeassistant/components/ecowitt/sensor.py +++ b/homeassistant/components/ecowitt/sensor.py @@ -40,6 +40,7 @@ from homeassistant.const import ( from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import StateType +from homeassistant.util.unit_system import IMPERIAL_SYSTEM, METRIC_SYSTEM from .const import DOMAIN from .entity import EcowittEntity @@ -216,9 +217,9 @@ async def async_setup_entry( return # Ignore metrics that are not supported by the user's locale - if sensor.stype in _METRIC and not hass.config.units.is_metric: + if sensor.stype in _METRIC and hass.config.units is not METRIC_SYSTEM: return - if sensor.stype in _IMPERIAL and hass.config.units.is_metric: + if sensor.stype in _IMPERIAL and hass.config.units is not IMPERIAL_SYSTEM: return mapping = ECOWITT_SENSORS_MAPPING[sensor.stype]