From 0f574a765bae7de8ed45fa478ea91cae71928c9c Mon Sep 17 00:00:00 2001 From: larena1 <60823161+larena1@users.noreply.github.com> Date: Wed, 24 Feb 2021 17:48:50 +0100 Subject: [PATCH] Fix excessive rerendering of history charts (#8340) Co-authored-by: Bram Kragten --- src/components/state-history-charts.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/state-history-charts.ts b/src/components/state-history-charts.ts index a8faeb80d9..49ac8049c5 100644 --- a/src/components/state-history-charts.ts +++ b/src/components/state-history-charts.ts @@ -6,6 +6,7 @@ import { html, LitElement, property, + PropertyValues, TemplateResult, } from "lit-element"; import "./state-history-chart-line"; @@ -83,6 +84,10 @@ class StateHistoryCharts extends LitElement { `; } + protected shouldUpdate(changedProps: PropertyValues): boolean { + return !(changedProps.size === 1 && changedProps.has("hass")); + } + private _isHistoryEmpty(): boolean { const historyDataEmpty = !this.historyData ||