Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski committed May 5, 2023
1 parent 8ddfde2 commit f73b869
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/tauron_amiplus/statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async def update_all(self, last_data: TauronAmiplusRawData) -> None:

for s, v in all_stat_ids.items():
if v["last_stats_end"] is not None:
stat = await self.get_stats(raw_data[v["data_source"]], s) # here
stat = await self.get_stats(raw_data[v["data_source"]], s)
v["sum"] = stat[s][0]["sum"]
start = stat[s][0]["start"]
if isinstance(start, float):
Expand Down Expand Up @@ -222,7 +222,7 @@ async def get_last_stats(self, statistic_id):
async def get_stats(self, raw_data, statistic_id):
return await get_instance(self.hass).async_add_executor_job(
statistics_during_period,
self.hass, self.get_time(raw_data[0]), None, [statistic_id], "hour", None, {"state", "sum"}) # here
self.hass, self.get_time(raw_data[0]), None, [statistic_id], "hour", None, {"state", "sum"})

@staticmethod
def get_time(raw_hour):
Expand Down

0 comments on commit f73b869

Please sign in to comment.