mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Add last updated property to tile card state content (#21191)
This commit is contained in:
parent
49c42fc757
commit
5273293cd6
@ -238,6 +238,14 @@ export class HuiTileCard extends LitElement implements LovelaceCard {
|
||||
></ha-relative-time>
|
||||
`;
|
||||
}
|
||||
if (content === "last-updated") {
|
||||
return html`
|
||||
<ha-relative-time
|
||||
.hass=${this.hass}
|
||||
.datetime=${stateObj.last_updated}
|
||||
></ha-relative-time>
|
||||
`;
|
||||
}
|
||||
if (content === "last_triggered") {
|
||||
return html`
|
||||
<ha-relative-time
|
||||
|
@ -201,6 +201,12 @@ export class HuiTileCardEditor
|
||||
),
|
||||
value: "last-changed",
|
||||
},
|
||||
{
|
||||
label: localize(
|
||||
`ui.panel.lovelace.editor.card.tile.state_content_options.last-updated`
|
||||
),
|
||||
value: "last-updated",
|
||||
},
|
||||
...Object.keys(stateObj?.attributes ?? {})
|
||||
.filter((a) => !HIDDEN_ATTRIBUTES.includes(a))
|
||||
.map((attribute) => ({
|
||||
|
@ -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": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user