From c52324d60a0f3f77282e0dc1af28e1f398c99ef6 Mon Sep 17 00:00:00 2001 From: OWL4C <124401812+OWL4C@users.noreply.github.com> Date: Thu, 20 Mar 2025 21:45:59 +0100 Subject: [PATCH 1/3] Re-did commits from PR #3526 but against clean branch. (Added Humidity to hourly. Fixed spacing for hourly UV. Added option to hide zeroes in hourly precipitation. Added config option documentation to defaults) --- CHANGELOG.md | 3 +++ modules/default/weather/hourly.njk | 18 ++++++++++++++---- modules/default/weather/weather.css | 1 + modules/default/weather/weather.js | 3 ++- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 902f35ba0e..fdb8004e49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ planned for 2025-04-01 - Mark option `secondsColor` as deprecated in clock module. - Add Greek translation to Alerts module. - [newsfeed] Add specific ignoreOlderThan value (override) per feed (#3360) +- [weather] Added option Humidity to hourly View +- [weather] Added option to hide hourly entries that are Zero, hiding the entire column if empty. ### Changed @@ -49,6 +51,7 @@ planned for 2025-04-01 - [calendar] Fix NewYork event processed on system in Central timezone shows wrong time #3701 - [weather/yr] The Yr weather provider is now able to recover from bad API responses instead of freezing (#3296) - [compliments] Fix evening events being shown during the day (#3727) +- [weather] Fixed minor spacing issues when using UV Index in Hourly ## [2.30.0] - 2025-01-01 diff --git a/modules/default/weather/hourly.njk b/modules/default/weather/hourly.njk index 0e464f77e6..2796eddb90 100644 --- a/modules/default/weather/hourly.njk +++ b/modules/default/weather/hourly.njk @@ -21,15 +21,25 @@ {% endif %} {% endif %} + {% if config.showHumidity != "none" %} + + {{ hour.humidity }} + + + {% endif %} {% if config.showPrecipitationAmount %} - - {{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }} - + {% if (!config.hideZeroes or hour.precipitationAmount>0) %} + + {{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }} + + {% endif %} {% endif %} {% if config.showPrecipitationProbability %} + {% if (!config.hideZeroes or hour.precipitationAmount>0) %} - {{ hour.precipitationProbability | unit('precip', '%') }} + {{ hour.precipitationProbability | unit('precip', '%') }} + {% endif %} {% endif %} {% set currentStep = currentStep + 1 %} diff --git a/modules/default/weather/weather.css b/modules/default/weather/weather.css index 816f0a9b74..4618be9f94 100644 --- a/modules/default/weather/weather.css +++ b/modules/default/weather/weather.css @@ -31,6 +31,7 @@ .weather .precipitation-amount, .weather .precipitation-prob, +.weather .humidity-hourly, .weather .uv-index { padding-left: 20px; padding-right: 0; diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 369a720101..b9419907a1 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -14,7 +14,8 @@ Module.register("weather", { updateInterval: 10 * 60 * 1000, // every 10 minutes animationSpeed: 1000, showFeelsLike: true, - showHumidity: "none", // this is now a string; see current.njk + showHumidity: "none", // for current possible options are "none", "wind", "temp", "feelslike" or "below", for hourly "none" or "true" + hideZeroes: false, // hide zeroes (and empty columns) in hourly, currently only for precipitation showIndoorHumidity: false, showIndoorTemperature: false, allowOverrideNotification: false, From e11a2296b8ced99318271a45f2ddb421e5496e86 Mon Sep 17 00:00:00 2001 From: OWL4C <124401812+OWL4C@users.noreply.github.com> Date: Thu, 27 Mar 2025 21:11:46 +0100 Subject: [PATCH 2/3] Update modules/default/weather/weather.js Co-authored-by: Veeck --- modules/default/weather/weather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index b9419907a1..448a905cf9 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -14,7 +14,7 @@ Module.register("weather", { updateInterval: 10 * 60 * 1000, // every 10 minutes animationSpeed: 1000, showFeelsLike: true, - showHumidity: "none", // for current possible options are "none", "wind", "temp", "feelslike" or "below", for hourly "none" or "true" + showHumidity: "none", // possible options for "current" weather are "none", "wind", "temp", "feelslike" or "below", for "hourly" weather "none" or "true" hideZeroes: false, // hide zeroes (and empty columns) in hourly, currently only for precipitation showIndoorHumidity: false, showIndoorTemperature: false, From 26140a1b6ebe3fe80023e988f431966f14d77b53 Mon Sep 17 00:00:00 2001 From: OWL4C <124401812+OWL4C@users.noreply.github.com> Date: Thu, 27 Mar 2025 21:13:18 +0100 Subject: [PATCH 3/3] Update hourly.njk --- modules/default/weather/hourly.njk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/default/weather/hourly.njk b/modules/default/weather/hourly.njk index 2796eddb90..4223390b30 100644 --- a/modules/default/weather/hourly.njk +++ b/modules/default/weather/hourly.njk @@ -28,14 +28,14 @@ {% endif %} {% if config.showPrecipitationAmount %} - {% if (!config.hideZeroes or hour.precipitationAmount>0) %} + {% if (not config.hideZeroes or hour.precipitationAmount>0) %} {{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }} {% endif %} {% endif %} {% if config.showPrecipitationProbability %} - {% if (!config.hideZeroes or hour.precipitationAmount>0) %} + {% if (not config.hideZeroes or hour.precipitationAmount>0) %} {{ hour.precipitationProbability | unit('precip', '%') }}