Skip to content

Commit 644f9d8

Browse files
author
veeck
committed
handle null values for weather type
1 parent 57c9b57 commit 644f9d8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

modules/default/weather/current.njk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@
5959
{% endif %}
6060
</span>
6161
{% endif %}
62-
<span class="light wi weathericon wi-{{ current.weatherType }}"></span>
62+
{% if config.weatherType %}
63+
<span class="light wi weathericon wi-{{ current.weatherType }}"></span>
64+
{% endif %}
6365
<span class="light bright">{{ current.temperature | roundValue | unit("temperature") | decimalSymbol }}</span>
6466
{% if config.showHumidity === "temp" %}
6567
<span class="medium bright">{{ humidity() }}</span>

modules/default/weather/weather.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ Module.register("weather", {
168168
this.scheduleUpdate();
169169

170170
if (this.weatherProvider.currentWeather()) {
171-
this.sendNotification("CURRENTWEATHER_TYPE", { type: this.weatherProvider.currentWeather().weatherType.replace("-", "_") });
171+
this.sendNotification("CURRENTWEATHER_TYPE", { type: this.weatherProvider.currentWeather().weatherType?.replace("-", "_") });
172172
}
173173

174174
const notificationPayload = {

0 commit comments

Comments
 (0)