mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 23:28:58 +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:
@ -73,6 +73,7 @@ export interface EntitiesCardEntityConfig extends EntityConfig {
|
||||
| "last-triggered"
|
||||
| "last-updated"
|
||||
| "position"
|
||||
| "state"
|
||||
| "tilt-position"
|
||||
| "brightness";
|
||||
action_name?: string;
|
||||
|
@ -146,7 +146,11 @@ export class HuiGenericEntityRow extends LitElement {
|
||||
100
|
||||
)}
|
||||
%`
|
||||
: nothing)}
|
||||
: this.config.secondary_info === "state"
|
||||
? html`${this.hass.formatEntityState(
|
||||
stateObj
|
||||
)}`
|
||||
: nothing)}
|
||||
</div>
|
||||
`
|
||||
: nothing}
|
||||
|
@ -19,6 +19,7 @@ const SECONDARY_INFO_VALUES = {
|
||||
"last-updated": {},
|
||||
"last-triggered": { domains: ["automation", "script"] },
|
||||
position: { domains: ["cover"] },
|
||||
state: {},
|
||||
"tilt-position": { domains: ["cover"] },
|
||||
brightness: { domains: ["light"] },
|
||||
};
|
||||
|
@ -7305,7 +7305,8 @@
|
||||
"position": "Position",
|
||||
"tilt-position": "Tilt position",
|
||||
"brightness": "Brightness",
|
||||
"last-updated": "Last updated"
|
||||
"last-updated": "Last updated",
|
||||
"state": "State"
|
||||
},
|
||||
"entity_row": {
|
||||
"divider": "Divider",
|
||||
|
Reference in New Issue
Block a user