From 5b7856dadd5c05cb7d8c2104983b417fd37fac67 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Mon, 30 Nov 2026 10:25:07 +0100 Subject: [PATCH] Use the unit converter directly in google_weather (#195447) --- homeassistant/components/google_weather/weather.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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,