mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Use state icon in logbook instead of domain icon (#4558)
Fixes https://github.com/home-assistant/home-assistant-polymer/issues/2313
This commit is contained in:
parent
312f1df368
commit
0f8cf574d3
@ -1,8 +1,8 @@
|
|||||||
import "@polymer/iron-icon/iron-icon";
|
import "../../components/ha-icon";
|
||||||
|
|
||||||
import formatTime from "../../common/datetime/format_time";
|
import formatTime from "../../common/datetime/format_time";
|
||||||
import formatDate from "../../common/datetime/format_date";
|
import formatDate from "../../common/datetime/format_date";
|
||||||
import { domainIcon } from "../../common/entity/domain_icon";
|
import { domainIcon } from "../../common/entity/domain_icon";
|
||||||
|
import { stateIcon } from "../../common/entity/state_icon";
|
||||||
import { computeRTL } from "../../common/util/compute_rtl";
|
import { computeRTL } from "../../common/util/compute_rtl";
|
||||||
import {
|
import {
|
||||||
LitElement,
|
LitElement,
|
||||||
@ -63,6 +63,7 @@ class HaLogbook extends LitElement {
|
|||||||
index: number
|
index: number
|
||||||
): TemplateResult {
|
): TemplateResult {
|
||||||
const previous = this.entries[index - 1];
|
const previous = this.entries[index - 1];
|
||||||
|
const state = item.entity_id ? this.hass.states[item.entity_id] : undefined;
|
||||||
return html`
|
return html`
|
||||||
<div>
|
<div>
|
||||||
${index === 0 ||
|
${index === 0 ||
|
||||||
@ -81,7 +82,9 @@ class HaLogbook extends LitElement {
|
|||||||
<div class="time">
|
<div class="time">
|
||||||
${formatTime(new Date(item.when), this.hass.language)}
|
${formatTime(new Date(item.when), this.hass.language)}
|
||||||
</div>
|
</div>
|
||||||
<iron-icon .icon="${domainIcon(item.domain)}"></iron-icon>
|
<ha-icon
|
||||||
|
.icon=${state ? stateIcon(state) : domainIcon(item.domain)}
|
||||||
|
></ha-icon>
|
||||||
<div class="message">
|
<div class="message">
|
||||||
${!item.entity_id
|
${!item.entity_id
|
||||||
? html`
|
? html`
|
||||||
@ -137,7 +140,7 @@ class HaLogbook extends LitElement {
|
|||||||
direction: rtl;
|
direction: rtl;
|
||||||
}
|
}
|
||||||
|
|
||||||
iron-icon {
|
ha-icon {
|
||||||
margin: 0 8px 0 16px;
|
margin: 0 8px 0 16px;
|
||||||
color: var(--primary-text-color);
|
color: var(--primary-text-color);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user