Skip to content

Commit

Permalink
fix: Graph stopped updating following ddf6ca9
Browse files Browse the repository at this point in the history
  • Loading branch information
RomRider committed Feb 1, 2021
1 parent ddf6ca9 commit bc54729
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/apexcharts-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bc54729

Please sign in to comment.