Skip to content

Commit ed258c4

Browse files
committed
Set the dtstart of outgoing reports
Reported in #88.
1 parent 1acb079 commit ed258c4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

openleadr/client.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,10 @@ async def update_report(self, report_request_id):
651651
outgoing_report.intervals = intervals
652652
logger.info(f"The number of intervals in the report is now {len(outgoing_report.intervals)}")
653653

654+
# Always set the dtstart of the report to the earliest datetime of any of the intervals
655+
if outgoing_report.intervals:
656+
outgoing_report.dtstart = min(interval.dtstart for interval in outgoing_report.intervals)
657+
654658
# Figure out if the report is complete after this sampling
655659
if data_collection_mode == 'incremental' and report_back_duration is not None\
656660
and report_back_duration > granularity:

0 commit comments

Comments
 (0)