Skip to content

Commit

Permalink
Update to support fsa for ders.
Browse files Browse the repository at this point in the history
  • Loading branch information
craig8 committed Sep 14, 2024
1 parent 4522445 commit 578a0b0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions ieee_2030_5/hrefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
DERC = "derc"
DDERC = "dderc"
DERCA = "derca"
DERCURVE = "dc"
FSA = "fsa"
TIME = "tm"

Expand Down
2 changes: 2 additions & 0 deletions ieee_2030_5/server/derfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ def get(self) -> Response:
retval = adpt.ListAdapter.get_resource_list(request.path, start, after, limit)
elif parsed.at(2) == hrefs.DDERC:
retval = adpt.ListAdapter.get_single(request.path)
elif parsed.at(2) == hrefs.DERCURVE:
retval = adpt.ListAdapter.get_resource_list(request.path, start, after, limit)
# elif parsed.at(2) == hrefs.DDERC:
# retval = adpt.DERControlAdapter.fetch_at(parsed.at(3))
else:
Expand Down
10 changes: 5 additions & 5 deletions ieee_2030_5/server/server_constructs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from ieee_2030_5.certs import TLSRepository, lfdi_from_fingerprint
from ieee_2030_5.config import ServerConfiguration, DeviceConfiguration
from ieee_2030_5.data.indexer import add_href, get_href
from ieee_2030_5.utils.tls_wrapper import OpensslWrapper

_log = logging.getLogger(__name__)

Expand Down Expand Up @@ -182,10 +181,11 @@ def create_der_program_and_control(default_der_program: m.DERProgram,
derp.ActiveDERControlListLink = m.ActiveDERControlListLink(program_hrefs.active_control_href)
derp.DefaultDERControlLink = m.DefaultDERControlLink(program_hrefs.default_control_href)
derp.DERControlListLink = m.DERControlListLink(program_hrefs.der_control_list_href)
# derp.DERCurveListLink = m.DERCurveListLink(program_hrefs.der_curve_list_href)
derp.DERCurveListLink = m.DERCurveListLink(program_hrefs.der_curve_list_href)

dderc.href = derp.DefaultDERControlLink.href

adpt.ListAdapter.initialize_uri(program_hrefs.der_curve_list_href, m.DERCurve)
adpt.ListAdapter.append(hrefs.DEFAULT_DDERC_ROOT, dderc)
adpt.ListAdapter.append(hrefs.DEFAULT_DERP_ROOT, derp)
return derp, dderc
Expand Down Expand Up @@ -402,10 +402,10 @@ def initialize_2030_5(config: ServerConfiguration, tlsrepo: TLSRepository):
adpt.ListAdapter.set_single(obj=dderc, uri=dderc.href)
derp_derc_list_href = hrefs.SEP.join((derp.href, "derc"))
adpt.ListAdapter.initialize_uri(list_uri=derp_derc_list_href, obj=m.DERControl)
derp_derc: m.DERControl = m.DERControl(DERControlBase=dderc.DERControlBase)
adpt.ListAdapter.append(list_uri=derp_derc_list_href, obj=derp_derc)
#derp_derc: m.DERControl = m.DERControl(DERControlBase=dderc.DERControlBase)
#adpt.ListAdapter.append(list_uri=derp_derc_list_href, obj=derp_derc)

adpt.ListAdapter.set_single(uri=derp_derc.href, obj=derp_derc)
#adpt.ListAdapter.set_single(uri=derp_derc.href, obj=derp_derc)

if fsa_list := adpt.ListAdapter.get_list(ed_href.function_set_assignments):
# Create a new der program for this specific fsa
Expand Down

0 comments on commit 578a0b0

Please sign in to comment.