Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export class WeekPlannerCard extends LitElement {
showCondition: true,
showTemperature: false,
showLowTemperature: false,
roundTemperature: false,
useTwiceDaily: false,
},
locale: 'en',
Expand Down Expand Up @@ -222,7 +223,8 @@ export class WeekPlannerCard extends LitElement {
entity: null,
showCondition: true,
showTemperature: false,
showLowTemperature: false
showLowTemperature: false,
roundTemperature: false,
};
if (typeof weatherConfiguration === 'string') {
configuration.entity = weatherConfiguration;
Expand Down Expand Up @@ -900,11 +902,13 @@ export class WeekPlannerCard extends LitElement {
}

const dateKey = DateTime.fromISO(forecast.datetime).toISODate();
const temperature = this._weather.roundTemperature ? Math.round(forecast.temperature) : forecast.temperature;
const templow = this._weather.roundTemperature ? Math.round(forecast.templow) : forecast.templow;
weatherForecast[dateKey] = {
icon: this._getWeatherIcon(forecast),
condition: this.hass.formatEntityState(weatherState, forecast.condition),
temperature: this.hass.formatEntityAttributeValue(weatherState, 'temperature', forecast.temperature),
templow: this.hass.formatEntityAttributeValue(weatherState, 'templow', forecast.templow)
temperature: this.hass.formatEntityAttributeValue(weatherState, 'temperature', temperature),
templow: this.hass.formatEntityAttributeValue(weatherState, 'templow', templow)
};
});

Expand Down
1 change: 1 addition & 0 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export class WeekPlannerCardEditor extends LitElement {
${this.addBooleanField('weather.showCondition', 'Show condition icon')}
${this.addBooleanField('weather.showTemperature', 'Show temperature')}
${this.addBooleanField('weather.showLowTemperature', 'Show low temperature')}
${this.addBooleanField('weather.roundTemperature', 'Round temperatures to nearest integer')}
${this.addBooleanField('weather.useTwiceDaily', 'Use twice daily if entity does not support daily')}
`
)}
Expand Down