From 3e60d2e850c7cdbf88903f574434536cf480dafd Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 31 Jul 2023 20:25:57 +0200 Subject: [PATCH] Don't show wrong info in logbook (#17439) --- src/common/const.ts | 6 +++++- src/common/entity/compute_attribute_display.ts | 5 ++++- src/data/logbook.ts | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/const.ts b/src/common/const.ts index 56b632d4be..e5c36f1eee 100644 --- a/src/common/const.ts +++ b/src/common/const.ts @@ -261,7 +261,11 @@ export const DOMAINS_TOGGLE = new Set([ ]); /** Domains that have a dynamic entity image / picture. */ -export const DOMAINS_WITH_DYNAMIC_PICTURE = new Set(["camera", "media_player"]); +export const DOMAINS_WITH_DYNAMIC_PICTURE = new Set([ + "camera", + "image", + "media_player", +]); /** Temperature units. */ export const UNIT_C = "°C"; diff --git a/src/common/entity/compute_attribute_display.ts b/src/common/entity/compute_attribute_display.ts index 1d5d8af8a4..0a6d16e55c 100644 --- a/src/common/entity/compute_attribute_display.ts +++ b/src/common/entity/compute_attribute_display.ts @@ -46,7 +46,10 @@ export const computeAttributeValueDisplay = ( // If invalid URL, exception will be raised const url = new URL(attributeValue); if (url.protocol === "http:" || url.protocol === "https:") - return html`${attributeValue}`; } catch (_) { diff --git a/src/data/logbook.ts b/src/data/logbook.ts index 1a493f0dba..d6528ab525 100644 --- a/src/data/logbook.ts +++ b/src/data/logbook.ts @@ -157,7 +157,6 @@ export const createHistoricState = ( attributes: { // Rebuild the historical state by copying static attributes only device_class: currentStateObj?.attributes.device_class, - event_type: currentStateObj?.attributes.event_type, source_type: currentStateObj?.attributes.source_type, has_date: currentStateObj?.attributes.has_date, has_time: currentStateObj?.attributes.has_time,