Skip to content

Commit

Permalink
Merge pull request #11 from davet2001/issue10-energy-and-power-flow-c…
Browse files Browse the repository at this point in the history
…ard-default-titles

Add default titles for energy and power cards
  • Loading branch information
davet2001 authored Oct 30, 2024
2 parents 3ecd1b5 + 8d9859e commit 5e3b788
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/hui-energy-elec-flow-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ export class HuiEnergyElecFlowCard
this._config = config;
}

static getStubConfig(): EnergyElecFlowCardConfig {
return {
type: "custom:hui-energy-elec-flow-card",
title: "Energy distribution today",
};
}

protected render() {
if (!this.hass || !this._config) {
return nothing;
Expand Down
1 change: 1 addition & 0 deletions src/hui-power-flow-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ class HuiPowerFlowCard extends LitElement implements LovelaceCard {

let returnConfig: PowerFlowCardConfig = {
type: "custom:hui-power-flow-card",
title: "Live power flow",
}
// Parse energy sources from HA's energy prefs
for (const source of energyPrefs.energy_sources) {
Expand Down

0 comments on commit 5e3b788

Please sign in to comment.