forked from OpenLEADR/openleadr-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoadrUpdateReport.xml
59 lines (57 loc) · 2.86 KB
/
oadrUpdateReport.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<oadr:oadrSignedObject xmlns:oadr="http://openadr.org/oadr-2.0b/2012/07" xmlns:pyld="http://docs.oasis-open.org/ns/energyinterop/201110/payloads" xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06" oadr:Id="oadrSignedObject">
<oadr:oadrUpdateReport ei:schemaVersion="2.0b" xmlns:ei="http://docs.oasis-open.org/ns/energyinterop/201110">
<pyld:requestID>{{ request_id }}</pyld:requestID>
{% if reports %}
{% for report in reports %}
<oadr:oadrReport xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0">
{% if report.dtstart is defined and report.dtstart is not none %}
<xcal:dtstart>
<xcal:date-time>{{ report.dtstart|datetimeformat }}</xcal:date-time>
</xcal:dtstart>
{% endif %}
{% if report.intervals %}
<strm:intervals xmlns:strm="urn:ietf:params:xml:ns:icalendar-2.0:stream">
{% for interval in report.intervals %}
<ei:interval>
<xcal:dtstart>
<xcal:date-time>{{ interval.dtstart|datetimeformat }}</xcal:date-time>
</xcal:dtstart>
<oadr:oadrReportPayload>
<ei:rID>{{ interval.report_payload.r_id }}</ei:rID>
{% if interval.report_payload.confidence is defined and interval.report_payload.confidence is not none %}
<ei:confidence>{{ interval.report_payload.confidence }}</ei:confidence>
{% endif %}
{% if interval.report_payload.accuracy is defined and interval.report_payload.accuracy is not none %}
<ei:accuracy>{{ interval.report_payload.accuracy }}</ei:accuracy>
{% endif %}
<ei:payloadFloat>
<ei:value>{{ interval.report_payload.value }}</ei:value>
</ei:payloadFloat>
{% if interval.report_payload.data_quality is defined and interval.report_payload.data_quality is not none %}
<oadr:oadrDataQuality>{{ interval.report_payload.data_quality }}</oadr:oadrDataQuality>
{% endif %}
</oadr:oadrReportPayload>
</ei:interval>
{% endfor %}
</strm:intervals>
{% endif %}
<ei:eiReportID>{{ report.report_id }}</ei:eiReportID>
{% if report.report_descriptions %}
{% for report_description in report.report_descriptions %}
{% include 'parts/oadrReportDescription.xml' %}
{% endfor %}
{% endif %}
<ei:reportRequestID>{{ report.report_request_id }}</ei:reportRequestID>
<ei:reportSpecifierID>{{ report.report_specifier_id }}</ei:reportSpecifierID>
{% if report.report_name %}
<ei:reportName>{{ report.report_name }}</ei:reportName>
{% endif %}
<ei:createdDateTime>{{ report.created_date_time|datetimeformat }}</ei:createdDateTime>
</oadr:oadrReport>
{% endfor %}
{% endif %}
{% if ven_id is defined and ven_id is not none %}
<ei:venID>{{ ven_id }}</ei:venID>
{% endif %}
</oadr:oadrUpdateReport>
</oadr:oadrSignedObject>