s2-python 0.1.0__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.
Files changed (48) hide show
  1. {s2_python-0.1.0.dist-info → s2_python-0.1.3.dist-info}/METADATA +20 -19
  2. s2_python-0.1.3.dist-info/RECORD +51 -0
  3. {s2_python-0.1.0.dist-info → s2_python-0.1.3.dist-info}/WHEEL +1 -1
  4. s2python/common/__init__.py +17 -16
  5. s2python/common/duration.py +2 -5
  6. s2python/common/handshake.py +5 -6
  7. s2python/common/handshake_response.py +5 -6
  8. s2python/common/instruction_status_update.py +7 -9
  9. s2python/common/number_range.py +1 -4
  10. s2python/common/power_forecast.py +5 -7
  11. s2python/common/power_forecast_element.py +2 -5
  12. s2python/common/power_forecast_value.py +1 -4
  13. s2python/common/power_measurement.py +5 -7
  14. s2python/common/power_range.py +1 -4
  15. s2python/common/power_value.py +1 -4
  16. s2python/common/reception_status.py +5 -8
  17. s2python/common/resource_manager_details.py +8 -8
  18. s2python/common/revoke_object.py +5 -7
  19. s2python/common/role.py +1 -4
  20. s2python/common/select_control_type.py +5 -6
  21. s2python/common/session_request.py +5 -6
  22. s2python/common/support.py +1 -1
  23. s2python/common/timer.py +1 -7
  24. s2python/common/transition.py +2 -13
  25. s2python/frbc/__init__.py +7 -7
  26. s2python/frbc/frbc_actuator_description.py +4 -10
  27. s2python/frbc/frbc_actuator_status.py +5 -14
  28. s2python/frbc/frbc_fill_level_target_profile.py +7 -9
  29. s2python/frbc/frbc_fill_level_target_profile_element.py +1 -5
  30. s2python/frbc/frbc_instruction.py +5 -9
  31. s2python/frbc/frbc_leakage_behaviour.py +7 -7
  32. s2python/frbc/frbc_leakage_behaviour_element.py +1 -4
  33. s2python/frbc/frbc_operation_mode.py +2 -7
  34. s2python/frbc/frbc_operation_mode_element.py +2 -5
  35. s2python/frbc/frbc_storage_description.py +1 -4
  36. s2python/frbc/frbc_storage_status.py +5 -6
  37. s2python/frbc/frbc_system_description.py +8 -8
  38. s2python/frbc/frbc_timer_status.py +5 -8
  39. s2python/frbc/frbc_usage_forecast.py +6 -8
  40. s2python/frbc/frbc_usage_forecast_element.py +1 -5
  41. s2python/generated/gen_s2.py +848 -833
  42. s2python/message.py +47 -0
  43. s2python/s2_parser.py +2 -3
  44. s2python/utils.py +1 -1
  45. s2python/validate_values_mixin.py +11 -14
  46. s2_python-0.1.0.dist-info/RECORD +0 -50
  47. {s2_python-0.1.0.dist-info → s2_python-0.1.3.dist-info}/entry_points.txt +0 -0
  48. {s2_python-0.1.0.dist-info → s2_python-0.1.3.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,6 @@
1
- from typing import List
2
- import uuid
1
+ from typing import List, Literal
2
+
3
+ from pydantic import Field
3
4
 
4
5
  from s2python.frbc.frbc_fill_level_target_profile_element import (
5
6
  FRBCFillLevelTargetProfileElement,
@@ -7,10 +8,7 @@ from s2python.frbc.frbc_fill_level_target_profile_element import (
7
8
  from s2python.generated.gen_s2 import (
8
9
  FRBCFillLevelTargetProfile as GenFRBCFillLevelTargetProfile,
9
10
  )
10
- from s2python.validate_values_mixin import (
11
- catch_and_convert_exceptions,
12
- S2Message,
13
- )
11
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
14
12
 
15
13
 
16
14
  @catch_and_convert_exceptions
@@ -25,6 +23,6 @@ class FRBCFillLevelTargetProfile(
25
23
  ] = GenFRBCFillLevelTargetProfile.__fields__[
26
24
  "elements"
27
25
  ].field_info # type: ignore[assignment]
28
- message_id: uuid.UUID = GenFRBCFillLevelTargetProfile.__fields__[
29
- "message_id"
30
- ].field_info # type: ignore[assignment]
26
+ message_type: Literal["FRBC.FillLevelTargetProfile"] = Field(
27
+ default="FRBC.FillLevelTargetProfile"
28
+ )
@@ -1,12 +1,8 @@
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
- S2Message,
9
- )
5
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
10
6
 
11
7
 
12
8
  @catch_and_convert_exceptions
@@ -1,10 +1,9 @@
1
- import uuid
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
- S2Message,
7
- )
6
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
8
7
 
9
8
 
10
9
  @catch_and_convert_exceptions
@@ -12,7 +11,4 @@ class FRBCInstruction(GenFRBCInstruction, S2Message["FRBCInstruction"]):
12
11
  class Config(GenFRBCInstruction.Config):
13
12
  validate_assignment = True
14
13
 
15
- actuator_id: uuid.UUID = GenFRBCInstruction.__fields__["actuator_id"].field_info # type: ignore[assignment]
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,12 +1,10 @@
1
- from typing import List
2
- import uuid
1
+ from typing import List, Literal
2
+
3
+ from pydantic import Field
3
4
 
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
- S2Message,
9
- )
7
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
10
8
 
11
9
 
12
10
  @catch_and_convert_exceptions
