From 67e17d40164258d8d7bd094d715cedfff9a6efd7 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Fri, 15 May 2020 14:54:23 +0200 Subject: [PATCH] Fix conditional and custom panel updated > update (#5891) --- src/panels/custom/ha-panel-custom.ts | 3 ++- src/panels/lovelace/components/hui-conditional-base.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/panels/custom/ha-panel-custom.ts b/src/panels/custom/ha-panel-custom.ts index 6de6709a60..b7b2a10c3c 100644 --- a/src/panels/custom/ha-panel-custom.ts +++ b/src/panels/custom/ha-panel-custom.ts @@ -43,7 +43,8 @@ export class HaPanelCustom extends UpdatingElement { this._cleanupPanel(); } - protected updated(changedProps: PropertyValues) { + protected update(changedProps: PropertyValues) { + super.update(changedProps); if (changedProps.has("panel")) { // Clean up old things if we had a panel if (changedProps.get("panel")) { diff --git a/src/panels/lovelace/components/hui-conditional-base.ts b/src/panels/lovelace/components/hui-conditional-base.ts index befba3bab0..b877b3adfb 100644 --- a/src/panels/lovelace/components/hui-conditional-base.ts +++ b/src/panels/lovelace/components/hui-conditional-base.ts @@ -1,4 +1,9 @@ -import { customElement, property, UpdatingElement } from "lit-element"; +import { + customElement, + property, + UpdatingElement, + PropertyValues, +} from "lit-element"; import { HomeAssistant } from "../../../types"; import { ConditionalCardConfig } from "../cards/types"; import { @@ -40,7 +45,8 @@ export class HuiConditionalBase extends UpdatingElement { this._config = config; } - protected update(): void { + protected update(changed: PropertyValues): void { + super.update(changed); if (!this._element || !this.hass || !this._config) { return; }