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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: s2-python
3
- Version: 0.1.0
3
+ Version: 0.1.3
4
4
  Summary: S2 Protocol Python Wrapper
5
5
  Home-page: https://github.com/flexiblepower/s2-ws-json-python
6
6
  Author: Flexiblepower
@@ -12,29 +12,30 @@ Classifier: Programming Language :: Python :: 3.8
12
12
  Classifier: Programming Language :: Python :: 3.9
13
13
  Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
15
16
  Description-Content-Type: text/x-rst; charset=UTF-8
16
- Requires-Dist: pydantic ~=1.10.7
17
+ Requires-Dist: pydantic~=1.10.7
17
18
  Requires-Dist: pytz
18
19
  Requires-Dist: click
20
+ Provides-Extra: testing
21
+ Requires-Dist: pytest; extra == "testing"
22
+ Requires-Dist: pytest-coverage; extra == "testing"
23
+ Requires-Dist: pytest-timer; extra == "testing"
24
+ Requires-Dist: mypy; extra == "testing"
25
+ Requires-Dist: types-pytz; extra == "testing"
26
+ Requires-Dist: pylint; extra == "testing"
19
27
  Provides-Extra: development
20
- Requires-Dist: pip-tools ; extra == 'development'
21
- Requires-Dist: datamodel-code-generator ; extra == 'development'
22
- Requires-Dist: pre-commit ; extra == 'development'
23
- Requires-Dist: tox ; extra == 'development'
28
+ Requires-Dist: pip-tools; extra == "development"
29
+ Requires-Dist: datamodel-code-generator; extra == "development"
30
+ Requires-Dist: pre-commit; extra == "development"
31
+ Requires-Dist: tox; extra == "development"
24
32
  Provides-Extra: docs
25
- Requires-Dist: sphinx ; extra == 'docs'
26
- Requires-Dist: sphinx-rtd-theme >=1.2 ; extra == 'docs'
27
- Requires-Dist: sphinx-tabs ; extra == 'docs'
28
- Requires-Dist: sphinx-copybutton ; extra == 'docs'
29
- Requires-Dist: sphinx-fontawesome ; extra == 'docs'
30
- Requires-Dist: sphinxcontrib.httpdomain ; extra == 'docs'
31
- Provides-Extra: testing
32
- Requires-Dist: pytest ; extra == 'testing'
33
- Requires-Dist: pytest-coverage ; extra == 'testing'
34
- Requires-Dist: pytest-timer ; extra == 'testing'
35
- Requires-Dist: mypy ; extra == 'testing'
36
- Requires-Dist: types-pytz ; extra == 'testing'
37
- Requires-Dist: pylint ; extra == 'testing'
33
+ Requires-Dist: sphinx; extra == "docs"
34
+ Requires-Dist: sphinx-rtd-theme>=1.2; extra == "docs"
35
+ Requires-Dist: sphinx-tabs; extra == "docs"
36
+ Requires-Dist: sphinx_copybutton; extra == "docs"
37
+ Requires-Dist: sphinx_fontawesome; extra == "docs"
38
+ Requires-Dist: sphinxcontrib.httpdomain; extra == "docs"
38
39
 
39
40
  Python Wrapper for S2 Flexibility Protocol
40
41
  ===========================================
