File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 22
33from __future__ import annotations
44
5- from asyncio import Task , create_task
5+ from asyncio import Task , create_task , gather
66from collections .abc import Awaitable , Callable
77from dataclasses import replace
88from datetime import UTC , datetime
@@ -440,6 +440,7 @@ async def get_missing_energy_logs(self) -> None:
440440 self ._energy_counters .update ()
441441 if self ._current_log_address is None :
442442 return None
443+
443444 if self ._energy_counters .log_addresses_missing is None :
444445 _LOGGER .debug (
445446 "Start with initial energy request for the last 10 log addresses for node %s." ,
@@ -453,12 +454,13 @@ async def get_missing_energy_logs(self) -> None:
453454 log_address , _ = calc_log_address (log_address , 1 , - 4 )
454455 total_addresses -= 1
455456
456- for task in log_update_tasks :
457- await task
457+ await gather (* log_update_tasks )
458458
459459 if self ._cache_enabled :
460460 await self ._energy_log_records_save_to_cache ()
461+
461462 return
463+
462464 if self ._energy_counters .log_addresses_missing is not None :
463465 _LOGGER .debug ("Task created to get missing logs of %s" , self ._mac_in_str )
464466 if (
You can’t perform that action at this time.
0 commit comments