${weatherStateIcon ||
html`
`}
${computeStateDisplay(
this.hass.localize,
stateObj,
this.hass.locale
)}
${this._config.name || computeStateName(stateObj)}
${formatNumber(
stateObj.attributes.temperature,
this.hass.locale
)} ${getWeatherUnit(this.hass, "temperature")}
${this._config.secondary_info_attribute !== undefined
? html`
${this._config.secondary_info_attribute in
weatherAttrIcons
? html`
`
: this.hass!.localize(
`ui.card.weather.attributes.${this._config.secondary_info_attribute}`
)}
${this._config.secondary_info_attribute === "wind_speed"
? getWind(
this.hass,
stateObj.attributes.wind_speed,
stateObj.attributes.wind_bearing
)
: html`
${formatNumber(
stateObj.attributes[
this._config.secondary_info_attribute
],
this.hass.locale
)}
${getWeatherUnit(
this.hass,
this._config.secondary_info_attribute
)}
`}
`
: getSecondaryWeatherAttribute(this.hass, stateObj)}
${forecast
? html`
${forecast.map(
(item) => html`
${dayNight
? html`
${new Date(item.datetime).toLocaleDateString(
this.hass!.language,
{ weekday: "short" }
)}
${item.daytime === undefined || item.daytime
? this.hass!.localize("ui.card.weather.day")
: this.hass!.localize(
"ui.card.weather.night"
)}
`
: hourly
? html`
${formatTime(
new Date(item.datetime),
this.hass!.locale
)}
`
: html`
${new Date(item.datetime).toLocaleDateString(
this.hass!.language,
{ weekday: "short" }
)}
`}
${item.condition !== undefined && item.condition !== null
? html`
${getWeatherStateIcon(
item.condition,
this,
!(item.daytime || item.daytime === undefined)
)}
`
: ""}
${item.temperature !== undefined &&
item.temperature !== null
? html`
${formatNumber(
item.temperature,
this.hass!.locale
)}°
`
: ""}
${item.templow !== undefined && item.templow !== null
? html`
${formatNumber(item.templow, this.hass!.locale)}°
`
: ""}
`
)}
`
: ""}