Skip to content

Commit

Permalink
bug: fixes bug where battery color wouldn't change when user changed …
Browse files Browse the repository at this point in the history
…in config
  • Loading branch information
flixlix committed Mar 26, 2023
1 parent e6c2ac7 commit 5e451d9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/power-flow-card-plus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,16 @@ export class PowerFlowCard extends LitElement {
batteryConsumption = (totalBatteryOut ?? 0) - (batteryToGrid ?? 0);
}

if (this._config.entities.battery?.color?.consumption !== undefined)
this.style.setProperty(
"--energy-battery-out-color",
this._config.entities.battery?.color?.consumption || "#4db6ac"
);
if (this._config.entities.battery?.color?.production !== undefined)
this.style.setProperty(
"--energy-battery-in-color",
this._config.entities.battery?.color?.production || "#a280db"
);
const batteryIconColorType = this._config.entities.battery?.color_icon;
this.style.setProperty(
"--icon-battery-color",
Expand Down

0 comments on commit 5e451d9

Please sign in to comment.