From 026fc1d2e34c2aa25174137a0031a8eaee36ab24 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 23 Aug 2020 17:00:27 -0500 Subject: [PATCH] Show the entity id that first used the context in logbook --- src/data/logbook.ts | 2 ++ src/panels/logbook/ha-logbook.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/data/logbook.ts b/src/data/logbook.ts index fd79c87301..ac6f342f7b 100644 --- a/src/data/logbook.ts +++ b/src/data/logbook.ts @@ -7,6 +7,8 @@ export interface LogbookEntry { entity_id?: string; domain: string; context_user_id?: string; + context_entity_id?: string; + context_entity_id_name?: string; } const DATA_CACHE: { diff --git a/src/panels/logbook/ha-logbook.ts b/src/panels/logbook/ha-logbook.ts index 3fb8bf7a0c..d95ee7e156 100644 --- a/src/panels/logbook/ha-logbook.ts +++ b/src/panels/logbook/ha-logbook.ts @@ -118,6 +118,18 @@ class HaLogbook extends LitElement { ? ` (${item_username})` : ``} + ${!item.context_entity_id + ? "" + : html` + by + ${item.context_entity_id_name} + `}