Explorar el Código

Fixed bug in Report templates after changing the dict structure

Stan Janssen hace 3 años
padre
commit
f88c483598

+ 1 - 1
pyopenadr/templates/oadrRegisterReport.xml

@@ -14,7 +14,7 @@
       </xcal:duration>
       {% endif %}
       <ei:eiReportID>{{ report.report_id }}</ei:eiReportID>
-  {% for report_description in report.report_descriptions %}
+  {% for r_id, report_description in report.report_descriptions.items() %}
       {% include 'parts/oadrReportDescription.xml' %}
   {% endfor %}
       <ei:reportRequestID>{{ report.report_request_id }}</ei:reportRequestID>

+ 1 - 1
pyopenadr/templates/oadrUpdateReport.xml

@@ -6,7 +6,7 @@
     <oadrReport>
       <ei:eiReportID>{{ report.report_id }}</ei:eiReportID>
       {% if report.report_descriptions %}
-      {% for report_description in report.report_descriptions %}
+      {% for r_id, report_description in report.report_descriptions.items() %}
       {% include 'parts/oadrReportDescription.xml' %}
       <ei:reportRequestID>{{ report.report_request_id }}</ei:reportRequestID>
       <ei:reportSpecifierID>{{ report.report_specifier_id }}</ei:reportSpecifierID>

+ 1 - 1
pyopenadr/templates/parts/eiEventSignal.xml

@@ -19,7 +19,7 @@
     <ei:signalName>{{ signal.signal_name }}</ei:signalName>
     <ei:signalType>{{ signal.signal_type }}</ei:signalType>
     <ei:signalID>{{ signal.signal_id }}</ei:signalID>
-    {% if signal.current_value and signal.current_value is not none %}
+    {% if signal.current_value is not none %}
     <ei:currentValue>
         <ei:payloadFloat>
             <ei:value>{{ signal.current_value }}</ei:value>

+ 1 - 1
pyopenadr/templates/parts/oadrReportDescription.xml

@@ -1,5 +1,5 @@
 <oadrReportDescription xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06">
-  <ei:rID>{{ report_description.r_id }}</ei:rID>
+  <ei:rID>{{ r_id }}</ei:rID>
   {% if report_description.report_subjects %}
   <ei:reportSubject>
   {% for target in report_description.report_subjects %}