From 5bcab796214c8797369698d6f7e4966a886f7227 Mon Sep 17 00:00:00 2001 From: Max Chodorowski Date: Sat, 13 Jan 2024 10:49:07 +0000 Subject: [PATCH] Force re-render when config changes --- src/battery-provider.ts | 2 -- src/custom-elements/lovelace-card.ts | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/battery-provider.ts b/src/battery-provider.ts index d00ab6bb..157d1324 100644 --- a/src/battery-provider.ts +++ b/src/battery-provider.ts @@ -209,8 +209,6 @@ export class BatteryProvider { const filters = this.exclude; const toBeRemoved: string[] = []; - - Object.keys(this.batteries).forEach((entityId) => { const battery = this.batteries[entityId]; let isHidden = false; diff --git a/src/custom-elements/lovelace-card.ts b/src/custom-elements/lovelace-card.ts index f13bf976..d6d54958 100644 --- a/src/custom-elements/lovelace-card.ts +++ b/src/custom-elements/lovelace-card.ts @@ -41,6 +41,12 @@ export abstract class LovelaceCard extends LitElement { */ private triggerUpdate = throttledCall(async () => { await this.internalUpdate(this.configUpdated, this.hassUpdated); + + if (this.configUpdated) { + // always rerender when config has changed + this.requestUpdate(); + } + this.configUpdated = false; this.hassUpdated = false; this.updateNotifyQueue.forEach(n => n());