Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/components/entity/state-info.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { html } from "@polymer/polymer/lib/utils/html-tag";
import "@polymer/paper-tooltip/paper-tooltip";
/* eslint-plugin-disable lit */
import { PolymerElement } from "@polymer/polymer/polymer-element";
import { computeStateName } from "../../common/entity/compute_state_name";
Expand Down Expand Up @@ -71,13 +72,20 @@ class StateInfo extends PolymerElement {
<div class="name" in-dialog$="[[inDialog]]">
[[computeStateName(stateObj)]]
</div>

<template is="dom-if" if="[[inDialog]]">
<div class="time-ago">
<ha-relative-time
id="last_changed"
hass="[[hass]]"
datetime="[[stateObj.last_changed]]"
></ha-relative-time>
<paper-tooltip animation-delay="0" for="last_changed">
[[localize('ui.dialogs.more_info_control.last_updated')]]:
<ha-relative-time
hass="[[hass]]"
datetime="[[stateObj.last_updated]]"
></ha-relative-time>
</paper-tooltip>
</div>
</template>
<template is="dom-if" if="[[!inDialog]]">
Expand Down
1 change: 1 addition & 0 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@
"edit": "Edit entity",
"details": "Details",
"history": "History",
"last_updated": "Last updated",
"script": {
"last_action": "Last Action",
"last_triggered": "Last Triggered"
Expand Down