mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Make event entity row show time as relative by default, hide in gener… (#17456)
This commit is contained in:
parent
e8aa08b717
commit
5f95968c8f
@ -36,6 +36,7 @@ const HIDE_DOMAIN = new Set([
|
||||
"script",
|
||||
"sun",
|
||||
"zone",
|
||||
"event",
|
||||
]);
|
||||
|
||||
const HIDE_PLATFORM = new Set(["mobile_app"]);
|
||||
|
@ -68,16 +68,23 @@ class HuiEventEntityRow extends LitElement implements LovelaceRow {
|
||||
hasDoubleClick: hasAction(this._config.double_tap_action),
|
||||
})}
|
||||
>
|
||||
<div class="what">
|
||||
${computeStateDisplay(
|
||||
this.hass!.localize,
|
||||
stateObj,
|
||||
this.hass.locale,
|
||||
this.hass.config,
|
||||
this.hass.entities
|
||||
)}
|
||||
</div>
|
||||
<div class="when">
|
||||
${isUnavailableState(stateObj.state)
|
||||
? computeStateDisplay(
|
||||
this.hass!.localize,
|
||||
stateObj,
|
||||
this.hass.locale,
|
||||
this.hass.config,
|
||||
this.hass.entities
|
||||
)
|
||||
: html`<hui-timestamp-display
|
||||
.hass=${this.hass}
|
||||
.ts=${new Date(stateObj.state)}
|
||||
.format=${this._config.format}
|
||||
capitalize
|
||||
></hui-timestamp-display>`}
|
||||
</div>
|
||||
<div class="what">
|
||||
${isUnavailableState(stateObj.state)
|
||||
? ``
|
||||
: computeAttributeValueDisplay(
|
||||
@ -104,10 +111,10 @@ class HuiEventEntityRow extends LitElement implements LovelaceRow {
|
||||
text-align: right;
|
||||
}
|
||||
.when {
|
||||
color: var(--secondary-text-color);
|
||||
color: var(--primary-text-color);
|
||||
}
|
||||
.what {
|
||||
color: var(--primary-text-color);
|
||||
color: var(--secondary-text-color);
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user