diff --git a/src/data/weather.ts b/src/data/weather.ts index 3fb6dca152..a09385b526 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -178,11 +178,17 @@ export const getWeatherUnit = ( hass: HomeAssistant, measure: string ): string => { + const lengthUnit = hass.config.unit_system.length || ""; switch (measure) { + case "pressure": + return lengthUnit === "km" ? "hPa" : "inHg"; + case "wind_speed": + return `${lengthUnit}/h`; case "visibility": - return hass.config.unit_system.length || ""; + case "length": + return lengthUnit; case "precipitation": - return hass.config.unit_system.accumulated_precipitation || ""; + return lengthUnit === "km" ? "mm" : "in"; case "humidity": case "precipitation_probability": return "%";