Don't show wrong info in logbook (#17439)

This commit is contained in:
Bram Kragten 2023-07-31 20:25:57 +02:00 committed by GitHub
parent 2a9ef7d91f
commit 3e60d2e850
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -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";

View File

@ -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`<a target="_blank" rel="noreferrer" href=${attributeValue}
return html`<a
target="_blank"
rel="noopener noreferrer"
href=${attributeValue}
>${attributeValue}</a
>`;
} catch (_) {

View File

@ -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,