From c1ca5c0133d678ae194d76d34f135c7d4a435907 Mon Sep 17 00:00:00 2001 From: Piotr Machowski Date: Fri, 12 Jul 2024 03:10:21 +0200 Subject: [PATCH] Restore compatibility with older HA versions --- src/xiaomi-vacuum-map-card.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xiaomi-vacuum-map-card.ts b/src/xiaomi-vacuum-map-card.ts index 18d5ec4b..7b082463 100644 --- a/src/xiaomi-vacuum-map-card.ts +++ b/src/xiaomi-vacuum-map-card.ts @@ -828,6 +828,7 @@ export class XiaomiVacuumMapCard extends LitElement { private _isInEditor(): boolean { function isInEditor(e: Element): boolean { return (e.parentElement?.tagName?.toLowerCase() === "hui-card" && "preview" in (e.parentElement?.attributes ?? [])) + || e.parentElement?.tagName?.toLowerCase() === "hui-card-preview" || e.parentElement != null && isInEditor(e.parentElement) || e.parentNode?.toString() == "[object ShadowRoot]" && isInEditor((e.getRootNode() as ShadowRoot).host); }