@@ -17,4 +15,6 @@ class FRBCLeakageBehaviour(GenFRBCLeakageBehaviour, S2Message["FRBCLeakageBehavi
17
15
  elements: List[FRBCLeakageBehaviourElement] = GenFRBCLeakageBehaviour.__fields__[
18
16
  "elements"
19
17
  ].field_info # type: ignore[assignment]
20
- message_id: uuid.UUID = GenFRBCLeakageBehaviour.__fields__["message_id"].field_info # type: ignore[assignment]
18
+ message_type: Literal["FRBC.LeakageBehaviour"] = Field(
19
+ default="FRBC.LeakageBehaviour"
20
+ )
@@ -2,10 +2,7 @@ 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
- S2Message,
8
- )
5
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
9
6
 
10
7
 
11
8
  @catch_and_convert_exceptions
@@ -1,17 +1,13 @@
1
1
  # from itertools import pairwise
2
- import uuid
3
- from typing import List, Dict, Any
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
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
- S2Message,
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
@@ -19,7 +15,6 @@ 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]
@@ -1,13 +1,10 @@
1
- from typing import Optional, List
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
- S2Message,
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
@@ -2,10 +2,7 @@ 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
- S2Message,
8
- )
5
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
9
6
 
10
7
 
11
8
  @catch_and_convert_exceptions
@@ -1,10 +1,9 @@
1
- import uuid
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
- S2Message,
7
- )
6
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
8
7
 
9
8
 
10
9
  @catch_and_convert_exceptions
@@ -12,4 +11,4 @@ class FRBCStorageStatus(GenFRBCStorageStatus, S2Message["FRBCStorageStatus"]):
12
11
  class Config(GenFRBCStorageStatus.Config):
13
12
  validate_assignment = True
14
13
 
15
- message_id: uuid.UUID = GenFRBCStorageStatus.__fields__["message_id"].field_info # type: ignore[assignment]
14
+ message_type: Literal["FRBC.StorageStatus"] = Field(default="FRBC.StorageStatus")
@@ -1,13 +1,11 @@
1
- from typing import List
2
- import uuid
1
+ from typing import List, Literal
2
+
3
+ from pydantic import Field
3
4
 
4
- from s2python.generated.gen_s2 import FRBCSystemDescription as GenFRBCSystemDescription
5
- from s2python.validate_values_mixin import (
6
- catch_and_convert_exceptions,
7
- S2Message,
8
- )
9
5
  from s2python.frbc.frbc_actuator_description import FRBCActuatorDescription
10
6
  from s2python.frbc.frbc_storage_description import FRBCStorageDescription
7
+ from s2python.generated.gen_s2 import FRBCSystemDescription as GenFRBCSystemDescription
8
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
11
9
 
12
10
 
13
11
  @catch_and_convert_exceptions
@@ -20,7 +18,9 @@ class FRBCSystemDescription(
20
18
  actuators: List[FRBCActuatorDescription] = GenFRBCSystemDescription.__fields__[
21
19
  "actuators"
22
20
  ].field_info # type: ignore[assignment]
23
- message_id: uuid.UUID = GenFRBCSystemDescription.__fields__["message_id"].field_info # type: ignore[assignment]
24
21
  storage: FRBCStorageDescription = GenFRBCSystemDescription.__fields__[
25
22
  "storage"
26
23
  ].field_info # type: ignore[assignment]
24
+ message_type: Literal["FRBC.SystemDescription"] = Field(
25
+ default="FRBC.SystemDescription"
26
+ )
@@ -1,10 +1,9 @@
1
- import uuid
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
- S2Message,
7
- )
6
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
8
7
 
9
8
 
10
9
  @catch_and_convert_exceptions
@@ -12,6 +11,4 @@ class FRBCTimerStatus(GenFRBCTimerStatus, S2Message["FRBCTimerStatus"]):
12
11
  class Config(GenFRBCTimerStatus.Config):
13
12
  validate_assignment = True
14
13
 
15
- actuator_id: uuid.UUID = GenFRBCTimerStatus.__fields__["actuator_id"].field_info # type: ignore[assignment]
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,12 +1,10 @@
1
- from typing import List
2
- import uuid
1
+ from typing import List, Literal
2
+
3
+ from pydantic import Field
3
4
 
4
- from s2python.generated.gen_s2 import FRBCUsageForecast as GenFRBCUsageForecast
5
- from s2python.validate_values_mixin import (
6
- catch_and_convert_exceptions,
7
- S2Message,
8
- )
9
5
  from s2python.frbc.frbc_usage_forecast_element import FRBCUsageForecastElement
6
+ from s2python.generated.gen_s2 import FRBCUsageForecast as GenFRBCUsageForecast
7
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
10
8
 
11
9
 
12
10
  @catch_and_convert_exceptions
@@ -17,4 +15,4 @@ class FRBCUsageForecast(GenFRBCUsageForecast, S2Message["FRBCUsageForecast"]):
17
15
  elements: List[FRBCUsageForecastElement] = GenFRBCUsageForecast.__fields__[
18
16
  "elements"
19
17
  ].field_info # type: ignore[assignment]
20
- message_id: uuid.UUID = GenFRBCUsageForecast.__fields__["message_id"].field_info # type: ignore[assignment]
18
+ message_type: Literal["FRBC.UsageForecast"] = Field(default="FRBC.UsageForecast")
@@ -1,12 +1,8 @@
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
- S2Message,
9
- )
5
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
10
6
 
11
7
 
12
8
  @catch_and_convert_exceptions