diff --git a/src/panels/lovelace/cards/hui-weather-forecast-card.ts b/src/panels/lovelace/cards/hui-weather-forecast-card.ts index aa5d4ff488..ccb852619c 100644 --- a/src/panels/lovelace/cards/hui-weather-forecast-card.ts +++ b/src/panels/lovelace/cards/hui-weather-forecast-card.ts @@ -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, diff --git a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts index ccc286cca5..dc77b57c2a 100644 --- a/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts @@ -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 ||