mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 18:56:39 +00:00
Only display current temp when not None (#8316)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
e06642e892
commit
fe3d22d4f8
@ -132,27 +132,30 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
|
|||||||
></round-slider>
|
></round-slider>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const currentTemperature = !isNaN(stateObj.attributes.current_temperature)
|
const currentTemperature = svg`
|
||||||
? svg`
|
<svg viewBox="0 0 40 20">
|
||||||
<svg viewBox="0 0 40 20">
|
<text
|
||||||
<text
|
x="50%"
|
||||||
x="50%"
|
dx="1"
|
||||||
dx="1"
|
y="60%"
|
||||||
y="60%"
|
text-anchor="middle"
|
||||||
text-anchor="middle"
|
style="font-size: 13px;"
|
||||||
style="font-size: 13px;"
|
>
|
||||||
>
|
${
|
||||||
${formatNumber(
|
stateObj.attributes.current_temperature !== null &&
|
||||||
stateObj.attributes.current_temperature,
|
!isNaN(stateObj.attributes.current_temperature)
|
||||||
this.hass!.language
|
? svg`${formatNumber(
|
||||||
)}
|
stateObj.attributes.current_temperature,
|
||||||
<tspan dx="-3" dy="-6.5" style="font-size: 4px;">
|
this.hass!.language
|
||||||
${this.hass.config.unit_system.temperature}
|
)}
|
||||||
</tspan>
|
<tspan dx="-3" dy="-6.5" style="font-size: 4px;">
|
||||||
</text>
|
${this.hass.config.unit_system.temperature}
|
||||||
</svg>
|
</tspan>`
|
||||||
`
|
: ""
|
||||||
: "";
|
}
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
`;
|
||||||
|
|
||||||
const setValues = svg`
|
const setValues = svg`
|
||||||
<svg id="set-values">
|
<svg id="set-values">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user