@@ -0,0 +1,51 @@
1
+ s2python/__init__.py,sha256=e5lwvqsPl-z7IfEd0hRQhLBRKBYcuw2eqrecXnMfLdg,384
2
+ s2python/message.py,sha256=BeKrzLQRkBYkJseo4O9vrMgKwG2YBLRIMNHllPcp82s,1048
3
+ s2python/s2_parser.py,sha256=aDd_gt0YSa-OeYa9Ot8ZYNomOI61yU9uVBVem4-SBO0,4087
4
+ s2python/s2_validation_error.py,sha256=fdV2tdRhYslDStTw8Cvb3mly7PpLiCbXbrkfOe3n2_w,295
5
+ s2python/utils.py,sha256=SHYxnU4IlM6vN-WmnBEj-qMYG4_ykP93ZyvEtVIUEOU,212
6
+ s2python/validate_values_mixin.py,sha256=YHWXbOdom6v3DcVta2uY6TxHtT-Squn6rOrAzlmf96c,4230
7
+ s2python/version.py,sha256=w9Iw7QVvd8lme2wKwEbCo5IgetVjSfFBOOYAcA_Q0Ns,18
8
+ s2python/common/__init__.py,sha256=OO5eEuRFNB29yoChcXmKYqimsmJ29nAunb3xTUtJnU0,1443
9
+ s2python/common/duration.py,sha256=WtPr2GJAZ0lkKW6yxKTHsN8QxTonQ3xQIlxmK68bv4g,648
10
+ s2python/common/handshake.py,sha256=yVItASWui00KHewhk1kf9J-APcLNPoPJ4ifNI8NOlgg,433
11
+ s2python/common/handshake_response.py,sha256=zIgmBaNZD5_GK0yhc8hInPeO-FCtqC03Gd2D9GZ05qM,497
12
+ s2python/common/instruction_status_update.py,sha256=qqGWn6eX34GaZy2ikJ1XG2HIvR8DgfATpqKDRafHFds,574
13
+ s2python/common/number_range.py,sha256=uTtrTctuqFK8dIgOwP9ctqRyUq-ZRGHoIzZgGzNNkl0,1150
14
+ s2python/common/power_forecast.py,sha256=jBtoUROMugvj0nhYZbnBmi9_h8XpjeBp3p93SUawNaQ,679
15
+ s2python/common/power_forecast_element.py,sha256=miSykpw6wtU8opQS_REw1YxB8z_2or7QylRpVkVzSYg,774
16
+ s2python/common/power_forecast_value.py,sha256=mWrinzXl9Hv8Wwz1u7zPlM-q67QEDHab7ZE6yBSYMzg,362
17
+ s2python/common/power_measurement.py,sha256=qi00R2GT2Hg1prJ4pP2frDzUqKpJQDOehUY66fYMo4Q,657
18
+ s2python/common/power_range.py,sha256=XA_2SuAL3s3ahtLOrEFYtnhmYFg-xsZQ74_WeGkJaVI,783
19
+ s2python/common/power_value.py,sha256=yUw5vE4SUjgJwhQd7q8q3k9-0ylEBuWL3ksNuZ_11SA,314
20
+ s2python/common/reception_status.py,sha256=lEMQf1_22rxYFGcHEsWosnybtr2I-EneoptqJARmqoo,481
21
+ s2python/common/resource_manager_details.py,sha256=Wxs8C9PEeZdOofJvzYQ4PwbXvi_YXvnUbqNnzgTDBsE,933
22
+ s2python/common/revoke_object.py,sha256=Lu6jzUvLjBwtcRK8Me4PGoo87JnwRTTJYCtNEBF4F_0,457
23
+ s2python/common/role.py,sha256=_OQP-sZ_T_qOP_Qf44cYoxVMRJYToMj-ZRCxyQI7TJ4,278
24
+ s2python/common/select_control_type.py,sha256=NWdo44cN9xmEPMmuy5bRoNgJnGLA9sBtUToloolteGE,497
25
+ s2python/common/session_request.py,sha256=bo9qsjWAbDhdRxEp0-bJ3rC61N8fFv6M-IU0-ljo73E,473
26
+ s2python/common/support.py,sha256=cARbi4LIf0g64jhZ5gcqeWJLJkM7YBHt1OAZDeRQV0M,1015
27
+ s2python/common/timer.py,sha256=rcCK5wZvsSNEe-0MislFg8OPnhkqKpQjq9gD_vt-z9c,427
28
+ s2python/common/transition.py,sha256=SLkVT1BdWqhk_MAGEc3aWEHy6a2onSTgEuNwblZ55Q4,537
29
+ s2python/frbc/__init__.py,sha256=4oYGzsgbaFB4KLV-t8fIAtyaMK5UCEzVr5lALwDamcU,1104
30
+ s2python/frbc/frbc_actuator_description.py,sha256=eE4WFXB1_60DS717B-J5lSgluQadB__a5Jj1ikJRl5w,6705
31
+ s2python/frbc/frbc_actuator_status.py,sha256=FpHcBmdrxrAxh9Vbp6u2rOmJj7HGJqApVM4MDrmfmvs,507
32
+ s2python/frbc/frbc_fill_level_target_profile.py,sha256=xAgJ4WR4Fs-I8LsOpbsQHk5CKyjydMl1TUovgiyN6Tk,890
33
+ s2python/frbc/frbc_fill_level_target_profile_element.py,sha256=6Aoh2Gb7kZBwa1rGmHIw5fphkH5uYH9bGeLaQFro8rc,818
34
+ s2python/frbc/frbc_instruction.py,sha256=eeSDW4mdI-KMx-8htSBSk59GsQ5V-UDYWcCZCiynfJc,483
35
+ s2python/frbc/frbc_leakage_behaviour.py,sha256=XpgVugZoc6CRLHGUHfJHgtIXb03Fwk8KbwTkqsTG5XE,778
36
+ s2python/frbc/frbc_leakage_behaviour_element.py,sha256=AJ0La_3jnHuXYgwvXA32lOB41dP8SOXpiHfQuEsOr3w,623
37
+ s2python/frbc/frbc_operation_mode.py,sha256=P6Nq28AUxplhhyeuQaDKBxGBoM-uCiGC5rhwqiL66r0,1908
38
+ s2python/frbc/frbc_operation_mode_element.py,sha256=wQsLskoFV99U9FhJOVeerz3ej_frfajWvwaVpsjKsc8,1066
39
+ s2python/frbc/frbc_storage_description.py,sha256=OtY830EHP1m4JxHNKfA3drJ6q-akgSSEP6ncd8VxmWo,588
40
+ s2python/frbc/frbc_storage_status.py,sha256=Z2Oppbzv3fcJJGqnmZBoXKUi8JQLoOjt5wUof15aSC4,499
41
+ s2python/frbc/frbc_system_description.py,sha256=d5QRik3nuhhudx7CT3YwuMRv4353JMoE9qehiYeupnE,994
42
+ s2python/frbc/frbc_timer_status.py,sha256=rMdEoZhAO0S5_fNN0VjgtZSGCgCB50AymEV4Ym8HRE8,483
43
+ s2python/frbc/frbc_usage_forecast.py,sha256=5G4zl9e7TBfGYFCZ7K-HdR_QZTVOxYVS43wcuXenrjs,728
44
+ s2python/frbc/frbc_usage_forecast_element.py,sha256=7wYAlNPNStW485-yVMqjkoQlHnWmG_I5ILCF2UhMaCU,566
45
+ s2python/generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
+ s2python/generated/gen_s2.py,sha256=5efQyo-hqCYa9Rm09V0C-ifbIFy89Ywoz8OX1Xm4GEM,62370
47
+ s2_python-0.1.3.dist-info/METADATA,sha256=wFwlXOSLIk48DFAbN3T2_GgzxH2XEQ0Cn3Sd3OG2UkA,3290
48
+ s2_python-0.1.3.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
49
+ s2_python-0.1.3.dist-info/entry_points.txt,sha256=feX-xmgJZgSe5-jxMgFKPKCJz4Ys3eQcGrsXsirNZyM,61
50
+ s2_python-0.1.3.dist-info/top_level.txt,sha256=OLFq0oDhr77Mp-EYLEcWk5P3jvooOt4IHkTI5KYJMc8,9
51
+ s2_python-0.1.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.3)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,32 +1,33 @@
1
- from s2python.generated.gen_s2 import (
2
- RoleType,
3
- CommodityQuantity,
4
- Commodity,
5
- InstructionStatus,
6
- ReceptionStatusValues,
7
- EnergyManagementRole,
8
- SessionRequestType,
9
- ControlType,
10
- Currency,
11
- RevokableObjects,
12
- )
1
+ # noqa
13
2
 
