mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Add last-updated as a secondaryinfo option to entity rows (#7433)
This commit is contained in:
parent
211ab4eea8
commit
d16daf0fd9
@ -45,6 +45,7 @@ export interface EntitiesCardEntityConfig extends EntityConfig {
|
||||
| "entity-id"
|
||||
| "last-changed"
|
||||
| "last-triggered"
|
||||
| "last-updated"
|
||||
| "position"
|
||||
| "tilt-position"
|
||||
| "brightness";
|
||||
|
@ -97,6 +97,13 @@ class HuiGenericEntityRow extends LitElement {
|
||||
.datetime=${stateObj.last_changed}
|
||||
></ha-relative-time>
|
||||
`
|
||||
: this.config.secondary_info === "last-updated"
|
||||
? html`
|
||||
<ha-relative-time
|
||||
.hass=${this.hass}
|
||||
.datetime=${stateObj.last_updated}
|
||||
></ha-relative-time>
|
||||
`
|
||||
: this.config.secondary_info === "last-triggered"
|
||||
? stateObj.attributes.last_triggered
|
||||
? html`
|
||||
|
@ -31,6 +31,7 @@ import { configElementStyle } from "./config-elements-style";
|
||||
const SecondaryInfoValues: { [key: string]: { domains?: string[] } } = {
|
||||
"entity-id": {},
|
||||
"last-changed": {},
|
||||
"last-updated": {},
|
||||
"last-triggered": { domains: ["automation", "script"] },
|
||||
position: { domains: ["cover"] },
|
||||
"tilt-position": { domains: ["cover"] },
|
||||
|
@ -2452,7 +2452,8 @@
|
||||
"last-triggered": "Last Triggered",
|
||||
"position": "Position",
|
||||
"tilt-position": "Tilt Position",
|
||||
"brightness": "Brightness"
|
||||
"brightness": "Brightness",
|
||||
"last-updated": "Last Updated"
|
||||
},
|
||||
"entity_row": {
|
||||
"divider": "Divider",
|
||||
|
Loading…
x
Reference in New Issue
Block a user