Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Thanks to: @dathbe.
- [calendar] Update defaultSymbol name and also the link to the icon search site (#3879)
- [core] Update dependencies including electron to v38 as well as github actions (#3831, #3849, #3857, #3858, #3872, #3876, #3882, #3891)
- [weather] Update feels_like temperature calculation formula (#3869)
- [weather] Update null value handling for weather type (#3892)

### Fixed

Expand Down
6 changes: 4 additions & 2 deletions modules/default/weather/current.njk
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{% endif %}
</div>
{% endif %}
<div class="large">
<div class="large type-temp">
{% if config.showIndoorTemperature and indoor.temperature or config.showIndoorHumidity and indoor.humidity %}
<span class="medium fas fa-home"></span>
<span style="display: inline-block">
Expand All @@ -59,7 +59,9 @@
{% endif %}
</span>
{% endif %}
<span class="light wi weathericon wi-{{ current.weatherType }}"></span>
{% if current.weatherType %}
<span class="light wi weathericon wi-{{ current.weatherType }}"></span>
{% endif %}
<span class="light bright">{{ current.temperature | roundValue | unit("temperature") | decimalSymbol }}</span>
{% if config.showHumidity === "temp" %}
<span class="medium bright">{{ humidity() }}</span>
Expand Down
13 changes: 6 additions & 7 deletions modules/default/weather/weather.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
.weather .weathericon,
.weather .fa-home {
font-size: 75%;
line-height: 65px;
display: inline-block;
transform: translate(0, -3px);
}

.weather .humidity-icon {
Expand Down Expand Up @@ -37,14 +34,16 @@
padding-right: 0;
}

.weather tr .weathericon {
line-height: 25px;
}

.weather tr.colored .min-temp {
color: #bcddff;
}

.weather tr.colored .max-temp {
color: #ff8e99;
}

.weather .type-temp {
display: flex;
align-items: center;
gap: 10px;
}
2 changes: 1 addition & 1 deletion modules/default/weather/weather.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ Module.register("weather", {
this.scheduleUpdate();

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

const notificationPayload = {
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/modules/weather_current_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@ describe("Weather module", () => {

it("should render temperature with icon", async () => {
await expect(weatherFunc.getText(".weather .large span.light.bright", "1.5°")).resolves.toBe(true);

const elem = await helpers.waitForElement(".weather .large span.weathericon");
expect(elem).not.toBeNull();
});

it("should render feels like temperature", async () => {
// Template contains &nbsp; which renders as \xa0
await expect(weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed", "93.7\xa0 Feels like -5.6°")).resolves.toBe(true);
});

it("should render humidity next to feels-like", async () => {
await expect(weatherFunc.getText(".weather .normal.medium.feelslike span.dimmed .humidity", "93.7")).resolves.toBe(true);
});
Expand Down