From bc547290301e1a5b09725589eaf95a640bdb5752 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Wiedemann?= Date: Mon, 1 Feb 2021 23:00:52 +0000 Subject: [PATCH] fix: Graph stopped updating following ddf6ca9 --- src/apexcharts-card.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apexcharts-card.ts b/src/apexcharts-card.ts index 4046097..768a881 100644 --- a/src/apexcharts-card.ts +++ b/src/apexcharts-card.ts @@ -172,8 +172,10 @@ class ChartsCard extends LitElement { let updated = false; this._config.series.forEach((serie, index) => { const entityState = (hass && hass.states[serie.entity]) || undefined; - this._entities[index] = entityState; - if (entityState && this._entities[index] !== entityState) { + if (!entityState) { + this._entities[index] = entityState; + } else if (entityState && this._entities[index] !== entityState) { + this._entities[index] = entityState; updated = true; if (this._graphs && this._graphs[index]) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion