Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
flixlix committed May 27, 2023
2 parents a477468 + 0c0f252 commit 574576c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/energy-flow-card-plus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export default class EnergyFlowCardPlus extends SubscribeMixin(LitElement) {
return html``;
}

if (!this._data) {
if (!this._data && this._config.energy_date_selection !== false) {
return html`${this.hass.localize('ui.panel.lovelace.cards.energy.loading')}`;
}

Expand Down Expand Up @@ -891,7 +891,7 @@ export default class EnergyFlowCardPlus extends SubscribeMixin(LitElement) {
: this.displayValue(totalHomeConsumption);

let lowCarbonPercentage: number | undefined;
if (this._data.co2SignalEntity && this._data.fossilEnergyConsumption) {
if (this._data && this._data.co2SignalEntity && this._data.fossilEnergyConsumption) {
// Calculate high carbon consumption
const highCarbonEnergy = Object.values(this._data.fossilEnergyConsumption).reduce((sum, a) => sum + a, 0) * 1000;

Expand Down

0 comments on commit 574576c

Please sign in to comment.