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