Only show what triggered a change if it wasn't a user (#6919)

* Only show what triggered a change if it wasn't a user

* Update ha-logbook.ts
This commit is contained in:
Bram Kragten 2020-09-10 21:47:18 +02:00 committed by GitHub
parent 092a02a624
commit c06357a351
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,20 +149,23 @@ class HaLogbook extends LitElement {
>
`
: ""}
<span class="item-message">${item.message}</span>
<span>${item_username ? ` (${item_username})` : ``}</span>
${!item.context_event_type
${item.message}
${item_username
? ` by ${item_username}`
: !item.context_event_type
? ""
: item.context_event_type === "call_service"
? // Service Call
html` by service
` by service
${item.context_domain}.${item.context_service}`
: item.context_entity_id === item.entity_id
? // HomeKit or something that self references
html` by
${item.context_name
? item.context_name
: item.context_event_type}`
` by
${
item.context_name
? item.context_name
: item.context_event_type
}`
: // Another entity such as an automation or script
html` by
<a
@ -258,7 +261,7 @@ class HaLogbook extends LitElement {
color: var(--primary-text-color);
}
.no-name .item-message {
.no-name .message:first-letter {
text-transform: capitalize;
}