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