From 6d909d24e9125bb98861f920f2b054b83dfd762f Mon Sep 17 00:00:00 2001 From: OWL4C <124401812+OWL4C@users.noreply.github.com> Date: Thu, 27 Mar 2025 20:23:17 +0000 Subject: [PATCH] [weather] add humidity to hourly view, fix spacing error when using UV Index, add config option to hide precipitation entries that are zero [Rebased Version of PR #3526] (#3748) Fixed Version of PR #3526 since that was against the wrong branch and had issues. Original PR Text: Basically the title. Just some existing weather data included into hourly, some config option ("hideZeroes") to hide precipitation when it is zero (this actually shrinks the entire table, removing columns that are completely empty), and add a spacing column to fix the UV Index column. --------- Co-authored-by: Veeck --- 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 d1b8077b..ec8349ac 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 @@ -50,6 +52,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 - [workflow] Fix command to run spellcheck ## [2.30.0] - 2025-01-01 diff --git a/modules/default/weather/hourly.njk b/modules/default/weather/hourly.njk index 0e464f77..4223390b 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 (not config.hideZeroes or hour.precipitationAmount>0) %} + + {{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }} + + {% endif %} {% endif %} {% if config.showPrecipitationProbability %} + {% if (not 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 816f0a9b..4618be9f 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 369a7201..448a905c 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", // 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, allowOverrideNotification: false,