Fix some weather-forecast card editor issues (#26125)

This commit is contained in:
karwosts 2025-07-10 01:27:37 -07:00 committed by GitHub
parent fc104a7992
commit 1ded254e5a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -464,10 +464,11 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {
if (this._config?.show_forecast !== false) {
rows += 1;
min_rows += 1;
if (this._config?.forecast_type === "daily") {
rows += 1;
}
}
if (this._config?.forecast_type === "daily") {
rows += 1;
}
return {
columns: 12,
rows: rows,

View File

@ -57,7 +57,7 @@ export class HuiWeatherForecastCardEditor
if (
/* cannot show forecast in case it is unavailable on the entity */
(config.show_forecast === true && this._hasForecast === false) ||
(config.show_forecast !== false && this._hasForecast === false) ||
/* cannot hide both weather and forecast, need one of them */
(config.show_current === false && config.show_forecast === false)
) {
@ -65,6 +65,7 @@ export class HuiWeatherForecastCardEditor
fireEvent(this, "config-changed", {
config: { ...config, show_current: true, show_forecast: false },
});
return;
}
if (
!config.forecast_type ||