14
3
  from s2python.common.duration import Duration
15
- from s2python.common.role import Role
16
4
  from s2python.common.handshake import Handshake
17
5
  from s2python.common.handshake_response import HandshakeResponse
18
6
  from s2python.common.instruction_status_update import InstructionStatusUpdate
19
7
  from s2python.common.number_range import NumberRange
20
- from s2python.common.power_forecast_value import PowerForecastValue
21
- from s2python.common.power_forecast_element import PowerForecastElement
22
8
  from s2python.common.power_forecast import PowerForecast
23
- from s2python.common.power_value import PowerValue
9
+ from s2python.common.power_forecast_element import PowerForecastElement
10
+ from s2python.common.power_forecast_value import PowerForecastValue
24
11
  from s2python.common.power_measurement import PowerMeasurement
25
12
  from s2python.common.power_range import PowerRange
13
+ from s2python.common.power_value import PowerValue
26
14
  from s2python.common.reception_status import ReceptionStatus
27
15
  from s2python.common.resource_manager_details import ResourceManagerDetails
28
16
  from s2python.common.revoke_object import RevokeObject
17
+ from s2python.common.role import Role
29
18
  from s2python.common.select_control_type import SelectControlType
30
19
  from s2python.common.session_request import SessionRequest
31
20
  from s2python.common.timer import Timer
