mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 11:46:42 +00:00
Add 'state' option for secondary entity info on Entities card (#26201)
* add 'state' option for secondary entity info on Entities card * Use formatEntityState instead of computeStateDisplay
This commit is contained in:
parent
a10dbb64f0
commit
ec6666a4ea
@ -73,6 +73,7 @@ export interface EntitiesCardEntityConfig extends EntityConfig {
|
|||||||
| "last-triggered"
|
| "last-triggered"
|
||||||
| "last-updated"
|
| "last-updated"
|
||||||
| "position"
|
| "position"
|
||||||
|
| "state"
|
||||||
| "tilt-position"
|
| "tilt-position"
|
||||||
| "brightness";
|
| "brightness";
|
||||||
action_name?: string;
|
action_name?: string;
|
||||||
|
@ -146,7 +146,11 @@ export class HuiGenericEntityRow extends LitElement {
|
|||||||
100
|
100
|
||||||
)}
|
)}
|
||||||
%`
|
%`
|
||||||
: nothing)}
|
: this.config.secondary_info === "state"
|
||||||
|
? html`${this.hass.formatEntityState(
|
||||||
|
stateObj
|
||||||
|
)}`
|
||||||
|
: nothing)}
|
||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
|
@ -19,6 +19,7 @@ const SECONDARY_INFO_VALUES = {
|
|||||||
"last-updated": {},
|
"last-updated": {},
|
||||||
"last-triggered": { domains: ["automation", "script"] },
|
"last-triggered": { domains: ["automation", "script"] },
|
||||||
position: { domains: ["cover"] },
|
position: { domains: ["cover"] },
|
||||||
|
state: {},
|
||||||
"tilt-position": { domains: ["cover"] },
|
"tilt-position": { domains: ["cover"] },
|
||||||
brightness: { domains: ["light"] },
|
brightness: { domains: ["light"] },
|
||||||
};
|
};
|
||||||
|
@ -7305,7 +7305,8 @@
|
|||||||
"position": "Position",
|
"position": "Position",
|
||||||
"tilt-position": "Tilt position",
|
"tilt-position": "Tilt position",
|
||||||
"brightness": "Brightness",
|
"brightness": "Brightness",
|
||||||
"last-updated": "Last updated"
|
"last-updated": "Last updated",
|
||||||
|
"state": "State"
|
||||||
},
|
},
|
||||||
"entity_row": {
|
"entity_row": {
|
||||||
"divider": "Divider",
|
"divider": "Divider",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user