Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions custom_components/iec/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ async def _update_data(
for contract_id in self._contract_ids:
# Because IEC API provides historical usage/cost with a delay of a couple of days
# we need to insert data into statistics.
# Add small delay between tasks to avoid API flooding
if self._contract_ids.index(contract_id) > 0:
await asyncio.sleep(1)
self.hass.async_create_task(
self._insert_statistics(
contract_id, contracts.get(contract_id).smart_meter
Expand Down