32
21
  from s2python.common.transition import Transition
22
+ from s2python.generated.gen_s2 import (
23
+ Commodity,
24
+ CommodityQuantity,
25
+ ControlType,
26
+ Currency, # noqa F401
27
+ EnergyManagementRole, # noqa F401
28
+ InstructionStatus, # noqa F401
29
+ ReceptionStatusValues, # noqa F401
30
+ RevokableObjects, # noqa F401
31
+ RoleType, # noqa F401
32
+ SessionRequestType, # noqa F401
33
+ )
@@ -1,11 +1,8 @@
1
- from datetime import timedelta
2
1
  import math
2
+ from datetime import timedelta
3
3
 
4
4
  from s2python.generated.gen_s2 import Duration as GenDuration
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 Handshake as GenHandshake
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 Handshake(GenHandshake, S2Message["Handshake"]):
12
11
  class Config(GenHandshake.Config):
13
12
  validate_assignment = True
14
13
 
15
- message_id: uuid.UUID = GenHandshake.__fields__["message_id"].field_info # type: ignore[assignment]
14
+ message_type: Literal["Handshake"] = Field(default="Handshake")
@@ -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 HandshakeResponse as GenHandshakeResponse
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 HandshakeResponse(GenHandshakeResponse, S2Message["HandshakeResponse"]):
12
11
  class Config(GenHandshakeResponse.Config):
13
12
  validate_assignment = True
14
13
 
15
- message_id: uuid.UUID = GenHandshakeResponse.__fields__["message_id"].field_info # type: ignore[assignment]
14
+ message_type: Literal["HandshakeResponse"] = Field(default="HandshakeResponse")
@@ -1,12 +1,11 @@
1
- import uuid
1
+ from typing import Literal
2
+
3
+ from pydantic import Field
2
4
 
3
5
  from s2python.generated.gen_s2 import (
4
6
  InstructionStatusUpdate as GenInstructionStatusUpdate,
5
7
  )
6
- from s2python.validate_values_mixin import (
7
- catch_and_convert_exceptions,
8
- S2Message,
9
- )
8
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
10
9
 
11
10
 
12
11
  @catch_and_convert_exceptions
