diff --git a/homeassistant/components/google_weather/weather.py b/homeassistant/components/google_weather/weather.py index 3b2dfacccc02..4f6b3f12cebd 100644 --- a/homeassistant/components/google_weather/weather.py +++ b/homeassistant/components/google_weather/weather.py @@ -41,8 +41,6 @@ from homeassistant.components.weather import ( ATTR_FORECAST_TIME, ATTR_FORECAST_UV_INDEX, ATTR_FORECAST_WIND_BEARING, - ATTR_WEATHER_PRECIPITATION_UNIT, - UNIT_CONVERSIONS, CoordinatorWeatherEntity, Forecast, WeatherEntityFeature, @@ -61,6 +59,7 @@ from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeassistant.util import dt as dt_util +from homeassistant.util.unit_conversion import DistanceConverter from .const import DOMAIN from .coordinator import ( @@ -385,7 +384,7 @@ class GoogleWeatherEntity( """ if amount is None or amount.quantity is None: return None - return UNIT_CONVERSIONS[ATTR_WEATHER_PRECIPITATION_UNIT]( + return DistanceConverter.convert( amount.quantity, UnitOfPrecipitationDepth.MILLIMETERS, self._precipitation_unit,