mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 02:36:37 +00:00
Add show_name to state label badge (#17603)
This commit is contained in:
parent
ee8997fbd2
commit
d50a130345
@ -62,6 +62,8 @@ export class HaStateLabelBadge extends LitElement {
|
|||||||
|
|
||||||
@property() public image?: string;
|
@property() public image?: string;
|
||||||
|
|
||||||
|
@property() public showName?: boolean;
|
||||||
|
|
||||||
@state() private _timerTimeRemaining?: number;
|
@state() private _timerTimeRemaining?: number;
|
||||||
|
|
||||||
private _connected?: boolean;
|
private _connected?: boolean;
|
||||||
@ -132,7 +134,9 @@ export class HaStateLabelBadge extends LitElement {
|
|||||||
entityState,
|
entityState,
|
||||||
this._timerTimeRemaining
|
this._timerTimeRemaining
|
||||||
)}
|
)}
|
||||||
.description=${this.name ?? computeStateName(entityState)}
|
.description=${this.showName === false
|
||||||
|
? undefined
|
||||||
|
: this.name ?? computeStateName(entityState)}
|
||||||
>
|
>
|
||||||
${!image && showIcon
|
${!image && showIcon
|
||||||
? html`<ha-state-icon
|
? html`<ha-state-icon
|
||||||
|
@ -34,6 +34,7 @@ export class HuiStateLabelBadge extends LitElement implements LovelaceBadge {
|
|||||||
.name=${this._config.name}
|
.name=${this._config.name}
|
||||||
.icon=${this._config.icon}
|
.icon=${this._config.icon}
|
||||||
.image=${this._config.image}
|
.image=${this._config.image}
|
||||||
|
.showName=${this._config.show_name}
|
||||||
@action=${this._handleAction}
|
@action=${this._handleAction}
|
||||||
.actionHandler=${actionHandler({
|
.actionHandler=${actionHandler({
|
||||||
hasHold: hasAction(this._config!.hold_action),
|
hasHold: hasAction(this._config!.hold_action),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user