Skip to content

Commit

Permalink
[BUGFIX] Fix error when no weather entity is configured
Browse files Browse the repository at this point in the history
  • Loading branch information
FamousWolf authored Apr 5, 2024
1 parent 47f4be6 commit dcdb9d7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,16 @@ export class WeekPlannerCard extends LitElement {
${day.weather ?
html`
<div class="weather">
${this._weather.showTemperature || this._weather.showLowTemperature ?
${this._weather?.showTemperature || this._weather?.showLowTemperature ?
html`
<div class="temperature">
${this._weather.showTemperature ?
${this._weather?.showTemperature ?
html`
<span class="high">${day.weather.temperature}</span>
` :
''
}
${this._weather.showLowTemperature ?
${this._weather?.showLowTemperature ?
html`
<span class="low">${day.weather.templow}</span>
` :
Expand All @@ -231,7 +231,7 @@ export class WeekPlannerCard extends LitElement {
` :
''
}
${this._weather.showCondition ?
${this._weather?.showCondition ?
html`
<div class="icon">
<img src="${day.weather.icon}" alt="${day.weather.condition}">
Expand Down Expand Up @@ -416,7 +416,7 @@ export class WeekPlannerCard extends LitElement {
let startDate = this._startDate;
let endDate = this._startDate.plus({ days: this._numberOfDays });

if (this._weatherForecast === null) {
if (this._weather && this._weatherForecast === null) {
this._subscribeToWeatherForecast();
}

Expand Down

0 comments on commit dcdb9d7

Please sign in to comment.