|
1 | 1 | from datetime import datetime |
2 | | -from decimal import Decimal |
3 | 2 | from typing import Optional |
4 | 3 |
|
5 | 4 | from pydantic import BaseModel |
6 | 5 |
|
7 | 6 |
|
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 | | - |
47 | 7 | class RuntimeServerConfigRequest(BaseModel): |
48 | 8 | """Used for updating the server configuration associated with runtime behavior""" |
49 | 9 |
|
|
0 commit comments