From 28fde7d819c2e74f33b76a1f70182629a59cc1c2 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Thu, 10 Sep 2020 21:25:02 +0200 Subject: [PATCH 1/2] Only show what triggered a change if it wasn't a user --- src/panels/logbook/ha-logbook.ts | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/panels/logbook/ha-logbook.ts b/src/panels/logbook/ha-logbook.ts index 33269319b6a4..47bef1621bf2 100644 --- a/src/panels/logbook/ha-logbook.ts +++ b/src/panels/logbook/ha-logbook.ts @@ -109,6 +109,7 @@ class HaLogbook extends LitElement { const state = item.entity_id ? this.hass.states[item.entity_id] : undefined; const item_username = item.context_user_id && this.userIdToName[item.context_user_id]; + console.log(item); return html`
${index === 0 || @@ -149,20 +150,23 @@ class HaLogbook extends LitElement { > ` : ""} - ${item.message} - ${item_username ? ` (${item_username})` : ``} - ${!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 Date: Thu, 10 Sep 2020 21:27:01 +0200 Subject: [PATCH 2/2] Update ha-logbook.ts --- src/panels/logbook/ha-logbook.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/panels/logbook/ha-logbook.ts b/src/panels/logbook/ha-logbook.ts index 47bef1621bf2..e94fd7c72ddb 100644 --- a/src/panels/logbook/ha-logbook.ts +++ b/src/panels/logbook/ha-logbook.ts @@ -109,7 +109,6 @@ class HaLogbook extends LitElement { const state = item.entity_id ? this.hass.states[item.entity_id] : undefined; const item_username = item.context_user_id && this.userIdToName[item.context_user_id]; - console.log(item); return html`
${index === 0 ||