mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
ability to show attribute instead of state in picture-glance (#4958)
This commit is contained in:
parent
3338459139
commit
5dbcd1f726
@ -272,11 +272,17 @@ class HuiPictureGlanceCard extends LitElement implements LovelaceCard {
|
|||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
<div class="state">
|
<div class="state">
|
||||||
${computeStateDisplay(
|
${entityConf.attribute
|
||||||
this.hass!.localize,
|
? html`
|
||||||
stateObj,
|
${entityConf.prefix}${stateObj.attributes[
|
||||||
this.hass!.language
|
entityConf.attribute
|
||||||
)}
|
]}${entityConf.suffix}
|
||||||
|
`
|
||||||
|
: computeStateDisplay(
|
||||||
|
this.hass!.localize,
|
||||||
|
stateObj,
|
||||||
|
this.hass!.language
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
`}
|
`}
|
||||||
</div>
|
</div>
|
||||||
|
@ -97,6 +97,9 @@ export interface ConfigEntity extends EntityConfig {
|
|||||||
|
|
||||||
export interface PictureGlanceEntityConfig extends ConfigEntity {
|
export interface PictureGlanceEntityConfig extends ConfigEntity {
|
||||||
show_state?: boolean;
|
show_state?: boolean;
|
||||||
|
attribute?: string;
|
||||||
|
prefix?: string;
|
||||||
|
suffix?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GlanceConfigEntity extends ConfigEntity {
|
export interface GlanceConfigEntity extends ConfigEntity {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user