1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 02:38:53 +00:00

Added tooltip to state badge element (#3137)

This commit is contained in:
Yosi Levy
2019-05-02 21:31:14 +03:00
committed by Paulus Schoutsen
parent 8a86dd8426
commit 8b98f375c2
2 changed files with 6 additions and 1 deletions

View File

@@ -56,7 +56,11 @@ export class HuiStateBadgeElement extends LitElement
<ha-state-label-badge <ha-state-label-badge
.hass="${this.hass}" .hass="${this.hass}"
.state="${stateObj}" .state="${stateObj}"
.title="${computeStateName(stateObj)}" .title="${this._config.title === undefined
? computeStateName(stateObj)
: this._config.title === null
? ""
: this._config.title}"
></ha-state-label-badge> ></ha-state-label-badge>
`; `;
} }

View File

@@ -45,6 +45,7 @@ export interface ServiceButtonElementConfig extends LovelaceElementConfig {
export interface StateBadgeElementConfig extends LovelaceElementConfig { export interface StateBadgeElementConfig extends LovelaceElementConfig {
entity: string; entity: string;
title?: string;
} }
export interface StateIconElementConfig extends LovelaceElementConfig { export interface StateIconElementConfig extends LovelaceElementConfig {