This reverts commit 159506262a
.
This commit is contained in:
parent
0aaf9459ab
commit
27d1063dec
2 changed files with 2 additions and 219 deletions
|
@ -274,16 +274,14 @@ async def ws_get_fossil_energy_consumption(
|
|||
) -> dict[datetime, float]:
|
||||
"""Combine multiple statistics, returns a dict indexed by start time."""
|
||||
result: defaultdict[datetime, float] = defaultdict(float)
|
||||
seen: defaultdict[datetime, set[str]] = defaultdict(set)
|
||||
|
||||
for statistics_id, stat in stats.items():
|
||||
if statistics_id not in statistic_ids:
|
||||
continue
|
||||
for period in stat:
|
||||
if period["sum"] is None or statistics_id in seen[period["start"]]:
|
||||
if period["sum"] is None:
|
||||
continue
|
||||
result[period["start"]] += period["sum"]
|
||||
seen[period["start"]].add(statistics_id)
|
||||
|
||||
return {key: result[key] for key in sorted(result)}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue