Add 'max devices' config to Energy Devices Graph (#17553)

This commit is contained in:
Thomas Konrad 2023-10-09 17:27:22 +02:00 committed by GitHub
parent 86c014b677
commit 4a5b67e320
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View File

@ -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);

View File

@ -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 {