Skip to content

Commit 81b5dde

Browse files
authored
Add water devices to energy data download (#28242)
1 parent ce86aab commit 81b5dde

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/panels/energy/ha-panel-energy.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ class PanelEnergy extends LitElement {
324324

325325
const energy_sources = energyData.prefs.energy_sources;
326326
const device_consumption = energyData.prefs.device_consumption;
327+
const device_consumption_water = energyData.prefs.device_consumption_water;
327328
const stats = energyData.state.stats;
328329

329330
const timeSet = new Set<number>();
@@ -509,6 +510,20 @@ class PanelEnergy extends LitElement {
509510

510511
printCategory("device_consumption", devices, electricUnit);
511512

513+
if (device_consumption_water) {
514+
const waterDevices: string[] = [];
515+
device_consumption_water.forEach((source) => {
516+
source = source as DeviceConsumptionEnergyPreference;
517+
waterDevices.push(source.stat_consumption);
518+
});
519+
520+
printCategory(
521+
"device_consumption_water",
522+
waterDevices,
523+
energyData.state.waterUnit
524+
);
525+
}
526+
512527
const { summedData, compareSummedData: _ } = getSummedData(
513528
energyData.state
514529
);

0 commit comments

Comments
 (0)