s2-python 0.0.1__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {s2_python-0.0.1.dist-info → s2_python-0.1.3.dist-info}/METADATA +37 -20
- s2_python-0.1.3.dist-info/RECORD +51 -0
- {s2_python-0.0.1.dist-info → s2_python-0.1.3.dist-info}/WHEEL +1 -1
- s2python/__init__.py +1 -1
- s2python/common/__init__.py +17 -16
- s2python/common/duration.py +3 -6
- s2python/common/handshake.py +6 -7
- s2python/common/handshake_response.py +6 -7
- s2python/common/instruction_status_update.py +8 -10
- s2python/common/number_range.py +10 -10
- s2python/common/power_forecast.py +7 -9
- s2python/common/power_forecast_element.py +4 -8
- s2python/common/power_forecast_value.py +2 -7
- s2python/common/power_measurement.py +7 -9
- s2python/common/power_range.py +6 -6
- s2python/common/power_value.py +2 -5
- s2python/common/reception_status.py +6 -9
- s2python/common/resource_manager_details.py +11 -10
- s2python/common/revoke_object.py +6 -8
- s2python/common/role.py +2 -5
- s2python/common/select_control_type.py +6 -7
- s2python/common/session_request.py +6 -7
- s2python/common/support.py +7 -5
- s2python/common/timer.py +2 -8
- s2python/common/transition.py +4 -15
- s2python/frbc/__init__.py +7 -7
- s2python/frbc/frbc_actuator_description.py +13 -13
- s2python/frbc/frbc_actuator_status.py +6 -17
- s2python/frbc/frbc_fill_level_target_profile.py +11 -11
- s2python/frbc/frbc_fill_level_target_profile_element.py +2 -6
- s2python/frbc/frbc_instruction.py +6 -10
- s2python/frbc/frbc_leakage_behaviour.py +9 -11
- s2python/frbc/frbc_leakage_behaviour_element.py +2 -5
- s2python/frbc/frbc_operation_mode.py +5 -9
- s2python/frbc/frbc_operation_mode_element.py +3 -6
- s2python/frbc/frbc_storage_description.py +2 -5
- s2python/frbc/frbc_storage_status.py +6 -7
- s2python/frbc/frbc_system_description.py +10 -9
- s2python/frbc/frbc_timer_status.py +6 -9
- s2python/frbc/frbc_usage_forecast.py +7 -9
- s2python/frbc/frbc_usage_forecast_element.py +2 -6
- s2python/generated/gen_s2.py +848 -833
- s2python/message.py +47 -0
- s2python/s2_parser.py +112 -0
- s2python/s2_validation_error.py +3 -1
- s2python/utils.py +7 -2
- s2python/validate_values_mixin.py +43 -25
- s2_python-0.0.1.dist-info/RECORD +0 -49
- {s2_python-0.0.1.dist-info → s2_python-0.1.3.dist-info}/entry_points.txt +0 -0
- {s2_python-0.0.1.dist-info → s2_python-0.1.3.dist-info}/top_level.txt +0 -0
s2python/common/support.py
CHANGED
@@ -1,25 +1,27 @@
|
|
1
|
-
from s2python.common import
|
1
|
+
from s2python.common import Commodity, CommodityQuantity
|
2
2
|
|
3
3
|
|
4
4
|
def commodity_has_quantity(commodity: "Commodity", quantity: CommodityQuantity) -> bool:
|
5
5
|
if commodity == Commodity.HEAT:
|
6
|
-
|
6
|
+
result = quantity in [
|
7
7
|
CommodityQuantity.HEAT_THERMAL_POWER,
|
8
8
|
CommodityQuantity.HEAT_TEMPERATURE,
|
9
9
|
CommodityQuantity.HEAT_FLOW_RATE,
|
10
10
|
]
|
11
11
|
elif commodity == Commodity.ELECTRICITY:
|
12
|
-
|
12
|
+
result = quantity in [
|
13
13
|
CommodityQuantity.ELECTRIC_POWER_3_PHASE_SYMMETRIC,
|
14
14
|
CommodityQuantity.ELECTRIC_POWER_L1,
|
15
15
|
CommodityQuantity.ELECTRIC_POWER_L2,
|
16
16
|
CommodityQuantity.ELECTRIC_POWER_L3,
|
17
17
|
]
|
18
18
|
elif commodity == Commodity.GAS:
|
19
|
-
|
19
|
+
result = quantity in [CommodityQuantity.NATURAL_GAS_FLOW_RATE]
|
20
20
|
elif commodity == Commodity.OIL:
|
21
|
-
|
21
|
+
result = quantity in [CommodityQuantity.OIL_FLOW_RATE]
|
22
22
|
else:
|
23
23
|
raise RuntimeError(
|
24
24
|
f"Unsupported commodity {commodity}. Missing implementation."
|
25
25
|
)
|
26
|
+
|
27
|
+
return result
|
s2python/common/timer.py
CHANGED
@@ -1,17 +1,11 @@
|
|
1
|
-
import uuid
|
2
|
-
|
3
1
|
from s2python.common.duration import Duration
|
4
2
|
from s2python.generated.gen_s2 import Timer as GenTimer
|
5
|
-
from s2python.validate_values_mixin import
|
6
|
-
ValidateValuesMixin,
|
7
|
-
catch_and_convert_exceptions,
|
8
|
-
)
|
3
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
9
4
|
|
10
5
|
|
11
6
|
@catch_and_convert_exceptions
|
12
|
-
class Timer(GenTimer,
|
7
|
+
class Timer(GenTimer, S2Message["Timer"]):
|
13
8
|
class Config(GenTimer.Config):
|
14
9
|
validate_assignment = True
|
15
10
|
|
16
|
-
id: uuid.UUID = GenTimer.__fields__["id"].field_info # type: ignore[assignment]
|
17
11
|
duration: Duration = GenTimer.__fields__["duration"].field_info # type: ignore[assignment]
|
s2python/common/transition.py
CHANGED
@@ -1,26 +1,15 @@
|
|
1
|
-
import
|
2
|
-
from typing import Optional, List
|
1
|
+
from typing import Optional
|
3
2
|
|
4
|
-
from s2python.common import Duration
|
3
|
+
from s2python.common.duration import Duration
|
5
4
|
from s2python.generated.gen_s2 import Transition as GenTransition
|
6
|
-
from s2python.validate_values_mixin import
|
7
|
-
ValidateValuesMixin,
|
8
|
-
catch_and_convert_exceptions,
|
9
|
-
)
|
5
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
10
6
|
|
11
7
|
|
12
8
|
@catch_and_convert_exceptions
|
13
|
-
class Transition(GenTransition,
|
9
|
+
class Transition(GenTransition, S2Message["Transition"]):
|
14
10
|
class Config(GenTransition.Config):
|
15
11
|
validate_assignment = True
|
16
12
|
|
17
|
-
id: uuid.UUID = GenTransition.__fields__["id"].field_info # type: ignore[assignment]
|
18
|
-
from_: uuid.UUID = GenTransition.__fields__["from_"].field_info # type: ignore[assignment]
|
19
|
-
to: uuid.UUID = GenTransition.__fields__["to"].field_info # type: ignore[assignment]
|
20
|
-
start_timers: List[uuid.UUID] = GenTransition.__fields__["start_timers"].field_info # type: ignore[assignment]
|
21
|
-
blocking_timers: List[uuid.UUID] = GenTransition.__fields__[
|
22
|
-
"blocking_timers"
|
23
|
-
].field_info # type: ignore[assignment]
|
24
13
|
transition_duration: Optional[Duration] = GenTransition.__fields__[
|
25
14
|
"transition_duration"
|
26
15
|
].field_info # type: ignore[assignment]
|
s2python/frbc/__init__.py
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
+
from s2python.frbc.frbc_actuator_description import FRBCActuatorDescription
|
2
|
+
from s2python.frbc.frbc_actuator_status import FRBCActuatorStatus
|
3
|
+
from s2python.frbc.frbc_fill_level_target_profile import FRBCFillLevelTargetProfile
|
1
4
|
from s2python.frbc.frbc_fill_level_target_profile_element import (
|
2
5
|
FRBCFillLevelTargetProfileElement,
|
3
6
|
)
|
4
|
-
from s2python.frbc.frbc_fill_level_target_profile import FRBCFillLevelTargetProfile
|
5
7
|
from s2python.frbc.frbc_instruction import FRBCInstruction
|
6
|
-
from s2python.frbc.frbc_leakage_behaviour_element import FRBCLeakageBehaviourElement
|
7
8
|
from s2python.frbc.frbc_leakage_behaviour import FRBCLeakageBehaviour
|
8
|
-
from s2python.frbc.
|
9
|
-
from s2python.frbc.frbc_usage_forecast import FRBCUsageForecast
|
10
|
-
from s2python.frbc.frbc_operation_mode_element import FRBCOperationModeElement
|
9
|
+
from s2python.frbc.frbc_leakage_behaviour_element import FRBCLeakageBehaviourElement
|
11
10
|
from s2python.frbc.frbc_operation_mode import FRBCOperationMode
|
12
|
-
from s2python.frbc.
|
13
|
-
from s2python.frbc.frbc_actuator_status import FRBCActuatorStatus
|
11
|
+
from s2python.frbc.frbc_operation_mode_element import FRBCOperationModeElement
|
14
12
|
from s2python.frbc.frbc_storage_description import FRBCStorageDescription
|
15
13
|
from s2python.frbc.frbc_storage_status import FRBCStorageStatus
|
16
14
|
from s2python.frbc.frbc_system_description import FRBCSystemDescription
|
17
15
|
from s2python.frbc.frbc_timer_status import FRBCTimerStatus
|
16
|
+
from s2python.frbc.frbc_usage_forecast import FRBCUsageForecast
|
17
|
+
from s2python.frbc.frbc_usage_forecast_element import FRBCUsageForecastElement
|
@@ -1,30 +1,24 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
from typing import List, Any, Dict
|
1
|
+
from typing import Any, Dict, List
|
4
2
|
|
5
3
|
from pydantic import root_validator
|
6
4
|
|
7
|
-
from s2python.common import
|
5
|
+
from s2python.common import Commodity, Timer, Transition
|
8
6
|
from s2python.common.support import commodity_has_quantity
|
9
|
-
from s2python.frbc import FRBCOperationMode
|
7
|
+
from s2python.frbc.frbc_operation_mode import FRBCOperationMode
|
8
|
+
from s2python.generated.gen_s2 import CommodityQuantity
|
10
9
|
from s2python.generated.gen_s2 import (
|
11
10
|
FRBCActuatorDescription as GenFRBCActuatorDescription,
|
12
|
-
CommodityQuantity,
|
13
|
-
)
|
14
|
-
from s2python.validate_values_mixin import (
|
15
|
-
ValidateValuesMixin,
|
16
|
-
catch_and_convert_exceptions,
|
17
11
|
)
|
12
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
18
13
|
|
19
14
|
|
20
15
|
@catch_and_convert_exceptions
|
21
16
|
class FRBCActuatorDescription(
|
22
|
-
GenFRBCActuatorDescription,
|
17
|
+
GenFRBCActuatorDescription, S2Message["FRBCActuatorDescription"]
|
23
18
|
):
|
24
19
|
class Config(GenFRBCActuatorDescription.Config):
|
25
20
|
validate_assignment = True
|
26
21
|
|
27
|
-
id: uuid.UUID = GenFRBCActuatorDescription.__fields__["id"].field_info # type: ignore[assignment]
|
28
22
|
operation_modes: List[FRBCOperationMode] = GenFRBCActuatorDescription.__fields__[
|
29
23
|
"operation_modes"
|
30
24
|
].field_info # type: ignore[assignment]
|
@@ -37,6 +31,7 @@ class FRBCActuatorDescription(
|
|
37
31
|
].field_info # type: ignore[assignment]
|
38
32
|
|
39
33
|
@root_validator(pre=False)
|
34
|
+
@classmethod
|
40
35
|
def validate_timers_in_transitions(cls, values: Dict[str, Any]) -> Dict[str, Any]:
|
41
36
|
timers_by_id = {timer.id: timer for timer in values.get("timers", {})}
|
42
37
|
transition: Transition
|
@@ -60,6 +55,7 @@ class FRBCActuatorDescription(
|
|
60
55
|
return values
|
61
56
|
|
62
57
|
@root_validator(pre=False)
|
58
|
+
@classmethod
|
63
59
|
def validate_timers_unique_ids(cls, values: Dict[str, Any]) -> Dict[str, Any]:
|
64
60
|
ids = []
|
65
61
|
timer: Timer
|
@@ -73,6 +69,7 @@ class FRBCActuatorDescription(
|
|
73
69
|
return values
|
74
70
|
|
75
71
|
@root_validator(pre=False)
|
72
|
+
@classmethod
|
76
73
|
def validate_operation_modes_in_transitions(
|
77
74
|
cls, values: Dict[str, Any]
|
78
75
|
) -> Dict[str, Any]:
|
@@ -99,6 +96,7 @@ class FRBCActuatorDescription(
|
|
99
96
|
return values
|
100
97
|
|
101
98
|
@root_validator(pre=False)
|
99
|
+
@classmethod
|
102
100
|
def validate_operation_modes_unique_ids(
|
103
101
|
cls, values: Dict[str, Any]
|
104
102
|
) -> Dict[str, Any]:
|
@@ -115,6 +113,7 @@ class FRBCActuatorDescription(
|
|
115
113
|
return values
|
116
114
|
|
117
115
|
@root_validator(pre=False)
|
116
|
+
@classmethod
|
118
117
|
def validate_operation_mode_elements_have_all_supported_commodities(
|
119
118
|
cls, values: Dict[str, Any]
|
120
119
|
) -> Dict[str, Any]:
|
@@ -148,10 +147,11 @@ class FRBCActuatorDescription(
|
|
148
147
|
return values
|
149
148
|
|
150
149
|
@root_validator(pre=False)
|
150
|
+
@classmethod
|
151
151
|
def validate_unique_supported_commodities(
|
152
152
|
cls, values: Dict[str, Any]
|
153
153
|
) -> Dict[str, Any]:
|
154
|
-
supported_commodities:
|
154
|
+
supported_commodities: List[CommodityQuantity] = values.get(
|
155
155
|
"supported_commodities", []
|
156
156
|
)
|
157
157
|
|
@@ -1,25 +1,14 @@
|
|
1
|
-
from typing import
|
2
|
-
|
1
|
+
from typing import Literal
|
2
|
+
|
3
|
+
from pydantic import Field
|
3
4
|
|
4
5
|
from s2python.generated.gen_s2 import FRBCActuatorStatus as GenFRBCActuatorStatus
|
5
|
-
from s2python.validate_values_mixin import
|
6
|
-
catch_and_convert_exceptions,
|
7
|
-
ValidateValuesMixin,
|
8
|
-
)
|
6
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
9
7
|
|
10
8
|
|
11
9
|
@catch_and_convert_exceptions
|
12
|
-
class FRBCActuatorStatus(
|
13
|
-
GenFRBCActuatorStatus, ValidateValuesMixin["FRBCActuatorStatus"]
|
14
|
-
):
|
10
|
+
class FRBCActuatorStatus(GenFRBCActuatorStatus, S2Message["FRBCActuatorStatus"]):
|
15
11
|
class Config(GenFRBCActuatorStatus.Config):
|
16
12
|
validate_assignment = True
|
17
13
|
|
18
|
-
|
19
|
-
"active_operation_mode_id"
|
20
|
-
].field_info # type: ignore[assignment]
|
21
|
-
actuator_id: uuid.UUID = GenFRBCActuatorStatus.__fields__["actuator_id"].field_info # type: ignore[assignment]
|
22
|
-
message_id: uuid.UUID = GenFRBCActuatorStatus.__fields__["message_id"].field_info # type: ignore[assignment]
|
23
|
-
previous_operation_mode_id: Optional[uuid.UUID] = GenFRBCActuatorStatus.__fields__[
|
24
|
-
"previous_operation_mode_id"
|
25
|
-
].field_info # type: ignore[assignment]
|
14
|
+
message_type: Literal["FRBC.ActuatorStatus"] = Field(default="FRBC.ActuatorStatus")
|
@@ -1,19 +1,19 @@
|
|
1
|
-
from typing import List
|
2
|
-
import uuid
|
1
|
+
from typing import List, Literal
|
3
2
|
|
4
|
-
from
|
3
|
+
from pydantic import Field
|
4
|
+
|
5
|
+
from s2python.frbc.frbc_fill_level_target_profile_element import (
|
6
|
+
FRBCFillLevelTargetProfileElement,
|
7
|
+
)
|
5
8
|
from s2python.generated.gen_s2 import (
|
6
9
|
FRBCFillLevelTargetProfile as GenFRBCFillLevelTargetProfile,
|
7
10
|
)
|
8
|
-
from s2python.validate_values_mixin import
|
9
|
-
catch_and_convert_exceptions,
|
10
|
-
ValidateValuesMixin,
|
11
|
-
)
|
11
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
12
12
|
|
13
13
|
|
14
14
|
@catch_and_convert_exceptions
|
15
15
|
class FRBCFillLevelTargetProfile(
|
16
|
-
GenFRBCFillLevelTargetProfile,
|
16
|
+
GenFRBCFillLevelTargetProfile, S2Message["FRBCFillLevelTargetProfile"]
|
17
17
|
):
|
18
18
|
class Config(GenFRBCFillLevelTargetProfile.Config):
|
19
19
|
validate_assignment = True
|
@@ -23,6 +23,6 @@ class FRBCFillLevelTargetProfile(
|
|
23
23
|
] = GenFRBCFillLevelTargetProfile.__fields__[
|
24
24
|
"elements"
|
25
25
|
].field_info # type: ignore[assignment]
|
26
|
-
|
27
|
-
"
|
28
|
-
|
26
|
+
message_type: Literal["FRBC.FillLevelTargetProfile"] = Field(
|
27
|
+
default="FRBC.FillLevelTargetProfile"
|
28
|
+
)
|
@@ -1,18 +1,14 @@
|
|
1
1
|
from s2python.common import Duration, NumberRange
|
2
|
-
|
3
2
|
from s2python.generated.gen_s2 import (
|
4
3
|
FRBCFillLevelTargetProfileElement as GenFRBCFillLevelTargetProfileElement,
|
5
4
|
)
|
6
|
-
from s2python.validate_values_mixin import
|
7
|
-
catch_and_convert_exceptions,
|
8
|
-
ValidateValuesMixin,
|
9
|
-
)
|
5
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
10
6
|
|
11
7
|
|
12
8
|
@catch_and_convert_exceptions
|
13
9
|
class FRBCFillLevelTargetProfileElement(
|
14
10
|
GenFRBCFillLevelTargetProfileElement,
|
15
|
-
|
11
|
+
S2Message["FRBCFillLevelTargetProfileElement"],
|
16
12
|
):
|
17
13
|
class Config(GenFRBCFillLevelTargetProfileElement.Config):
|
18
14
|
validate_assignment = True
|
@@ -1,18 +1,14 @@
|
|
1
|
-
import
|
1
|
+
from typing import Literal
|
2
|
+
|
3
|
+
from pydantic import Field
|
2
4
|
|
3
5
|
from s2python.generated.gen_s2 import FRBCInstruction as GenFRBCInstruction
|
4
|
-
from s2python.validate_values_mixin import
|
5
|
-
catch_and_convert_exceptions,
|
6
|
-
ValidateValuesMixin,
|
7
|
-
)
|
6
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
8
7
|
|
9
8
|
|
10
9
|
@catch_and_convert_exceptions
|
11
|
-
class FRBCInstruction(GenFRBCInstruction,
|
10
|
+
class FRBCInstruction(GenFRBCInstruction, S2Message["FRBCInstruction"]):
|
12
11
|
class Config(GenFRBCInstruction.Config):
|
13
12
|
validate_assignment = True
|
14
13
|
|
15
|
-
|
16
|
-
id: uuid.UUID = GenFRBCInstruction.__fields__["id"].field_info # type: ignore[assignment]
|
17
|
-
message_id: uuid.UUID = GenFRBCInstruction.__fields__["message_id"].field_info # type: ignore[assignment]
|
18
|
-
operation_mode: uuid.UUID = GenFRBCInstruction.__fields__["operation_mode"].field_info # type: ignore[assignment]
|
14
|
+
message_type: Literal["FRBC.Instruction"] = Field(default="FRBC.Instruction")
|
@@ -1,22 +1,20 @@
|
|
1
|
-
from typing import List
|
2
|
-
import uuid
|
1
|
+
from typing import List, Literal
|
3
2
|
|
4
|
-
from
|
3
|
+
from pydantic import Field
|
4
|
+
|
5
|
+
from s2python.frbc.frbc_leakage_behaviour_element import FRBCLeakageBehaviourElement
|
5
6
|
from s2python.generated.gen_s2 import FRBCLeakageBehaviour as GenFRBCLeakageBehaviour
|
6
|
-
from s2python.validate_values_mixin import
|
7
|
-
catch_and_convert_exceptions,
|
8
|
-
ValidateValuesMixin,
|
9
|
-
)
|
7
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
10
8
|
|
11
9
|
|
12
10
|
@catch_and_convert_exceptions
|
13
|
-
class FRBCLeakageBehaviour(
|
14
|
-
GenFRBCLeakageBehaviour, ValidateValuesMixin["FRBCLeakageBehaviour"]
|
15
|
-
):
|
11
|
+
class FRBCLeakageBehaviour(GenFRBCLeakageBehaviour, S2Message["FRBCLeakageBehaviour"]):
|
16
12
|
class Config(GenFRBCLeakageBehaviour.Config):
|
17
13
|
validate_assignment = True
|
18
14
|
|
19
15
|
elements: List[FRBCLeakageBehaviourElement] = GenFRBCLeakageBehaviour.__fields__[
|
20
16
|
"elements"
|
21
17
|
].field_info # type: ignore[assignment]
|
22
|
-
|
18
|
+
message_type: Literal["FRBC.LeakageBehaviour"] = Field(
|
19
|
+
default="FRBC.LeakageBehaviour"
|
20
|
+
)
|
@@ -2,15 +2,12 @@ from s2python.common import NumberRange
|
|
2
2
|
from s2python.generated.gen_s2 import (
|
3
3
|
FRBCLeakageBehaviourElement as GenFRBCLeakageBehaviourElement,
|
4
4
|
)
|
5
|
-
from s2python.validate_values_mixin import
|
6
|
-
catch_and_convert_exceptions,
|
7
|
-
ValidateValuesMixin,
|
8
|
-
)
|
5
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
9
6
|
|
10
7
|
|
11
8
|
@catch_and_convert_exceptions
|
12
9
|
class FRBCLeakageBehaviourElement(
|
13
|
-
GenFRBCLeakageBehaviourElement,
|
10
|
+
GenFRBCLeakageBehaviourElement, S2Message["FRBCLeakageBehaviourElement"]
|
14
11
|
):
|
15
12
|
class Config(GenFRBCLeakageBehaviourElement.Config):
|
16
13
|
validate_assignment = True
|
@@ -1,30 +1,26 @@
|
|
1
1
|
# from itertools import pairwise
|
2
|
-
import
|
3
|
-
from typing import List, Dict, Any, Generator, Tuple
|
2
|
+
from typing import Any, Dict, List
|
4
3
|
|
5
4
|
from pydantic import root_validator
|
6
5
|
|
7
6
|
from s2python.common import NumberRange
|
8
|
-
from s2python.frbc import FRBCOperationModeElement
|
7
|
+
from s2python.frbc.frbc_operation_mode_element import FRBCOperationModeElement
|
9
8
|
from s2python.generated.gen_s2 import FRBCOperationMode as GenFRBCOperationMode
|
10
|
-
from s2python.validate_values_mixin import (
|
11
|
-
ValidateValuesMixin,
|
12
|
-
catch_and_convert_exceptions,
|
13
|
-
)
|
14
9
|
from s2python.utils import pairwise
|
10
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
15
11
|
|
16
12
|
|
17
13
|
@catch_and_convert_exceptions
|
18
|
-
class FRBCOperationMode(GenFRBCOperationMode,
|
14
|
+
class FRBCOperationMode(GenFRBCOperationMode, S2Message["FRBCOperationMode"]):
|
19
15
|
class Config(GenFRBCOperationMode.Config):
|
20
16
|
validate_assignment = True
|
21
17
|
|
22
|
-
id: uuid.UUID = GenFRBCOperationMode.__fields__["id"].field_info # type: ignore[assignment]
|
23
18
|
elements: List[FRBCOperationModeElement] = GenFRBCOperationMode.__fields__[
|
24
19
|
"elements"
|
25
20
|
].field_info # type: ignore[assignment]
|
26
21
|
|
27
22
|
@root_validator(pre=False)
|
23
|
+
@classmethod
|
28
24
|
def validate_contiguous_fill_levels_operation_mode_elements(
|
29
25
|
cls, values: Dict[str, Any]
|
30
26
|
) -> Dict[str, Any]:
|
@@ -1,18 +1,15 @@
|
|
1
|
-
from typing import
|
1
|
+
from typing import List, Optional
|
2
2
|
|
3
3
|
from s2python.common import NumberRange, PowerRange
|
4
4
|
from s2python.generated.gen_s2 import (
|
5
5
|
FRBCOperationModeElement as GenFRBCOperationModeElement,
|
6
6
|
)
|
7
|
-
from s2python.validate_values_mixin import
|
8
|
-
ValidateValuesMixin,
|
9
|
-
catch_and_convert_exceptions,
|
10
|
-
)
|
7
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
11
8
|
|
12
9
|
|
13
10
|
@catch_and_convert_exceptions
|
14
11
|
class FRBCOperationModeElement(
|
15
|
-
GenFRBCOperationModeElement,
|
12
|
+
GenFRBCOperationModeElement, S2Message["FRBCOperationModeElement"]
|
16
13
|
):
|
17
14
|
class Config(GenFRBCOperationModeElement.Config):
|
18
15
|
validate_assignment = True
|
@@ -2,15 +2,12 @@ from s2python.common import NumberRange
|
|
2
2
|
from s2python.generated.gen_s2 import (
|
3
3
|
FRBCStorageDescription as GenFRBCStorageDescription,
|
4
4
|
)
|
5
|
-
from s2python.validate_values_mixin import
|
6
|
-
catch_and_convert_exceptions,
|
7
|
-
ValidateValuesMixin,
|
8
|
-
)
|
5
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
9
6
|
|
10
7
|
|
11
8
|
@catch_and_convert_exceptions
|
12
9
|
class FRBCStorageDescription(
|
13
|
-
GenFRBCStorageDescription,
|
10
|
+
GenFRBCStorageDescription, S2Message["FRBCStorageDescription"]
|
14
11
|
):
|
15
12
|
class Config(GenFRBCStorageDescription.Config):
|
16
13
|
validate_assignment = True
|
@@ -1,15 +1,14 @@
|
|
1
|
-
import
|
1
|
+
from typing import Literal
|
2
|
+
|
3
|
+
from pydantic import Field
|
2
4
|
|
3
5
|
from s2python.generated.gen_s2 import FRBCStorageStatus as GenFRBCStorageStatus
|
4
|
-
from s2python.validate_values_mixin import
|
5
|
-
catch_and_convert_exceptions,
|
6
|
-
ValidateValuesMixin,
|
7
|
-
)
|
6
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
8
7
|
|
9
8
|
|
10
9
|
@catch_and_convert_exceptions
|
11
|
-
class FRBCStorageStatus(GenFRBCStorageStatus,
|
10
|
+
class FRBCStorageStatus(GenFRBCStorageStatus, S2Message["FRBCStorageStatus"]):
|
12
11
|
class Config(GenFRBCStorageStatus.Config):
|
13
12
|
validate_assignment = True
|
14
13
|
|
15
|
-
|
14
|
+
message_type: Literal["FRBC.StorageStatus"] = Field(default="FRBC.StorageStatus")
|
@@ -1,17 +1,16 @@
|
|
1
|
-
from typing import List
|
2
|
-
import uuid
|
1
|
+
from typing import List, Literal
|
3
2
|
|
3
|
+
from pydantic import Field
|
4
|
+
|
5
|
+
from s2python.frbc.frbc_actuator_description import FRBCActuatorDescription
|
6
|
+
from s2python.frbc.frbc_storage_description import FRBCStorageDescription
|
4
7
|
from s2python.generated.gen_s2 import FRBCSystemDescription as GenFRBCSystemDescription
|
5
|
-
from s2python.validate_values_mixin import
|
6
|
-
catch_and_convert_exceptions,
|
7
|
-
ValidateValuesMixin,
|
8
|
-
)
|
9
|
-
from s2python.frbc import FRBCActuatorDescription, FRBCStorageDescription
|
8
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
10
9
|
|
11
10
|
|
12
11
|
@catch_and_convert_exceptions
|
13
12
|
class FRBCSystemDescription(
|
14
|
-
GenFRBCSystemDescription,
|
13
|
+
GenFRBCSystemDescription, S2Message["FRBCSystemDescription"]
|
15
14
|
):
|
16
15
|
class Config(GenFRBCSystemDescription.Config):
|
17
16
|
validate_assignment = True
|
@@ -19,7 +18,9 @@ class FRBCSystemDescription(
|
|
19
18
|
actuators: List[FRBCActuatorDescription] = GenFRBCSystemDescription.__fields__[
|
20
19
|
"actuators"
|
21
20
|
].field_info # type: ignore[assignment]
|
22
|
-
message_id: uuid.UUID = GenFRBCSystemDescription.__fields__["message_id"].field_info # type: ignore[assignment]
|
23
21
|
storage: FRBCStorageDescription = GenFRBCSystemDescription.__fields__[
|
24
22
|
"storage"
|
25
23
|
].field_info # type: ignore[assignment]
|
24
|
+
message_type: Literal["FRBC.SystemDescription"] = Field(
|
25
|
+
default="FRBC.SystemDescription"
|
26
|
+
)
|
@@ -1,17 +1,14 @@
|
|
1
|
-
import
|
1
|
+
from typing import Literal
|
2
|
+
|
3
|
+
from pydantic import Field
|
2
4
|
|
3
5
|
from s2python.generated.gen_s2 import FRBCTimerStatus as GenFRBCTimerStatus
|
4
|
-
from s2python.validate_values_mixin import
|
5
|
-
catch_and_convert_exceptions,
|
6
|
-
ValidateValuesMixin,
|
7
|
-
)
|
6
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
8
7
|
|
9
8
|
|
10
9
|
@catch_and_convert_exceptions
|
11
|
-
class FRBCTimerStatus(GenFRBCTimerStatus,
|
10
|
+
class FRBCTimerStatus(GenFRBCTimerStatus, S2Message["FRBCTimerStatus"]):
|
12
11
|
class Config(GenFRBCTimerStatus.Config):
|
13
12
|
validate_assignment = True
|
14
13
|
|
15
|
-
|
16
|
-
message_id: uuid.UUID = GenFRBCTimerStatus.__fields__["message_id"].field_info # type: ignore[assignment]
|
17
|
-
timer_id: uuid.UUID = GenFRBCTimerStatus.__fields__["timer_id"].field_info # type: ignore[assignment]
|
14
|
+
message_type: Literal["FRBC.TimerStatus"] = Field(default="FRBC.TimerStatus")
|
@@ -1,20 +1,18 @@
|
|
1
|
-
from typing import List
|
2
|
-
import uuid
|
1
|
+
from typing import List, Literal
|
3
2
|
|
3
|
+
from pydantic import Field
|
4
|
+
|
5
|
+
from s2python.frbc.frbc_usage_forecast_element import FRBCUsageForecastElement
|
4
6
|
from s2python.generated.gen_s2 import FRBCUsageForecast as GenFRBCUsageForecast
|
5
|
-
from s2python.validate_values_mixin import
|
6
|
-
catch_and_convert_exceptions,
|
7
|
-
ValidateValuesMixin,
|
8
|
-
)
|
9
|
-
from s2python.frbc import FRBCUsageForecastElement
|
7
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
10
8
|
|
11
9
|
|
12
10
|
@catch_and_convert_exceptions
|
13
|
-
class FRBCUsageForecast(GenFRBCUsageForecast,
|
11
|
+
class FRBCUsageForecast(GenFRBCUsageForecast, S2Message["FRBCUsageForecast"]):
|
14
12
|
class Config(GenFRBCUsageForecast.Config):
|
15
13
|
validate_assignment = True
|
16
14
|
|
17
15
|
elements: List[FRBCUsageForecastElement] = GenFRBCUsageForecast.__fields__[
|
18
16
|
"elements"
|
19
17
|
].field_info # type: ignore[assignment]
|
20
|
-
|
18
|
+
message_type: Literal["FRBC.UsageForecast"] = Field(default="FRBC.UsageForecast")
|
@@ -1,17 +1,13 @@
|
|
1
1
|
from s2python.common import Duration
|
2
|
-
|
3
2
|
from s2python.generated.gen_s2 import (
|
4
3
|
FRBCUsageForecastElement as GenFRBCUsageForecastElement,
|
5
4
|
)
|
6
|
-
from s2python.validate_values_mixin import
|
7
|
-
catch_and_convert_exceptions,
|
8
|
-
ValidateValuesMixin,
|
9
|
-
)
|
5
|
+
from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
|
10
6
|
|
11
7
|
|
12
8
|
@catch_and_convert_exceptions
|
13
9
|
class FRBCUsageForecastElement(
|
14
|
-
GenFRBCUsageForecastElement,
|
10
|
+
GenFRBCUsageForecastElement, S2Message["FRBCUsageForecastElement"]
|
15
11
|
):
|
16
12
|
class Config(GenFRBCUsageForecastElement.Config):
|
17
13
|
validate_assignment = True
|