Skip to content

Commit

Permalink
Restore compatibility with older HA versions
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski committed Jul 12, 2024
1 parent 0701a24 commit c1ca5c0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/xiaomi-vacuum-map-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c1ca5c0

Please sign in to comment.