Change tile to display "last triggered" in relative time (#20463)

This commit is contained in:
Adam Kapos 2024-04-09 15:11:58 +03:00 committed by GitHub
parent 1e0f7d9629
commit 9903e22eaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -245,6 +245,14 @@ export class HuiTileCard extends LitElement implements LovelaceCard {
></ha-relative-time>
`;
}
if (content === "last_triggered") {
return html`
<ha-relative-time
.hass=${this.hass}
.datetime=${stateObj.attributes.last_triggered}
></ha-relative-time>
`;
}
if (stateObj.attributes[content] == null) {
return undefined;
}