mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 19:56:42 +00:00
Add 'max devices' config to Energy Devices Graph (#17553)
This commit is contained in:
parent
86c014b677
commit
4a5b67e320
@ -278,6 +278,8 @@ export class HuiEnergyDevicesGraphCard
|
|||||||
|
|
||||||
chartData.sort((a, b) => b.x - a.x);
|
chartData.sort((a, b) => b.x - a.x);
|
||||||
|
|
||||||
|
chartData.length = this._config?.max_devices || chartData.length;
|
||||||
|
|
||||||
chartData.forEach((d: any) => {
|
chartData.forEach((d: any) => {
|
||||||
const color = getColorByIndex(d.idx);
|
const color = getColorByIndex(d.idx);
|
||||||
|
|
||||||
|
@ -153,6 +153,7 @@ export interface EnergyDevicesGraphCardConfig extends LovelaceCardConfig {
|
|||||||
type: "energy-devices-graph";
|
type: "energy-devices-graph";
|
||||||
title?: string;
|
title?: string;
|
||||||
collection_key?: string;
|
collection_key?: string;
|
||||||
|
max_devices?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EnergySourcesTableCardConfig extends LovelaceCardConfig {
|
export interface EnergySourcesTableCardConfig extends LovelaceCardConfig {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user