diff --git a/src/components/entity/ha-statistics-picker.ts b/src/components/entity/ha-statistics-picker.ts index 1bb9386500..d1fffde764 100644 --- a/src/components/entity/ha-statistics-picker.ts +++ b/src/components/entity/ha-statistics-picker.ts @@ -74,6 +74,9 @@ class HaStatisticsPicker extends LitElement { const includeUnitClassCurrent = ignoreRestriction ? undefined : this.includeUnitClass; + const includeDeviceClassCurrent = ignoreRestriction + ? undefined + : this.includeDeviceClass; const includeStatisticTypesCurrent = ignoreRestriction ? undefined : this.statisticTypes; @@ -87,6 +90,7 @@ class HaStatisticsPicker extends LitElement { .hass=${this.hass} .includeStatisticsUnitOfMeasurement=${includeStatisticsUnitCurrent} .includeUnitClass=${includeUnitClassCurrent} + .includeDeviceClass=${includeDeviceClassCurrent} .value=${statisticId} .statisticTypes=${includeStatisticTypesCurrent} .statisticIds=${this.statisticIds} diff --git a/src/panels/lovelace/editor/config-elements/hui-statistics-graph-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-statistics-graph-card-editor.ts index 38cd92eab7..ae556b90e5 100644 --- a/src/panels/lovelace/editor/config-elements/hui-statistics-graph-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-statistics-graph-card-editor.ts @@ -121,7 +121,9 @@ export class HuiStatisticsGraphCardEditor !deepEqual(this._configEntities, changedProps.get("_configEntities")) ) { this._metaDatas = undefined; - this._getStatisticsMetaData(this._configEntities); + if (this._configEntities?.length) { + this._getStatisticsMetaData(this._configEntities); + } } }