From 56e5d00fc49232b8b8be8c194d6b0e3a8a538a2e Mon Sep 17 00:00:00 2001 From: Petar Petrov Date: Thu, 19 May 2022 14:48:54 +0300 Subject: [PATCH] Feature Request: Card title #5 --- README.md | 1 + src/ha-sankey-chart.ts | 1 + src/types.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/README.md b/README.md index 526edd2..aded161 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ A Home Assistant lovelace card to display a sankey chart. For example for power | ----------------- | ------- | ------------ | ------------------- | ------------------------------------------- | | type | string | **Required** | | `custom:sankey-chart` | sections | list | **Required** | | Entities to show divided by sections, see [sections object](#sections-object) for additional options. +| title | string | **Optional** | | Optional header title for the card | unit_prefix | string | **Optional** | | Metric prefix for the unit of measurment. See . Supported values are m, k, M, G, T | round | number | **Optional** | 0 | Round the value to at most N decimal places. | height | number | **Optional** | 200 | The height of the card in pixels diff --git a/src/ha-sankey-chart.ts b/src/ha-sankey-chart.ts index 439663e..4ad89d8 100644 --- a/src/ha-sankey-chart.ts +++ b/src/ha-sankey-chart.ts @@ -136,6 +136,7 @@ export class SankeyChart extends LitElement {
${this.sections.map((s, i) => this.renderSection(i))} diff --git a/src/types.ts b/src/types.ts index 45cb818..95f5525 100644 --- a/src/types.ts +++ b/src/types.ts @@ -24,6 +24,7 @@ export interface SectionConfig { export interface SankeyChartConfig extends LovelaceCardConfig { type: string; + title?: string; sections: SectionConfig[]; unit_prefix?: '' | keyof typeof UNIT_PREFIXES; round?: number;