From 5273293cd6203ab839d22298cdb7d0c9d9982d6f Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Thu, 27 Jun 2024 18:46:39 +0200 Subject: [PATCH] Add last updated property to tile card state content (#21191) --- src/panels/lovelace/cards/hui-tile-card.ts | 8 ++++++++ .../editor/config-elements/hui-tile-card-editor.ts | 6 ++++++ src/translations/en.json | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/hui-tile-card.ts b/src/panels/lovelace/cards/hui-tile-card.ts index 634b52ca1478..fa8c2cc6d067 100644 --- a/src/panels/lovelace/cards/hui-tile-card.ts +++ b/src/panels/lovelace/cards/hui-tile-card.ts @@ -238,6 +238,14 @@ export class HuiTileCard extends LitElement implements LovelaceCard { > `; } + if (content === "last-updated") { + return html` + + `; + } if (content === "last_triggered") { return html` !HIDDEN_ATTRIBUTES.includes(a)) .map((attribute) => ({ diff --git a/src/translations/en.json b/src/translations/en.json index 822152b2214e..ffd25ca6bba2 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -5987,7 +5987,8 @@ "state_content": "State content", "state_content_options": { "state": "State", - "last-changed": "Last changed" + "last-changed": "Last changed", + "last-updated": "Last updated" } }, "vertical-stack": {