Skip to content

Commit

Permalink
Add 'max devices' config to Energy Devices Graph (#17553)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaskonrad authored Oct 9, 2023
1 parent 86c014b commit 4a5b67e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ export class HuiEnergyDevicesGraphCard

chartData.sort((a, b) => b.x - a.x);

chartData.length = this._config?.max_devices || chartData.length;

chartData.forEach((d: any) => {
const color = getColorByIndex(d.idx);

Expand Down
1 change: 1 addition & 0 deletions src/panels/lovelace/cards/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ export interface EnergyDevicesGraphCardConfig extends LovelaceCardConfig {
type: "energy-devices-graph";
title?: string;
collection_key?: string;
max_devices?: number;
}

export interface EnergySourcesTableCardConfig extends LovelaceCardConfig {
Expand Down

0 comments on commit 4a5b67e

Please sign in to comment.