From 64df06a0c63cc87a8b5852f015a67acd3cdfa7ac Mon Sep 17 00:00:00 2001
From: aes-alienrip <73251414+aes-alienrip@users.noreply.github.com>
Date: Sun, 23 Jun 2024 00:54:00 +0800
Subject: [PATCH] hotfix current wts / wrain warning shown in daily forecast
icons problem
---
dist/hko-weather-card.js | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dist/hko-weather-card.js b/dist/hko-weather-card.js
index e57394d..e6b16e8 100644
--- a/dist/hko-weather-card.js
+++ b/dist/hko-weather-card.js
@@ -62,7 +62,7 @@ class HKOWeatherCard extends LitElement {
${(daily.date).toLocaleDateString(this.config.locale,{weekday: 'short'})}
${this._hass.states[daily.condition] !== undefined
?
- html`
`
+ html`
`
:
html`
`}
${this.config.old_daily_format
@@ -1486,7 +1486,7 @@ style() {
root.getElementById("fcast-date-" + daily.dayIndex).textContent = `${(daily.date).toLocaleDateString(this.config.locale,{month: 'numeric', day: 'numeric'})}`;
root.getElementById("fcast-weekday-" + daily.dayIndex).textContent = `${(daily.date).toLocaleDateString(this.config.locale,{weekday: 'short'})}`;
if (this._hass.states[daily.condition] !== undefined) {
- root.getElementById("fcast-icon-" + daily.dayIndex).style.backgroundImage = `none, url(${this._hass.hassUrl("/local/community/hko-weather-card/weather_icons/" + (this.config.static_icons ? "static" : "animated") + "/" + this.weatherIcons[this._hass.states[daily.condition].state] + ".svg")})`;
+ root.getElementById("fcast-icon-" + daily.dayIndex).style.backgroundImage = `none, url(${this._hass.hassUrl("/local/community/hko-weather-card/weather_icons/" + (this.config.static_icons ? "static" : "animated") + "/" + this.weatherIcons[this._hass.states[daily.condition].state] + ".svg").replace("-night", "-day").replace("-wraina", "").replace("-wrainr", "").replace("-wrainb", "").replace("-wts", "")})`;
}
root.getElementById("fcast-temphigh-" + daily.dayIndex).textContent = `${this._hass.states[daily.temphigh] !== undefined ? this._hass.states[daily.temphigh].state : "Err"}${this.config.old_daily_format ? "°C" : this.config.tempformat === "highlow" ? "" : "°C"}`;
root.getElementById("fcast-templow-" + daily.dayIndex).textContent = `${this._hass.states[daily.templow] !== undefined ? this._hass.states[daily.templow].state : "Err"}${this.config.old_daily_format ? "°C" : this.config.tempformat === "highlow" ? "°C" : ""}`;