Add name to config (#2128)

This commit is contained in:
Zack Arnett 2018-11-27 14:26:56 -05:00 committed by Paulus Schoutsen
parent f04f58ac88
commit d2741af24b

View File

@ -47,6 +47,7 @@ const modeIcons = {
interface Config extends LovelaceCardConfig { interface Config extends LovelaceCardConfig {
entity: string; entity: string;
theme?: string; theme?: string;
name?: string;
} }
function formatTemp(temps: string[]): string { function formatTemp(temps: string[]): string {
@ -97,7 +98,8 @@ export class HuiThermostatCard extends hassLocalizeLitMixin(LitElement)
<div id="root"> <div id="root">
<div id="thermostat"></div> <div id="thermostat"></div>
<div id="tooltip"> <div id="tooltip">
<div class="title">${computeStateName(stateObj)}</div> <div class="title">${this._config.name ||
computeStateName(stateObj)}</div>
<div class="current-temperature"> <div class="current-temperature">
<span class="current-temperature-text"> <span class="current-temperature-text">
${stateObj.attributes.current_temperature} ${stateObj.attributes.current_temperature}