Add last-updated as a secondaryinfo option to entity rows (#7433)

This commit is contained in:
Ian Richardson 2020-10-22 05:37:51 -05:00 committed by GitHub
parent 211ab4eea8
commit d16daf0fd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 1 deletions

View File

@ -45,6 +45,7 @@ export interface EntitiesCardEntityConfig extends EntityConfig {
| "entity-id"
| "last-changed"
| "last-triggered"
| "last-updated"
| "position"
| "tilt-position"
| "brightness";

View File

@ -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`

View File

@ -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"] },

View File

@ -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",