Skip to content

Commit

Permalink
Fix format warning
Browse files Browse the repository at this point in the history
  • Loading branch information
davet2001 committed May 13, 2024
1 parent 254386b commit 6b55460
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/panels/lovelace/cards/hui-power-flow-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,17 @@ class HuiPowerFlowCard extends LitElement implements LovelaceCard {

if (this._config) {
for (const id of [
this._config.power_from_grid_entity || [],
this._config.power_to_grid_entity || [],
this._config.power_from_grid_entity,
this._config.power_to_grid_entity,
...(this._config.generation_entities || []),
...(this._config.consumer_entities || []),
]) {
const oldState = oldHass.states[id] as HassEntity | undefined;
const newState = newHass.states[id] as HassEntity | undefined;

if (oldState !== newState) {
return true;
if (id) {
const oldState = oldHass.states[id] as HassEntity | undefined;
const newState = newHass.states[id] as HassEntity | undefined;
if (oldState !== newState) {
return true;
}
}
}
}
Expand Down

0 comments on commit 6b55460

Please sign in to comment.