Compare commits

...
Author SHA1 Message Date
Simon Lamon f92c2fd1e8 Fix getWeatherExtrema when either is 0° 2026-11-05 20:17:55 +00:00
+13 -7
View File
@@ -364,19 +364,25 @@ const getWeatherExtrema = (
if (new Date(fc.datetime).getDate() !== today) {
break;
}
if (!tempHigh || fc.temperature > tempHigh) {
if (tempHigh === undefined || fc.temperature > tempHigh) {
tempHigh =
temperatureFractionDigits === undefined
? fc.temperature
: round(fc.temperature, temperatureFractionDigits);
}
if (fc.templow !== undefined && (!tempLow || fc.templow < tempLow)) {
if (
fc.templow !== undefined &&
(tempLow === undefined || fc.templow < tempLow)
) {
tempLow =
temperatureFractionDigits === undefined
? fc.templow
: round(fc.templow, temperatureFractionDigits);
}
if (!fc.templow && (!tempLow || fc.temperature < tempLow)) {
if (
fc.templow === undefined &&
(tempLow === undefined || fc.temperature < tempLow)
) {
tempLow =
temperatureFractionDigits === undefined
? fc.temperature
@@ -384,19 +390,19 @@ const getWeatherExtrema = (
}
}
if (!tempLow && !tempHigh) {
if (tempLow === undefined && tempHigh === undefined) {
return undefined;
}
return html`
${
tempHigh
tempHigh !== undefined
? formatEntityAttributeValue(stateObj, "temperature", tempHigh)
: ""
}
${tempLow && tempHigh ? " / " : ""}
${tempLow !== undefined && tempHigh !== undefined ? " / " : ""}
${
tempLow
tempLow !== undefined
? formatEntityAttributeValue(stateObj, "temperature", tempLow)
: ""
}