mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix ha-state-badge name in picture element card (#19703)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
3c744c09f1
commit
d1592bf262
@ -133,9 +133,9 @@ export class HaStateLabelBadge extends LitElement {
|
|||||||
entityState,
|
entityState,
|
||||||
this._timerTimeRemaining
|
this._timerTimeRemaining
|
||||||
)}
|
)}
|
||||||
.description=${this.showName === false
|
.description=${this.showName
|
||||||
? undefined
|
? this.name ?? computeStateName(entityState)
|
||||||
: this.name ?? computeStateName(entityState)}
|
: undefined}
|
||||||
>
|
>
|
||||||
${!image && showIcon
|
${!image && showIcon
|
||||||
? html`<ha-state-icon
|
? html`<ha-state-icon
|
||||||
|
@ -34,7 +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}
|
.showName=${this._config.show_name ?? true}
|
||||||
@action=${this._handleAction}
|
@action=${this._handleAction}
|
||||||
.actionHandler=${actionHandler({
|
.actionHandler=${actionHandler({
|
||||||
hasHold: hasAction(this._config!.hold_action),
|
hasHold: hasAction(this._config!.hold_action),
|
||||||
|
@ -17,6 +17,7 @@ export interface StateLabelBadgeConfig extends LovelaceBadgeConfig {
|
|||||||
name?: string;
|
name?: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
image?: string;
|
image?: string;
|
||||||
|
show_name?: boolean;
|
||||||
tap_action?: ActionConfig;
|
tap_action?: ActionConfig;
|
||||||
hold_action?: ActionConfig;
|
hold_action?: ActionConfig;
|
||||||
double_tap_action?: ActionConfig;
|
double_tap_action?: ActionConfig;
|
||||||
|
@ -58,6 +58,7 @@ export class HuiStateBadgeElement
|
|||||||
: this._config.title === null
|
: this._config.title === null
|
||||||
? ""
|
? ""
|
||||||
: this._config.title}
|
: this._config.title}
|
||||||
|
showName
|
||||||
@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