Add show_name to state label badge (#17603)

This commit is contained in:
karwosts 2023-08-16 23:56:51 -07:00 committed by GitHub
parent ee8997fbd2
commit d50a130345
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -62,6 +62,8 @@ export class HaStateLabelBadge extends LitElement {
@property() public image?: string;
@property() public showName?: boolean;
@state() private _timerTimeRemaining?: number;
private _connected?: boolean;
@ -132,7 +134,9 @@ export class HaStateLabelBadge extends LitElement {
entityState,
this._timerTimeRemaining
)}
.description=${this.name ?? computeStateName(entityState)}
.description=${this.showName === false
? undefined
: this.name ?? computeStateName(entityState)}
>
${!image && showIcon
? html`<ha-state-icon

View File

@ -34,6 +34,7 @@ export class HuiStateLabelBadge extends LitElement implements LovelaceBadge {
.name=${this._config.name}
.icon=${this._config.icon}
.image=${this._config.image}
.showName=${this._config.show_name}
@action=${this._handleAction}
.actionHandler=${actionHandler({
hasHold: hasAction(this._config!.hold_action),