Skip to content

Commit 1ded254

Browse files
authored
Fix some weather-forecast card editor issues (#26125)
1 parent fc104a7 commit 1ded254

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/panels/lovelace/cards/hui-weather-forecast-card.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,11 @@ class HuiWeatherForecastCard extends LitElement implements LovelaceCard {
464464
if (this._config?.show_forecast !== false) {
465465
rows += 1;
466466
min_rows += 1;
467+
if (this._config?.forecast_type === "daily") {
468+
rows += 1;
469+
}
467470
}
468-
if (this._config?.forecast_type === "daily") {
469-
rows += 1;
470-
}
471+
471472
return {
472473
columns: 12,
473474
rows: rows,

src/panels/lovelace/editor/config-elements/hui-weather-forecast-card-editor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,15 @@ export class HuiWeatherForecastCardEditor
5757

5858
if (
5959
/* cannot show forecast in case it is unavailable on the entity */
60-
(config.show_forecast === true && this._hasForecast === false) ||
60+
(config.show_forecast !== false && this._hasForecast === false) ||
6161
/* cannot hide both weather and forecast, need one of them */
6262
(config.show_current === false && config.show_forecast === false)
6363
) {
6464
/* reset to sane default, show weather, but hide forecast */
6565
fireEvent(this, "config-changed", {
6666
config: { ...config, show_current: true, show_forecast: false },
6767
});
68+
return;
6869
}
6970
if (
7071
!config.forecast_type ||

0 commit comments

Comments
 (0)