Skip to content

Commit 6d909d2

Browse files
OWL4Crejas
andauthored
[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 <[email protected]>
1 parent 2ddb785 commit 6d909d2

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ planned for 2025-04-01
2020
- Mark option `secondsColor` as deprecated in clock module.
2121
- Add Greek translation to Alerts module.
2222
- [newsfeed] Add specific ignoreOlderThan value (override) per feed (#3360)
23+
- [weather] Added option Humidity to hourly View
24+
- [weather] Added option to hide hourly entries that are Zero, hiding the entire column if empty.
2325

2426
### Changed
2527

@@ -50,6 +52,7 @@ planned for 2025-04-01
5052
- [calendar] Fix NewYork event processed on system in Central timezone shows wrong time #3701
5153
- [weather/yr] The Yr weather provider is now able to recover from bad API responses instead of freezing (#3296)
5254
- [compliments] Fix evening events being shown during the day (#3727)
55+
- [weather] Fixed minor spacing issues when using UV Index in Hourly
5356
- [workflow] Fix command to run spellcheck
5457

5558
## [2.30.0] - 2025-01-01

modules/default/weather/hourly.njk

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,25 @@
2121
{% endif %}
2222
</td>
2323
{% endif %}
24+
{% if config.showHumidity != "none" %}
25+
<td class="align-left bright humidity-hourly">
26+
{{ hour.humidity }}
27+
<span class="wi wi-humidity humidity-icon"></span>
28+
</td>
29+
{% endif %}
2430
{% if config.showPrecipitationAmount %}
25-
<td class="align-right bright precipitation-amount">
26-
{{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }}
27-
</td>
31+
{% if (not config.hideZeroes or hour.precipitationAmount>0) %}
32+
<td class="align-right bright precipitation-amount">
33+
{{ hour.precipitationAmount | unit("precip", hour.precipitationUnits) }}
34+
</td>
35+
{% endif %}
2836
{% endif %}
2937
{% if config.showPrecipitationProbability %}
38+
{% if (not config.hideZeroes or hour.precipitationAmount>0) %}
3039
<td class="align-right bright precipitation-prob">
31-
{{ hour.precipitationProbability | unit('precip', '%') }}
40+
{{ hour.precipitationProbability | unit('precip', '%') }}
3241
</td>
42+
{% endif %}
3343
{% endif %}
3444
</tr>
3545
{% set currentStep = currentStep + 1 %}

modules/default/weather/weather.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
.weather .precipitation-amount,
3333
.weather .precipitation-prob,
34+
.weather .humidity-hourly,
3435
.weather .uv-index {
3536
padding-left: 20px;
3637
padding-right: 0;

modules/default/weather/weather.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Module.register("weather", {
1414
updateInterval: 10 * 60 * 1000, // every 10 minutes
1515
animationSpeed: 1000,
1616
showFeelsLike: true,
17-
showHumidity: "none", // this is now a string; see current.njk
17+
showHumidity: "none", // possible options for "current" weather are "none", "wind", "temp", "feelslike" or "below", for "hourly" weather "none" or "true"
18+
hideZeroes: false, // hide zeroes (and empty columns) in hourly, currently only for precipitation
1819
showIndoorHumidity: false,
1920
showIndoorTemperature: false,
2021
allowOverrideNotification: false,

0 commit comments

Comments
 (0)