Add secondary-info: last-triggered (#4222)

* Add secondary-info: last-triggered

add last-triggered to the currently available options 'entity-id' and 'last-changed' see:https://www.home-assistant.io/lovelace/entities/#secondary_info

* corrected omission 'attributes'

* added test for attributes.last_triggered

* Update hui-generic-entity-row.ts

* Update hui-generic-entity-row.ts
This commit is contained in:
Marius 2019-11-23 21:19:26 +01:00 committed by Bram Kragten
parent 70a920af3c
commit 81588469b8

View File

@ -105,6 +105,14 @@ class HuiGenericEntityRow extends LitElement {
.datetime=${stateObj.last_changed}
></ha-relative-time>
`
: this.config.secondary_info === "last-triggered" &&
stateObj.attributes.last_triggered
? html`
<ha-relative-time
.hass=${this.hass}
.datetime=${stateObj.attributes.last_triggered}
></ha-relative-time>
`
: ""}
</div>
</div>