Skip to content

Commit

Permalink
Merge pull request #651 from maxwroc/RerenderOnConfigCh
Browse files Browse the repository at this point in the history
Force re-render when config changes
  • Loading branch information
maxwroc authored Jan 13, 2024
2 parents 4130752 + 5bcab79 commit efbfacd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/battery-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/custom-elements/lovelace-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ export abstract class LovelaceCard<TConfig> 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());
Expand Down

0 comments on commit efbfacd

Please sign in to comment.