mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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",
|
"script",
|
||||||
"sun",
|
"sun",
|
||||||
"zone",
|
"zone",
|
||||||
|
"event",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const HIDE_PLATFORM = new Set(["mobile_app"]);
|
const HIDE_PLATFORM = new Set(["mobile_app"]);
|
||||||
|
@ -68,16 +68,23 @@ class HuiEventEntityRow extends LitElement implements LovelaceRow {
|
|||||||
hasDoubleClick: hasAction(this._config.double_tap_action),
|
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">
|
<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)
|
${isUnavailableState(stateObj.state)
|
||||||
? ``
|
? ``
|
||||||
: computeAttributeValueDisplay(
|
: computeAttributeValueDisplay(
|
||||||
@ -104,10 +111,10 @@ class HuiEventEntityRow extends LitElement implements LovelaceRow {
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.when {
|
.when {
|
||||||
color: var(--secondary-text-color);
|
color: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
.what {
|
.what {
|
||||||
color: var(--primary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user