From af52b91799e37bc21fe542c07912984cca066e93 Mon Sep 17 00:00:00 2001 From: Kevin G Date: Wed, 2 Jun 2021 11:43:56 -0400 Subject: [PATCH] Fix to precipitation logic Found a really dumb error I made that broke compatibility with OpenWeatherMap hourly forecast under certain conditions. This is now fixed. --- modules/default/weather/hourly.njk | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/default/weather/hourly.njk b/modules/default/weather/hourly.njk index 38832bdb..90d0d161 100644 --- a/modules/default/weather/hourly.njk +++ b/modules/default/weather/hourly.njk @@ -11,13 +11,15 @@ {{ hour.temperature | roundValue | unit("temperature") }} {% if config.showPrecipitationAmount %} - - {{ hour.precipitation }}{{ hour.precipitationUnits }} - - {% else %} - - {{ hour.precipitation | unit("precip") }} - + {% if hour.precipitationUnits %} + + {{ hour.precipitation }}{{ hour.precipitationUnits }} + + {% else %} + + {{ hour.precipitation | unit("precip") }} + + {% endif %} {% endif %} {% set currentStep = currentStep + 1 %}