Skip to content

Commit f627072

Browse files
authored
Moved defaults to SiteControlGroup (#58)
* Moved defaults to SiteControlGroup * Removed experimental test
1 parent 9f1589d commit f627072

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

src/envoy_schema/admin/schema/config.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,9 @@
11
from datetime import datetime
2-
from decimal import Decimal
32
from typing import Optional
43

54
from pydantic import BaseModel
65

76

8-
class UpdateDefaultValue(BaseModel):
9-
"""Used to allow the setting of None or a specific value"""
10-
11-
value: Optional[Decimal] # The decimal value to update (or None to update the value to None)
12-
13-
14-
class ControlDefaultRequest(BaseModel):
15-
"""Used for updating the "failover" SiteControl defaults that are used if no specific control is active"""
16-
17-
import_limit_watts: Optional[
18-
UpdateDefaultValue
19-
] # If set - update The default "import limit watts" used in absence of an active control
20-
export_limit_watts: Optional[
21-
UpdateDefaultValue
22-
] # If set - update The default "export limit watts" used in absence of an active control
23-
generation_limit_watts: Optional[
24-
UpdateDefaultValue
25-
] # If set - update The default "generation limit watts" used in absence of an active control
26-
load_limit_watts: Optional[
27-
UpdateDefaultValue
28-
] # If set - update The default "export limit watts" used in absence of an active control
29-
ramp_rate_percent_per_second: Optional[
30-
UpdateDefaultValue
31-
] # If set - update The default ramp rate expressed in a percent of max W per second
32-
33-
34-
class ControlDefaultResponse(BaseModel):
35-
"""Snapshot of the current "failover" SiteControl defaults that are used if no specific control is active"""
36-
37-
server_default_import_limit_watts: Optional[Decimal] # None means NO default
38-
server_default_export_limit_watts: Optional[Decimal]
39-
server_default_generation_limit_watts: Optional[Decimal]
40-
server_default_load_limit_watts: Optional[Decimal]
41-
ramp_rate_percent_per_second: Optional[Decimal]
42-
43-
created_time: datetime
44-
changed_time: datetime
45-
46-
477
class RuntimeServerConfigRequest(BaseModel):
488
"""Used for updating the server configuration associated with runtime behavior"""
499

src/envoy_schema/admin/schema/site_control.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,43 @@ class SiteControlGroupPageResponse(BaseModel):
7878
start: int # The number of groups that have been skipped as part of this query (the start set by the query)
7979
after: Optional[datetime] # The "after" filter set by the query
8080
site_control_groups: list[SiteControlGroupResponse] # The control group models in this paged response
81+
82+
83+
class UpdateDefaultValue(BaseModel):
84+
"""Used to allow the setting of None or a specific value"""
85+
86+
value: Optional[Decimal] # The decimal value to update (or None to update the value to None)
87+
88+
89+
class SiteControlGroupDefaultRequest(BaseModel):
90+
"""Used for updating fields associated with the SiteControlGroupDefault values - used when there is no active
91+
control"""
92+
93+
import_limit_watts: Optional[
94+
UpdateDefaultValue
95+
] # If set - update The default "import limit watts" used in absence of an active control
96+
export_limit_watts: Optional[
97+
UpdateDefaultValue
98+
] # If set - update The default "export limit watts" used in absence of an active control
99+
generation_limit_watts: Optional[
100+
UpdateDefaultValue
101+
] # If set - update The default "generation limit watts" used in absence of an active control
102+
load_limit_watts: Optional[
103+
UpdateDefaultValue
104+
] # If set - update The default "export limit watts" used in absence of an active control
105+
ramp_rate_percent_per_second: Optional[
106+
UpdateDefaultValue
107+
] # If set - update The default ramp rate expressed in a percent of max W per second
108+
109+
110+
class SiteControlGroupDefaultResponse(BaseModel):
111+
"""Snapshot of the current SiteControlGroupDefault values that are used if no specific control is active"""
112+
113+
server_default_import_limit_watts: Optional[Decimal] # None means NO default
114+
server_default_export_limit_watts: Optional[Decimal]
115+
server_default_generation_limit_watts: Optional[Decimal]
116+
server_default_load_limit_watts: Optional[Decimal]
117+
ramp_rate_percent_per_second: Optional[Decimal]
118+
119+
created_time: datetime
120+
changed_time: datetime

src/envoy_schema/admin/schema/uri.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
DoeUri = "/doe"
2323
SiteListUri = "/site"
2424
SiteUri = "/site/{site_id}" # Supports updating/deleting single sites
25-
SiteControlDefaultConfigUri = "/site/{site_id}/control_default" # For managing ControlDefaultConfig per site
2625
SiteGroupUri = "/site_group/{group_name}"
2726
SiteGroupListUri = "/site_group"
2827
CSIPAusSiteReadingUri = "/site_readings/{site_id}/csip_aus_unit/{unit_enum}/period/{period_start}/{period_end}"
@@ -35,6 +34,7 @@
3534

3635
SiteControlGroupListUri = "/site_control_group" # Fetching / Adding site control groups
3736
SiteControlGroupUri = "/site_control_group/{group_id}" # Fetching / Changing site control groups
37+
SiteControlGroupDefaultUri = "/site_control_group/{group_id}/default" # Changing defaults for a site control group
3838
SiteControlUri = "/site_control_group/{group_id}/controls" # Fetching / Adding site controls (under a group)
3939
SiteControlRangeUri = "/site_control_group/{group_id}/controls/{period_start}/{period_end}" # Fetching/deleting controls that start in range # noqa: E501
4040

0 commit comments

Comments
 (0)