From d23fca4dd15b1cf078a466efa2ab9ec569335995 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Tue, 12 Jul 2022 23:13:29 +0200 Subject: [PATCH] Correct display of barometric pressure and rain (#13183) --- src/data/weather.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/data/weather.ts b/src/data/weather.ts index f77da5c9b0..6c2fb20fcb 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -199,13 +199,15 @@ export const getWeatherUnit = ( case "visibility": return stateObj.attributes.visibility_unit || lengthUnit; case "precipitation": - return stateObj.attributes.precipitation_unit || lengthUnit === "km" - ? "mm" - : "in"; + return ( + stateObj.attributes.precipitation_unit || + (lengthUnit === "km" ? "mm" : "in") + ); case "pressure": - return stateObj.attributes.pressure_unit || lengthUnit === "km" - ? "hPa" - : "inHg"; + return ( + stateObj.attributes.pressure_unit || + (lengthUnit === "km" ? "hPa" : "inHg") + ); case "temperature": return ( stateObj.attributes.temperature_unit ||