@@ -41,11 +41,11 @@ def create_device_capability(end_device_index: int) -> m.DeviceCapability:
41
41
42
42
def add_enddevice (device : m .EndDevice ) -> m .EndDevice :
43
43
"""Populates links to EndDevice resources and adds it to the EndDeviceAdapter.
44
-
44
+
45
45
If the link is to a single writable (by the client) resource then create the link
46
46
and the resource with default data. Otherwise, the link will be to a list. It is
47
47
expected that the list will be populated at a later point in time in the code execution.
48
-
48
+
49
49
The enddevice is added to the enddevice adapter, and the following links are created and added to the enddevice:
50
50
51
51
- `DERListLink`: A link to the DER list for the enddevice
@@ -89,7 +89,7 @@ def add_enddevice(device: m.EndDevice) -> m.EndDevice:
89
89
90
90
def update_active_der_event_started (event : m .Event ):
91
91
"""Event triggered when a DERControl event starts
92
-
92
+
93
93
Find the control and copy it to the ActiveDERControlList
94
94
95
95
:param event: The control event
@@ -125,7 +125,7 @@ def update_active_der_event_started(event: m.Event):
125
125
126
126
def update_active_der_event_ended (event : m .Event ):
127
127
"""Event triggered when a DERControl event ends
128
-
128
+
129
129
Search over the ActiveDERControlListLink for the event that has been triggered
130
130
and remove it from the list.
131
131
@@ -165,23 +165,23 @@ def update_active_der_event_ended(event: m.Event):
165
165
166
166
167
167
def initialize_2030_5 (config : ServerConfiguration , tlsrepo : TLSRepository ):
168
- """Initialize the 2030.5 server.
169
-
168
+ """Initialize the 2030.5 server.
169
+
170
170
This method initializes the adapters from the configuration objects into
171
171
the persistence adapters.
172
-
172
+
173
173
The adapters are:
174
-
174
+
175
175
- EndDeviceAdapter
176
176
- DERAdapter
177
177
- DERCurveAdapter
178
178
- DERProgramAdapter
179
179
- FunctionSetAssignmentsAdapter
180
-
180
+
181
181
The EndDevices in the EndDeviceAdapter will link to Lists of other types. Those
182
182
Lists will be stored in the ListAdapter object under the List's href (see below /edev_0_der).
183
183
As an example the following, note the DER href is not /edev_0_der_0, but /der_12 instead.
184
-
184
+
185
185
<EndDevice href="/edev_0">
186
186
<DERList href="/edev_0_der" all="1">
187
187
</EndDevice>
@@ -190,8 +190,8 @@ def initialize_2030_5(config: ServerConfiguration, tlsrepo: TLSRepository):
190
190
...
191
191
</DER>
192
192
</DERList
193
-
194
-
193
+
194
+
195
195
"""
196
196
_log .debug ("Initializing 2030.5" )
197
197
_log .debug ("Adding server level urls to cache" )
@@ -227,8 +227,13 @@ def initialize_2030_5(config: ServerConfiguration, tlsrepo: TLSRepository):
227
227
else :
228
228
default_der_control .DERControlBase = m .DERControlBase (** der_control_base )
229
229
adpt .ListAdapter .initialize_uri (program .DERControlListLink .href , m .DERControl )
230
+
231
+
230
232
add_href (program .DefaultDERControlLink .href , default_der_control )
231
233
add_href (program .ActiveDERControlListLink .href , m .DERControlList (DERControl = []))
234
+ add_href (program .DERCurveListLink .href , m .DERCurveList (DERCurve = []))
235
+ add_href (program .DERControlListLink .href , m .DERControlList (DERControl = []))
236
+
232
237
233
238
programs_by_description [program .description ] = program
234
239
0 commit comments