Merge fac88238fe
into cff54b73a4
This commit is contained in:
commit
2fec28ff96
|
@ -137,6 +137,17 @@ export class EnergySetupWizard extends LitElement implements LovelaceCard {
|
|||
if (!this._preferences) {
|
||||
return;
|
||||
}
|
||||
// User made no selections during setup
|
||||
if (
|
||||
this._preferences!.device_consumption.length === 0 &&
|
||||
this._preferences!.energy_sources.length === 0
|
||||
) {
|
||||
showAlertDialog(this, {
|
||||
title: `No statistics selected`,
|
||||
text: `You must select at least one statistic to finish setting up your Energy dashboard.`,
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this._preferences = await saveEnergyPreferences(
|
||||
this.hass,
|
||||
|
|
|
@ -44,6 +44,14 @@ export class EnergyViewStrategy extends ReactiveElement {
|
|||
return view;
|
||||
}
|
||||
|
||||
// No energy sources available, start from scratch
|
||||
if (
|
||||
prefs!.device_consumption.length === 0 &&
|
||||
prefs!.energy_sources.length === 0
|
||||
) {
|
||||
return setupWizard();
|
||||
}
|
||||
|
||||
view.type = "sidebar";
|
||||
|
||||
const hasGrid = prefs.energy_sources.find(
|
||||
|
|
Loading…
Reference in New Issue