diff --git a/src/panels/lovelace/cards/hui-history-graph-card.ts b/src/panels/lovelace/cards/hui-history-graph-card.ts index 4618751429..02a895ac99 100644 --- a/src/panels/lovelace/cards/hui-history-graph-card.ts +++ b/src/panels/lovelace/cards/hui-history-graph-card.ts @@ -87,9 +87,11 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard { return; } - const oldConfig = changedProps.get("_config") as - | HistoryGraphCardConfig - | undefined; + if (!changedProps.has("_config")) { + return; + } + + const oldConfig = changedProps.get("_config") as HistoryGraphCardConfig; if (oldConfig !== this._config) { this._getStateHistory();