diff --git a/README.md b/README.md index 30b5e99a..b2b8f740 100644 --- a/README.md +++ b/README.md @@ -51,15 +51,16 @@ I recommend looking at the [Example usage section](#example-usage) to understand #### Card options -| Name | Type | Default | Description | -| ----------------- | -------- | :----------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| type | `string` | **required** | `custom:power-flow-card`. | -| entities | `object` | **required** | One or more sensor entities, see [entities object](#entities-object) for additional entity options. | -| inverted_entities | `string` | | Comma seperated list of entities that should be inverted (negative for consumption and positive for production). See [example usage](#inverted-entities-example). | -| kw_decimals | `number` | 1 | Number of decimals rounded to when kilowatts are displayed. | -| min_flow_rate | `number` | .75 | Represents the fastest amount of time in seconds for a flow dot to travel from one end to the other, see [flow formula](#flow-formula). | -| max_flow_rate | `number` | 6 | Represents the slowest amount of time in seconds for a flow dot to travel from one end to the other, see [flow formula](#flow-formula). | -| watt_threshold | `number` | 0 | The number of watts to display before converting to and displaying kilowatts. Setting of 0 will always display in kilowatts. | +| Name | Type | Default | Description | +| ----------------- | -------- | :----------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| type | `string` | **required** | `custom:power-flow-card`. | +| entities | `object` | **required** | One or more sensor entities, see [entities object](#entities-object) for additional entity options. | +| dashboard_link | `string` | | Shows a link to an Energy Dashboard. Should be a url path to location of your choice. If you wanted to link to the built-in dashboard you would enter `/energy` for example. | +| inverted_entities | `string` | | Comma seperated list of entities that should be inverted (negative for consumption and positive for production). See [example usage](#inverted-entities-example). | +| kw_decimals | `number` | 1 | Number of decimals rounded to when kilowatts are displayed. | +| min_flow_rate | `number` | .75 | Represents the fastest amount of time in seconds for a flow dot to travel from one end to the other, see [flow formula](#flow-formula). | +| max_flow_rate | `number` | 6 | Represents the slowest amount of time in seconds for a flow dot to travel from one end to the other, see [flow formula](#flow-formula). | +| watt_threshold | `number` | 0 | The number of watts to display before converting to and displaying kilowatts. Setting of 0 will always display in kilowatts. | #### Entities object diff --git a/src/power-flow-card-config.ts b/src/power-flow-card-config.ts index 62a80ba1..96820f9c 100644 --- a/src/power-flow-card-config.ts +++ b/src/power-flow-card-config.ts @@ -17,6 +17,7 @@ export interface PowerFlowCardConfig extends LovelaceCardConfig { }; solar?: string; }; + dashboard_link?: string; inverted_entities: string | string[]; kw_decimals: number; min_flow_rate: number; diff --git a/src/power-flow-card.ts b/src/power-flow-card.ts index 448a2ad6..39a31666 100644 --- a/src/power-flow-card.ts +++ b/src/power-flow-card.ts @@ -521,8 +521,21 @@ export class PowerFlowCard extends LitElement { : ""} - + + ${this._config.dashboard_link + ? html` +
+ + ${this.hass.localize( + "ui.panel.lovelace.cards.energy.energy_distribution.go_to_energy_dashboard" + )} + +
+ ` + : ""} + `; } @@ -707,6 +720,9 @@ export class PowerFlowCard extends LitElement { stroke-dasharray: 238.76104; } } + .card-actions a { + text-decoration: none; + } `; }