@@ -16,7 +15,6 @@ class InstructionStatusUpdate(
16
15
  class Config(GenInstructionStatusUpdate.Config):
17
16
  validate_assignment = True
18
17
 
19
- message_id: uuid.UUID = GenInstructionStatusUpdate.__fields__["message_id"].field_info # type: ignore[assignment]
20
- instruction_id: uuid.UUID = GenInstructionStatusUpdate.__fields__[
21
- "instruction_id"
22
- ].field_info # type: ignore[assignment]
18
+ message_type: Literal["InstructionStatusUpdate"] = Field(
19
+ default="InstructionStatusUpdate"
20
+ )
@@ -2,11 +2,8 @@ from typing import Any, Dict
2
2
 
3
3
  from pydantic import root_validator
4
4
 
5
- from s2python.validate_values_mixin import (
6
- S2Message,
7
- catch_and_convert_exceptions,
8
- )
9
5
  from s2python.generated.gen_s2 import NumberRange as GenNumberRange
6
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
10
7
 
11
8
 
12
9
  @catch_and_convert_exceptions
@@ -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.common.power_forecast_element import PowerForecastElement
5
6
  from s2python.generated.gen_s2 import PowerForecast as GenPowerForecast
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
@@ -14,7 +12,7 @@ class PowerForecast(GenPowerForecast, S2Message["PowerForecast"]):
14
12
  class Config(GenPowerForecast.Config):
15
13
  validate_assignment = True
16
14
 
17
- message_id: uuid.UUID = GenPowerForecast.__fields__["message_id"].field_info # type: ignore[assignment]
18
15
  elements: List[PowerForecastElement] = GenPowerForecast.__fields__[
19
16
  "elements"
20
17
  ].field_info # type: ignore[assignment]
18
+ message_type: Literal["PowerForecast"] = Field(default="PowerForecast")
@@ -1,12 +1,9 @@
1
1
  from typing import List
2
2
 
3
- from s2python.generated.gen_s2 import PowerForecastElement as GenPowerForecastElement
4
- from s2python.validate_values_mixin import (
5
- catch_and_convert_exceptions,
6
- S2Message,
7
- )
8
3
  from s2python.common.duration import Duration
9
4
  from s2python.common.power_forecast_value import PowerForecastValue
5
+ from s2python.generated.gen_s2 import PowerForecastElement as GenPowerForecastElement
6
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
10
7
 
11
8
 
12
9
  @catch_and_convert_exceptions
@@ -1,8 +1,5 @@
1
1
  from s2python.generated.gen_s2 import PowerForecastValue as GenPowerForecastValue
2
- from s2python.validate_values_mixin import (
3
- catch_and_convert_exceptions,
4
- S2Message,
5
- )
2
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
6
3
 
7
4
 
8
5
  @catch_and_convert_exceptions
@@ -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.common.power_value import PowerValue
5
6
  from s2python.generated.gen_s2 import PowerMeasurement as GenPowerMeasurement
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
@@ -14,5 +12,5 @@ class PowerMeasurement(GenPowerMeasurement, S2Message["PowerMeasurement"]):
14
12
  class Config(GenPowerMeasurement.Config):
15
13
  validate_assignment = True
16
14
 
17
- message_id: uuid.UUID = GenPowerMeasurement.__fields__["message_id"].field_info # type: ignore[assignment]
18
15
  values: List[PowerValue] = GenPowerMeasurement.__fields__["values"].field_info # type: ignore[assignment]
16
+ message_type: Literal["PowerMeasurement"] = Field(default="PowerMeasurement")
@@ -3,10 +3,7 @@ from typing import Any, Dict
3
3
  from pydantic import root_validator
4
4
 
5
5
  from s2python.generated.gen_s2 import PowerRange as GenPowerRange
6
- from s2python.validate_values_mixin import (
7
- S2Message,
8
- catch_and_convert_exceptions,
9
- )
6
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
10
7
 
11
8
 
12
9
  @catch_and_convert_exceptions
@@ -1,8 +1,5 @@
1
1
  from s2python.generated.gen_s2 import PowerValue as GenPowerValue
2
- from s2python.validate_values_mixin import (
3
- catch_and_convert_exceptions,
4
- S2Message,
5
- )
2
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
6
3
 
7
4
 
8
5
  @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 ReceptionStatus as GenReceptionStatus
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 ReceptionStatus(GenReceptionStatus, S2Message["ReceptionStatus"]):
12
11
  class Config(GenReceptionStatus.Config):
13
12
  validate_assignment = True
14
13
 
15
- subject_message_id: uuid.UUID = GenReceptionStatus.__fields__[
16
- "subject_message_id"
17
- ].field_info # type: ignore[assignment]
14
+ message_type: Literal["ReceptionStatus"] = Field(default="ReceptionStatus")
@@ -1,15 +1,13 @@
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.common.duration import Duration
5
6
  from s2python.common.role import Role
6
7
  from s2python.generated.gen_s2 import (
7
8
  ResourceManagerDetails as GenResourceManagerDetails,
8
9
  )
9
- from s2python.validate_values_mixin import (
10
- catch_and_convert_exceptions,
11
- S2Message,
12
- )
10
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
13
11
 
14
12
 
15
13
  @catch_and_convert_exceptions
@@ -22,6 +20,8 @@ class ResourceManagerDetails(
22
20
  instruction_processing_delay: Duration = GenResourceManagerDetails.__fields__[
23
21
  "instruction_processing_delay"
24
22
  ].field_info # type: ignore[assignment]
25
- message_id: uuid.UUID = GenResourceManagerDetails.__fields__["message_id"].field_info # type: ignore[assignment]
26
- resource_id: uuid.UUID = GenResourceManagerDetails.__fields__["resource_id"].field_info # type: ignore[assignment]
23
+
27
24
  roles: List[Role] = GenResourceManagerDetails.__fields__["roles"].field_info # type: ignore[assignment]
25
+ message_type: Literal["ResourceManagerDetails"] = Field(
26
+ default="ResourceManagerDetails"
27
+ )
@@ -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 RevokeObject as GenRevokeObject
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,5 +11,4 @@ class RevokeObject(GenRevokeObject, S2Message["RevokeObject"]):
12
11
  class Config(GenRevokeObject.Config):
13
12
  validate_assignment = True
14
13
 
15
- message_id: uuid.UUID = GenRevokeObject.__fields__["message_id"].field_info # type: ignore[assignment]
16
- object_id: uuid.UUID = GenRevokeObject.__fields__["object_id"].field_info # type: ignore[assignment]
14
+ message_type: Literal["RevokeObject"] = Field(default="RevokeObject")
s2python/common/role.py CHANGED
@@ -1,8 +1,5 @@
1
1
  from s2python.generated.gen_s2 import Role as GenRole
2
- from s2python.validate_values_mixin import (
3
- S2Message,
4
- catch_and_convert_exceptions,
5
- )
2
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
6
3
 
7
4
 
8
5
  @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 SelectControlType as GenSelectControlType
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 SelectControlType(GenSelectControlType, S2Message["SelectControlType"]):
12
11
  class Config(GenSelectControlType.Config):
13
12
  validate_assignment = True
14
13
 
15
- message_id: uuid.UUID = GenSelectControlType.__fields__["message_id"].field_info # type: ignore[assignment]
14
+ message_type: Literal["SelectControlType"] = Field(default="SelectControlType")
@@ -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 SessionRequest as GenSessionRequest
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 SessionRequest(GenSessionRequest, S2Message["SessionRequest"]):
12
11
  class Config(GenSessionRequest.Config):
13
12
  validate_assignment = True
14
13
 
15
- message_id: uuid.UUID = GenSessionRequest.__fields__["message_id"].field_info # type: ignore[assignment]
14
+ message_type: Literal["SessionRequest"] = Field(default="SessionRequest")
@@ -1,4 +1,4 @@
1
- from s2python.common import CommodityQuantity, Commodity
1
+ from s2python.common import Commodity, CommodityQuantity
2
2
 
3
3
 
4
4
  def commodity_has_quantity(commodity: "Commodity", quantity: CommodityQuantity) -> bool:
s2python/common/timer.py CHANGED
@@ -1,11 +1,6 @@
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
- S2Message,
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
@@ -13,5 +8,4 @@ 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]
@@ -1,12 +1,8 @@
1
- import uuid
2
- from typing import Optional, List
1
+ from typing import Optional
3
2
 
4
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
- S2Message,
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
@@ -14,13 +10,6 @@ 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.frbc_usage_forecast_element import FRBCUsageForecastElement
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.frbc_actuator_description import FRBCActuatorDescription
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,20 +1,15 @@
1
- import uuid
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 Transition, Timer, Commodity
5
+ from s2python.common import Commodity, Timer, Transition
8
6
  from s2python.common.support import commodity_has_quantity
9
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
- S2Message,
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
@@ -24,7 +19,6 @@ class FRBCActuatorDescription(
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]
@@ -1,11 +1,9 @@
1
- from typing import Optional
2
- import uuid
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
- S2Message,
8
- )
6
+ from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
9
7
 
10
8
 
11
9
  @catch_and_convert_exceptions
@@ -13,11 +11,4 @@ class FRBCActuatorStatus(GenFRBCActuatorStatus, S2Message["FRBCActuatorStatus"])
13
11
  class Config(GenFRBCActuatorStatus.Config):
14
12
  validate_assignment = True
15
13
 
16
- active_operation_mode_id: uuid.UUID = GenFRBCActuatorStatus.__fields__[
17
- "active_operation_mode_id"
18
- ].field_info # type: ignore[assignment]
19
- actuator_id: uuid.UUID = GenFRBCActuatorStatus.__fields__["actuator_id"].field_info # type: ignore[assignment]
20
- message_id: uuid.UUID = GenFRBCActuatorStatus.__fields__["message_id"].field_info # type: ignore[assignment]
21
- previous_operation_mode_id: Optional[uuid.UUID] = GenFRBCActuatorStatus.__fields__[
22
- "previous_operation_mode_id"
23
- ].field_info # type: ignore[assignment]
14
+ message_type: Literal["FRBC.ActuatorStatus"] = Field(default="FRBC.ActuatorStatus")