s2-python 0.3.1__py3-none-any.whl → 0.4.1__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 (54) hide show
  1. {s2_python-0.3.1.dist-info → s2_python-0.4.1.dist-info}/METADATA +2 -2
  2. s2_python-0.4.1.dist-info/RECORD +66 -0
  3. s2python/common/duration.py +2 -2
  4. s2python/common/handshake.py +2 -2
  5. s2python/common/handshake_response.py +2 -2
  6. s2python/common/instruction_status_update.py +2 -2
  7. s2python/common/number_range.py +2 -2
  8. s2python/common/power_forecast.py +2 -2
  9. s2python/common/power_forecast_element.py +2 -2
  10. s2python/common/power_forecast_value.py +2 -2
  11. s2python/common/power_measurement.py +2 -2
  12. s2python/common/power_range.py +2 -2
  13. s2python/common/power_value.py +2 -2
  14. s2python/common/reception_status.py +2 -2
  15. s2python/common/resource_manager_details.py +2 -2
  16. s2python/common/revoke_object.py +2 -2
  17. s2python/common/role.py +2 -2
  18. s2python/common/select_control_type.py +2 -2
  19. s2python/common/session_request.py +2 -2
  20. s2python/common/timer.py +2 -2
  21. s2python/common/transition.py +2 -2
  22. s2python/frbc/frbc_actuator_description.py +2 -2
  23. s2python/frbc/frbc_actuator_status.py +2 -2
  24. s2python/frbc/frbc_fill_level_target_profile.py +2 -2
  25. s2python/frbc/frbc_fill_level_target_profile_element.py +2 -2
  26. s2python/frbc/frbc_instruction.py +2 -2
  27. s2python/frbc/frbc_leakage_behaviour.py +2 -2
  28. s2python/frbc/frbc_leakage_behaviour_element.py +2 -2
  29. s2python/frbc/frbc_operation_mode.py +2 -2
  30. s2python/frbc/frbc_operation_mode_element.py +2 -2
  31. s2python/frbc/frbc_storage_description.py +2 -2
  32. s2python/frbc/frbc_storage_status.py +2 -2
  33. s2python/frbc/frbc_system_description.py +2 -2
  34. s2python/frbc/frbc_timer_status.py +2 -2
  35. s2python/frbc/frbc_usage_forecast.py +2 -2
  36. s2python/frbc/frbc_usage_forecast_element.py +2 -2
  37. s2python/message.py +50 -0
  38. s2python/ppbc/ppbc_end_interruption_instruction.py +2 -2
  39. s2python/ppbc/ppbc_power_profile_definition.py +2 -2
  40. s2python/ppbc/ppbc_power_profile_status.py +2 -2
  41. s2python/ppbc/ppbc_power_sequence.py +2 -2
  42. s2python/ppbc/ppbc_power_sequence_container.py +2 -2
  43. s2python/ppbc/ppbc_power_sequence_container_status.py +2 -2
  44. s2python/ppbc/ppbc_power_sequence_element.py +2 -2
  45. s2python/ppbc/ppbc_schedule_instruction.py +2 -2
  46. s2python/ppbc/ppbc_start_interruption_instruction.py +2 -2
  47. s2python/s2_connection.py +7 -7
  48. s2python/s2_control_type.py +1 -1
  49. s2python/s2_parser.py +3 -2
  50. s2python/validate_values_mixin.py +2 -2
  51. s2_python-0.3.1.dist-info/RECORD +0 -65
  52. {s2_python-0.3.1.dist-info → s2_python-0.4.1.dist-info}/WHEEL +0 -0
  53. {s2_python-0.3.1.dist-info → s2_python-0.4.1.dist-info}/entry_points.txt +0 -0
  54. {s2_python-0.3.1.dist-info → s2_python-0.4.1.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: s2-python
3
- Version: 0.3.1
3
+ Version: 0.4.1
4
4
  Summary: S2 Protocol Python Wrapper
5
5
  Home-page: https://github.com/flexiblepower/s2-ws-json-python
6
6
  Author: Flexiblepower
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3.10
14
14
  Classifier: Programming Language :: Python :: 3.11
15
15
  Classifier: Programming Language :: Python :: 3.12
16
16
  Description-Content-Type: text/x-rst; charset=UTF-8
17
- Requires-Dist: pydantic~=2.8.2
17
+ Requires-Dist: pydantic>=2.8.2
18
18
  Requires-Dist: pytz
19
19
  Requires-Dist: click
20
20
  Requires-Dist: websockets~=13.1
@@ -0,0 +1,66 @@
1
+ s2python/__init__.py,sha256=e5lwvqsPl-z7IfEd0hRQhLBRKBYcuw2eqrecXnMfLdg,384
2
+ s2python/message.py,sha256=Id-CleYk6ClVh3o5meVtRECLNwQHlyddNSOq0-d2bZk,1027
3
+ s2python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ s2python/reception_status_awaiter.py,sha256=jKMliFk1XxwsEGtx3vFESbJhUtClB7cTu-td90-qBN8,2137
5
+ s2python/s2_connection.py,sha256=CTTTGzJ6IG9PcQpC5XtnThaYQRpp66gQrauPK8KygOE,20166
6
+ s2python/s2_control_type.py,sha256=4L6o_QG9ilYA8c3QWpSjc77xwxEHHsAGZO8WQDgxDr0,2860
7
+ s2python/s2_parser.py,sha256=x2JSCSEvXMCt-0kPDH4zER--CsyFYyRAaezr76V_8Qc,4354
8
+ s2python/s2_validation_error.py,sha256=BkOLoNsrcQ3MzdCYaPDgs1Wu6lPdlQDpZsTpykKGQmE,384
9
+ s2python/utils.py,sha256=QX9b-mi-H_YUGTmGmJsrAbaWWM3dgaoaRLRXHHlaZDE,212
10
+ s2python/validate_values_mixin.py,sha256=3WbauPprzWpGdyDUYPoELICi2NbHrCFzlQ7AtrpDSis,2568
11
+ s2python/version.py,sha256=IBzoytgbYYYekQnSTfSmWeYAZ4c_yUFU2oLIAG4UYjs,45
12
+ s2python/common/__init__.py,sha256=yEAXCS59XpNOEXbEXoN04SwultP-3evgVzFuEUSgB5I,1345
13
+ s2python/common/duration.py,sha256=5_zi0wv98dr8lHXh2RdHATzW4Un8ZNUx4-zaI1t77Ak,667
14
+ s2python/common/handshake.py,sha256=bsx64flKxVUUMT18O47pV1pnnpXcAGXMJbRi9q4GjwU,467
15
+ s2python/common/handshake_response.py,sha256=5cAbtLTZ8fkhUw-XdMlGBro3XKWqXXLw3YUavvwLYNg,523
16
+ s2python/common/instruction_status_update.py,sha256=lo5HxoEGFp8bU0-AQ7bNxuDj1StZ73GE_2sGDA7o5vI,692
17
+ s2python/common/number_range.py,sha256=N0OUoGtkdYg4GDUwvVHKLjdXxcy9mijgwqmmA079P6k,741
18
+ s2python/common/power_forecast.py,sha256=C0D6XOphdcEVjfb0py-l2zLnNC-udWmlDD7g2Hre2uo,704
19
+ s2python/common/power_forecast_element.py,sha256=M3weDKlBASjS_VHt4XKdms2fpxEZy17kWuLTUXsFibU,805
20
+ s2python/common/power_forecast_value.py,sha256=im5kLyTfDjLuODFWoIuVgVxKjX2FpyPXYoxonjuOpu0,411
21
+ s2python/common/power_measurement.py,sha256=mMVpe3T86Xu6ctA2Rpc50aB4WS7xuLXgGVSbB4lykHQ,693
22
+ s2python/common/power_range.py,sha256=FKhJRkT3dzUCeK8P3mrcRVtJHPf2WH-eQDottvEMpBs,686
23
+ s2python/common/power_value.py,sha256=ujo0yxHnAd-LCIQQuIpNU01jv611UCbcXKl8ilQIILY,363
24
+ s2python/common/reception_status.py,sha256=HXdaTu5B2iuHb1pg8d5TMprfi80rUmCgCxrrDFLJB0w,525
25
+ s2python/common/resource_manager_details.py,sha256=QTW6VTn-Y_fvVKX6qGgDMuvry5twmDqHjRvOZXgkuLI,1044
26
+ s2python/common/revoke_object.py,sha256=7OVNuwu5aMfZ3GJ_b_SRNoTxiX80FY9obp7JHIySzaY,585
27
+ s2python/common/role.py,sha256=eHKwnie_7eK8k1CNA7S0TbwmkQR84Pzkwdk8aUaUldw,327
28
+ s2python/common/select_control_type.py,sha256=Rbvem30LrrPYTSjwspc-PJyxoNScv9XRVXJ58-WRotk,523
29
+ s2python/common/session_request.py,sha256=ztbvGjMwiEmdJ_ToFuPV9Lj_IHJ78fP7IsCt8rMvMu8,502
30
+ s2python/common/support.py,sha256=Kbrf_KGB45Wfr8j2pqDe1lLde6CIr3nl_LYkWnilmV0,1015
31
+ s2python/common/timer.py,sha256=PWJjHXfL6yr2VQ8O2HwtYB0o3Jw4TdP2iMX2Wdp7Ic4,556
32
+ s2python/common/transition.py,sha256=2v0fkxudPhVqmnd-WajJhBsYRnJLAqJU9z1eqQJy8zw,1064
33
+ s2python/frbc/__init__.py,sha256=ROV3qZoldPkdgVFfMQr5Mf3GDfBzXaMfhNNCuXY6T0s,1104
34
+ s2python/frbc/frbc_actuator_description.py,sha256=fsgYdKvxZnUCuUuyoN0Ibu5FoA0vUBSrKy6WQJGBfGk,6166
35
+ s2python/frbc/frbc_actuator_status.py,sha256=cPyAz0B0rThfueKr3CWx61E3eJ8Lp29a-nJPyTPpbls,973
36
+ s2python/frbc/frbc_fill_level_target_profile.py,sha256=suRBgT8b9HQjfafW-sjqzjFpgJ2vOf73nmL5-Q6WhOo,880
37
+ s2python/frbc/frbc_fill_level_target_profile_element.py,sha256=V7O7oDDfifLcJsSXYWEd00X3C2TPoU8TcrRu2yLWVVU,1280
38
+ s2python/frbc/frbc_instruction.py,sha256=Q8w9KB4x6mGsLR-3ADzsyWWf0-uTWGZ31rnKGC9TkIc,809
39
+ s2python/frbc/frbc_leakage_behaviour.py,sha256=E23McMu4zbjDIUR_MNBlyUuh1chGM-EKTMuiHqjV_wg,794
40
+ s2python/frbc/frbc_leakage_behaviour_element.py,sha256=B3Tzlu3iMVV3NA1WJds_LDl3T_lBGL3HjGiEin02_pQ,1103
41
+ s2python/frbc/frbc_operation_mode.py,sha256=w0--55ZByWQukbotR6VpoL9GvNbeNyHcs3NqHAzjq6w,1899
42
+ s2python/frbc/frbc_operation_mode_element.py,sha256=64_FJzfCRoUgRCdfA1HpLO9lTE1WBxL3Pbn0vaNeX8c,1073
43
+ s2python/frbc/frbc_storage_description.py,sha256=Jc0zpAwf3E7Grl6v0fkSa4yA8-2-klO1aY-50l-u56E,622
44
+ s2python/frbc/frbc_storage_status.py,sha256=h6cHTb7Msw5TckPzKsiI3KTSa7Hr5BcXIelF8gmFIdw,523
45
+ s2python/frbc/frbc_system_description.py,sha256=_scCAVe4sHEhQMHkDvD2pKGnGLzdnm4uARbdcw0inKk,980
46
+ s2python/frbc/frbc_timer_status.py,sha256=sRsvXxsT_TDlPiacLkZlCZM3y36NZRGqj6RKJeil-yc,711
47
+ s2python/frbc/frbc_usage_forecast.py,sha256=MWY4Nr2T9NGjQhf7rxTtkqnuSdApTjro81-o_buLABk,747
48
+ s2python/frbc/frbc_usage_forecast_element.py,sha256=wQJCBoYFt2HXNaKNL3vK_FpTx5wXvRH03NOw_JWOal8,601
49
+ s2python/frbc/rm.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
+ s2python/generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
+ s2python/generated/gen_s2.py,sha256=eg9J0pcWxCy0oXO8eq9AtoB-GONHZLNd8JANpMhKQCQ,63573
52
+ s2python/ppbc/__init__.py,sha256=Rnfl_1n0gkc9mASSzBBMFEKYzJqugV5POtttjLWx_pI,665
53
+ s2python/ppbc/ppbc_end_interruption_instruction.py,sha256=0ZXQATN8L35xm9-QWCU8ftnU1_Na9Oq3HzSYna_SMcU,1197
54
+ s2python/ppbc/ppbc_power_profile_definition.py,sha256=3y5lw7eeDVVa6JecoGlZrqr6bcQRaDoLO9EISPle3ks,991
55
+ s2python/ppbc/ppbc_power_profile_status.py,sha256=E-mNhdaPiuB6qFsG_F1ftIlwaxF75972nvIHKSpau5w,767
56
+ s2python/ppbc/ppbc_power_sequence.py,sha256=DCeNstEAUvwCiN1bKDd85gE6pgiataJbwGui6pEk5_M,1158
57
+ s2python/ppbc/ppbc_power_sequence_container.py,sha256=L0kD7zkJj9OBafzzA6zcUgFnn5wCx6VzlGoLX3GDf9U,829
58
+ s2python/ppbc/ppbc_power_sequence_container_status.py,sha256=3Wq3NasIh_mLDEZvnNsgB8AY8CSd4qQKpPJxXwS7ZiA,1160
59
+ s2python/ppbc/ppbc_power_sequence_element.py,sha256=sQMJlIRhMhj_crpaRFDWhbP4eCCw4haFq5sD-ptQsS0,797
60
+ s2python/ppbc/ppbc_schedule_instruction.py,sha256=yHDO5omwKYV_P_v70D4gZ26K5MEIFFboX1sp3J6_atA,1098
61
+ s2python/ppbc/ppbc_start_interruption_instruction.py,sha256=6Atu6E-Hfs8S2KIdHdGJd9F5gRFqZLNb-dpnphj8hNU,1219
62
+ s2_python-0.4.1.dist-info/METADATA,sha256=CJILWeqNUp0VSPUdlLafySNPJag6SvoeYAPO9b5_cQs,3595
63
+ s2_python-0.4.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
64
+ s2_python-0.4.1.dist-info/entry_points.txt,sha256=feX-xmgJZgSe5-jxMgFKPKCJz4Ys3eQcGrsXsirNZyM,61
65
+ s2_python-0.4.1.dist-info/top_level.txt,sha256=OLFq0oDhr77Mp-EYLEcWk5P3jvooOt4IHkTI5KYJMc8,9
66
+ s2_python-0.4.1.dist-info/RECORD,,
@@ -4,12 +4,12 @@ import math
4
4
  from s2python.generated.gen_s2 import Duration as GenDuration
5
5
  from s2python.validate_values_mixin import (
6
6
  catch_and_convert_exceptions,
7
- S2Message,
7
+ S2MessageComponent,
8
8
  )
9
9
 
10
10
 
11
11
  @catch_and_convert_exceptions
12
- class Duration(GenDuration, S2Message["Duration"]):
12
+ class Duration(GenDuration, S2MessageComponent["Duration"]):
13
13
  def to_timedelta(self) -> timedelta:
14
14
  return timedelta(milliseconds=self.root)
15
15
 
@@ -3,12 +3,12 @@ import uuid
3
3
  from s2python.generated.gen_s2 import Handshake as GenHandshake
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
 
9
9
 
10
10
  @catch_and_convert_exceptions
11
- class Handshake(GenHandshake, S2Message["Handshake"]):
11
+ class Handshake(GenHandshake, S2MessageComponent["Handshake"]):
12
12
  model_config = GenHandshake.model_config
13
13
  model_config["validate_assignment"] = True
14
14
 
@@ -3,12 +3,12 @@ import uuid
3
3
  from s2python.generated.gen_s2 import HandshakeResponse as GenHandshakeResponse
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
 
9
9
 
10
10
  @catch_and_convert_exceptions
11
- class HandshakeResponse(GenHandshakeResponse, S2Message["HandshakeResponse"]):
11
+ class HandshakeResponse(GenHandshakeResponse, S2MessageComponent["HandshakeResponse"]):
12
12
  model_config = GenHandshakeResponse.model_config
13
13
  model_config["validate_assignment"] = True
14
14
 
@@ -5,12 +5,12 @@ from s2python.generated.gen_s2 import (
5
5
  )
6
6
  from s2python.validate_values_mixin import (
7
7
  catch_and_convert_exceptions,
8
- S2Message,
8
+ S2MessageComponent,
9
9
  )
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
- class InstructionStatusUpdate(GenInstructionStatusUpdate, S2Message["InstructionStatusUpdate"]):
13
+ class InstructionStatusUpdate(GenInstructionStatusUpdate, S2MessageComponent["InstructionStatusUpdate"]):
14
14
  model_config = GenInstructionStatusUpdate.model_config
15
15
  model_config["validate_assignment"] = True
16
16
 
@@ -1,11 +1,11 @@
1
1
  from typing import Any
2
2
 
3
- from s2python.validate_values_mixin import S2Message, catch_and_convert_exceptions
3
+ from s2python.validate_values_mixin import S2MessageComponent, catch_and_convert_exceptions
4
4
  from s2python.generated.gen_s2 import NumberRange as GenNumberRange
5
5
 
6
6
 
7
7
  @catch_and_convert_exceptions
8
- class NumberRange(GenNumberRange, S2Message["NumberRange"]):
8
+ class NumberRange(GenNumberRange, S2MessageComponent["NumberRange"]):
9
9
  model_config = GenNumberRange.model_config
10
10
  model_config["validate_assignment"] = True
11
11
 
@@ -5,12 +5,12 @@ from s2python.common.power_forecast_element import PowerForecastElement
5
5
  from s2python.generated.gen_s2 import PowerForecast as GenPowerForecast
6
6
  from s2python.validate_values_mixin import (
7
7
  catch_and_convert_exceptions,
8
- S2Message,
8
+ S2MessageComponent,
9
9
  )
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
- class PowerForecast(GenPowerForecast, S2Message["PowerForecast"]):
13
+ class PowerForecast(GenPowerForecast, S2MessageComponent["PowerForecast"]):
14
14
  model_config = GenPowerForecast.model_config
15
15
  model_config["validate_assignment"] = True
16
16
 
@@ -3,14 +3,14 @@ from typing import List
3
3
  from s2python.generated.gen_s2 import PowerForecastElement as GenPowerForecastElement
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
  from s2python.common.duration import Duration
9
9
  from s2python.common.power_forecast_value import PowerForecastValue
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
- class PowerForecastElement(GenPowerForecastElement, S2Message["PowerForecastElement"]):
13
+ class PowerForecastElement(GenPowerForecastElement, S2MessageComponent["PowerForecastElement"]):
14
14
  model_config = GenPowerForecastElement.model_config
15
15
  model_config["validate_assignment"] = True
16
16
 
@@ -1,11 +1,11 @@
1
1
  from s2python.generated.gen_s2 import PowerForecastValue as GenPowerForecastValue
2
2
  from s2python.validate_values_mixin import (
3
3
  catch_and_convert_exceptions,
4
- S2Message,
4
+ S2MessageComponent,
5
5
  )
6
6
 
7
7
 
8
8
  @catch_and_convert_exceptions
9
- class PowerForecastValue(GenPowerForecastValue, S2Message["PowerForecastValue"]):
9
+ class PowerForecastValue(GenPowerForecastValue, S2MessageComponent["PowerForecastValue"]):
10
10
  model_config = GenPowerForecastValue.model_config
11
11
  model_config["validate_assignment"] = True
@@ -5,12 +5,12 @@ from s2python.common.power_value import PowerValue
5
5
  from s2python.generated.gen_s2 import PowerMeasurement as GenPowerMeasurement
6
6
  from s2python.validate_values_mixin import (
7
7
  catch_and_convert_exceptions,
8
- S2Message,
8
+ S2MessageComponent,
9
9
  )
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
- class PowerMeasurement(GenPowerMeasurement, S2Message["PowerMeasurement"]):
13
+ class PowerMeasurement(GenPowerMeasurement, S2MessageComponent["PowerMeasurement"]):
14
14
  model_config = GenPowerMeasurement.model_config
15
15
  model_config["validate_assignment"] = True
16
16
 
@@ -4,13 +4,13 @@ from pydantic import model_validator
4
4
 
5
5
  from s2python.generated.gen_s2 import PowerRange as GenPowerRange
6
6
  from s2python.validate_values_mixin import (
7
- S2Message,
7
+ S2MessageComponent,
8
8
  catch_and_convert_exceptions,
9
9
  )
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
- class PowerRange(GenPowerRange, S2Message["PowerRange"]):
13
+ class PowerRange(GenPowerRange, S2MessageComponent["PowerRange"]):
14
14
  model_config = GenPowerRange.model_config
15
15
  model_config["validate_assignment"] = True
16
16
 
@@ -1,11 +1,11 @@
1
1
  from s2python.generated.gen_s2 import PowerValue as GenPowerValue
2
2
  from s2python.validate_values_mixin import (
3
3
  catch_and_convert_exceptions,
4
- S2Message,
4
+ S2MessageComponent,
5
5
  )
6
6
 
7
7
 
8
8
  @catch_and_convert_exceptions
9
- class PowerValue(GenPowerValue, S2Message["PowerValue"]):
9
+ class PowerValue(GenPowerValue, S2MessageComponent["PowerValue"]):
10
10
  model_config = GenPowerValue.model_config
11
11
  model_config["validate_assignment"] = True
@@ -3,12 +3,12 @@ import uuid
3
3
  from s2python.generated.gen_s2 import ReceptionStatus as GenReceptionStatus
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
 
9
9
 
10
10
  @catch_and_convert_exceptions
11
- class ReceptionStatus(GenReceptionStatus, S2Message["ReceptionStatus"]):
11
+ class ReceptionStatus(GenReceptionStatus, S2MessageComponent["ReceptionStatus"]):
12
12
  model_config = GenReceptionStatus.model_config
13
13
  model_config["validate_assignment"] = True
14
14
 
@@ -8,12 +8,12 @@ from s2python.generated.gen_s2 import (
8
8
  )
9
9
  from s2python.validate_values_mixin import (
10
10
  catch_and_convert_exceptions,
11
- S2Message,
11
+ S2MessageComponent,
12
12
  )
13
13
 
14
14
 
15
15
  @catch_and_convert_exceptions
16
- class ResourceManagerDetails(GenResourceManagerDetails, S2Message["ResourceManagerDetails"]):
16
+ class ResourceManagerDetails(GenResourceManagerDetails, S2MessageComponent["ResourceManagerDetails"]):
17
17
  model_config = GenResourceManagerDetails.model_config
18
18
  model_config["validate_assignment"] = True
19
19
 
@@ -3,12 +3,12 @@ import uuid
3
3
  from s2python.generated.gen_s2 import RevokeObject as GenRevokeObject
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
 
9
9
 
10
10
  @catch_and_convert_exceptions
11
- class RevokeObject(GenRevokeObject, S2Message["RevokeObject"]):
11
+ class RevokeObject(GenRevokeObject, S2MessageComponent["RevokeObject"]):
12
12
  model_config = GenRevokeObject.model_config
13
13
  model_config["validate_assignment"] = True
14
14
 
s2python/common/role.py CHANGED
@@ -1,11 +1,11 @@
1
1
  from s2python.generated.gen_s2 import Role as GenRole
2
2
  from s2python.validate_values_mixin import (
3
- S2Message,
3
+ S2MessageComponent,
4
4
  catch_and_convert_exceptions,
5
5
  )
6
6
 
7
7
 
8
8
  @catch_and_convert_exceptions
9
- class Role(GenRole, S2Message["Role"]):
9
+ class Role(GenRole, S2MessageComponent["Role"]):
10
10
  model_config = GenRole.model_config
11
11
  model_config["validate_assignment"] = True
@@ -3,12 +3,12 @@ import uuid
3
3
  from s2python.generated.gen_s2 import SelectControlType as GenSelectControlType
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
 
9
9
 
10
10
  @catch_and_convert_exceptions
11
- class SelectControlType(GenSelectControlType, S2Message["SelectControlType"]):
11
+ class SelectControlType(GenSelectControlType, S2MessageComponent["SelectControlType"]):
12
12
  model_config = GenSelectControlType.model_config
13
13
  model_config["validate_assignment"] = True
14
14
 
@@ -3,12 +3,12 @@ import uuid
3
3
  from s2python.generated.gen_s2 import SessionRequest as GenSessionRequest
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
 
9
9
 
10
10
  @catch_and_convert_exceptions
11
- class SessionRequest(GenSessionRequest, S2Message["SessionRequest"]):
11
+ class SessionRequest(GenSessionRequest, S2MessageComponent["SessionRequest"]):
12
12
  model_config = GenSessionRequest.model_config
13
13
  model_config["validate_assignment"] = True
14
14
 
s2python/common/timer.py CHANGED
@@ -3,13 +3,13 @@ import uuid
3
3
  from s2python.common.duration import Duration
4
4
  from s2python.generated.gen_s2 import Timer as GenTimer
5
5
  from s2python.validate_values_mixin import (
6
- S2Message,
6
+ S2MessageComponent,
7
7
  catch_and_convert_exceptions,
8
8
  )
9
9
 
10
10
 
11
11
  @catch_and_convert_exceptions
12
- class Timer(GenTimer, S2Message["Timer"]):
12
+ class Timer(GenTimer, S2MessageComponent["Timer"]):
13
13
  model_config = GenTimer.model_config
14
14
  model_config["validate_assignment"] = True
15
15
 
@@ -4,13 +4,13 @@ from typing import Optional, List
4
4
  from s2python.common.duration import Duration
5
5
  from s2python.generated.gen_s2 import Transition as GenTransition
6
6
  from s2python.validate_values_mixin import (
7
- S2Message,
7
+ S2MessageComponent,
8
8
  catch_and_convert_exceptions,
9
9
  )
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
- class Transition(GenTransition, S2Message["Transition"]):
13
+ class Transition(GenTransition, S2MessageComponent["Transition"]):
14
14
  model_config = GenTransition.model_config
15
15
  model_config["validate_assignment"] = True
16
16
 
@@ -12,13 +12,13 @@ from s2python.generated.gen_s2 import (
12
12
  FRBCActuatorDescription as GenFRBCActuatorDescription,
13
13
  )
14
14
  from s2python.validate_values_mixin import (
15
- S2Message,
15
+ S2MessageComponent,
16
16
  catch_and_convert_exceptions,
17
17
  )
18
18
 
19
19
 
20
20
  @catch_and_convert_exceptions
21
- class FRBCActuatorDescription(GenFRBCActuatorDescription, S2Message["FRBCActuatorDescription"]):
21
+ class FRBCActuatorDescription(GenFRBCActuatorDescription, S2MessageComponent["FRBCActuatorDescription"]):
22
22
  model_config = GenFRBCActuatorDescription.model_config
23
23
  model_config["validate_assignment"] = True
24
24
 
@@ -4,12 +4,12 @@ import uuid
4
4
  from s2python.generated.gen_s2 import FRBCActuatorStatus as GenFRBCActuatorStatus
5
5
  from s2python.validate_values_mixin import (
6
6
  catch_and_convert_exceptions,
7
- S2Message,
7
+ S2MessageComponent,
8
8
  )
9
9
 
10
10
 
11
11
  @catch_and_convert_exceptions
12
- class FRBCActuatorStatus(GenFRBCActuatorStatus, S2Message["FRBCActuatorStatus"]):
12
+ class FRBCActuatorStatus(GenFRBCActuatorStatus, S2MessageComponent["FRBCActuatorStatus"]):
13
13
  model_config = GenFRBCActuatorStatus.model_config
14
14
  model_config["validate_assignment"] = True
15
15
 
@@ -9,12 +9,12 @@ from s2python.generated.gen_s2 import (
9
9
  )
10
10
  from s2python.validate_values_mixin import (
11
11
  catch_and_convert_exceptions,
12
- S2Message,
12
+ S2MessageComponent,
13
13
  )
14
14
 
15
15
 
16
16
  @catch_and_convert_exceptions
17
- class FRBCFillLevelTargetProfile(GenFRBCFillLevelTargetProfile, S2Message["FRBCFillLevelTargetProfile"]):
17
+ class FRBCFillLevelTargetProfile(GenFRBCFillLevelTargetProfile, S2MessageComponent["FRBCFillLevelTargetProfile"]):
18
18
  model_config = GenFRBCFillLevelTargetProfile.model_config
19
19
  model_config["validate_assignment"] = True
20
20
 
@@ -8,12 +8,12 @@ from s2python.common import Duration, NumberRange
8
8
  from s2python.generated.gen_s2 import (
9
9
  FRBCFillLevelTargetProfileElement as GenFRBCFillLevelTargetProfileElement,
10
10
  )
11
- from s2python.validate_values_mixin import catch_and_convert_exceptions, S2Message
11
+ from s2python.validate_values_mixin import catch_and_convert_exceptions, S2MessageComponent
12
12
 
13
13
 
14
14
  @catch_and_convert_exceptions
15
15
  class FRBCFillLevelTargetProfileElement(
16
- GenFRBCFillLevelTargetProfileElement, S2Message["FRBCFillLevelTargetProfileElement"]
16
+ GenFRBCFillLevelTargetProfileElement, S2MessageComponent["FRBCFillLevelTargetProfileElement"]
17
17
  ):
18
18
  model_config = GenFRBCFillLevelTargetProfileElement.model_config
19
19
  model_config["validate_assignment"] = True
@@ -3,12 +3,12 @@ import uuid
3
3
  from s2python.generated.gen_s2 import FRBCInstruction as GenFRBCInstruction
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
 
9
9
 
10
10
  @catch_and_convert_exceptions
11
- class FRBCInstruction(GenFRBCInstruction, S2Message["FRBCInstruction"]):
11
+ class FRBCInstruction(GenFRBCInstruction, S2MessageComponent["FRBCInstruction"]):
12
12
  model_config = GenFRBCInstruction.model_config
13
13
  model_config["validate_assignment"] = True
14
14
 
@@ -5,12 +5,12 @@ from s2python.frbc.frbc_leakage_behaviour_element import FRBCLeakageBehaviourEle
5
5
  from s2python.generated.gen_s2 import FRBCLeakageBehaviour as GenFRBCLeakageBehaviour
6
6
  from s2python.validate_values_mixin import (
7
7
  catch_and_convert_exceptions,
8
- S2Message,
8
+ S2MessageComponent,
9
9
  )
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
- class FRBCLeakageBehaviour(GenFRBCLeakageBehaviour, S2Message["FRBCLeakageBehaviour"]):
13
+ class FRBCLeakageBehaviour(GenFRBCLeakageBehaviour, S2MessageComponent["FRBCLeakageBehaviour"]):
14
14
  model_config = GenFRBCLeakageBehaviour.model_config
15
15
  model_config["validate_assignment"] = True
16
16
 
@@ -5,12 +5,12 @@ from typing_extensions import Self
5
5
 
6
6
  from s2python.common import NumberRange
7
7
  from s2python.generated.gen_s2 import FRBCLeakageBehaviourElement as GenFRBCLeakageBehaviourElement
8
- from s2python.validate_values_mixin import catch_and_convert_exceptions, S2Message
8
+ from s2python.validate_values_mixin import catch_and_convert_exceptions, S2MessageComponent
9
9
 
10
10
 
11
11
  @catch_and_convert_exceptions
12
12
  class FRBCLeakageBehaviourElement(
13
- GenFRBCLeakageBehaviourElement, S2Message["FRBCLeakageBehaviourElement"]
13
+ GenFRBCLeakageBehaviourElement, S2MessageComponent["FRBCLeakageBehaviourElement"]
14
14
  ):
15
15
  model_config = GenFRBCLeakageBehaviourElement.model_config
16
16
  model_config["validate_assignment"] = True
@@ -9,14 +9,14 @@ from s2python.common import NumberRange
9
9
  from s2python.frbc.frbc_operation_mode_element import FRBCOperationModeElement
10
10
  from s2python.generated.gen_s2 import FRBCOperationMode as GenFRBCOperationMode
11
11
  from s2python.validate_values_mixin import (
12
- S2Message,
12
+ S2MessageComponent,
13
13
  catch_and_convert_exceptions,
14
14
  )
15
15
  from s2python.utils import pairwise
16
16
 
17
17
 
18
18
  @catch_and_convert_exceptions
19
- class FRBCOperationMode(GenFRBCOperationMode, S2Message["FRBCOperationMode"]):
19
+ class FRBCOperationMode(GenFRBCOperationMode, S2MessageComponent["FRBCOperationMode"]):
20
20
  model_config = GenFRBCOperationMode.model_config
21
21
  model_config["validate_assignment"] = True
22
22
 
@@ -5,13 +5,13 @@ from s2python.generated.gen_s2 import (
5
5
  FRBCOperationModeElement as GenFRBCOperationModeElement,
6
6
  )
7
7
  from s2python.validate_values_mixin import (
8
- S2Message,
8
+ S2MessageComponent,
9
9
  catch_and_convert_exceptions,
10
10
  )
11
11
 
12
12
 
13
13
  @catch_and_convert_exceptions
14
- class FRBCOperationModeElement(GenFRBCOperationModeElement, S2Message["FRBCOperationModeElement"]):
14
+ class FRBCOperationModeElement(GenFRBCOperationModeElement, S2MessageComponent["FRBCOperationModeElement"]):
15
15
  model_config = GenFRBCOperationModeElement.model_config
16
16
  model_config["validate_assignment"] = True
17
17
 
@@ -4,12 +4,12 @@ from s2python.generated.gen_s2 import (
4
4
  )
5
5
  from s2python.validate_values_mixin import (
6
6
  catch_and_convert_exceptions,
7
- S2Message,
7
+ S2MessageComponent,
8
8
  )
9
9
 
10
10
 
11
11
  @catch_and_convert_exceptions
12
- class FRBCStorageDescription(GenFRBCStorageDescription, S2Message["FRBCStorageDescription"]):
12
+ class FRBCStorageDescription(GenFRBCStorageDescription, S2MessageComponent["FRBCStorageDescription"]):
13
13
  model_config = GenFRBCStorageDescription.model_config
14
14
  model_config["validate_assignment"] = True
15
15
 
@@ -3,12 +3,12 @@ import uuid
3
3
  from s2python.generated.gen_s2 import FRBCStorageStatus as GenFRBCStorageStatus
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
 
9
9
 
10
10
  @catch_and_convert_exceptions
11
- class FRBCStorageStatus(GenFRBCStorageStatus, S2Message["FRBCStorageStatus"]):
11
+ class FRBCStorageStatus(GenFRBCStorageStatus, S2MessageComponent["FRBCStorageStatus"]):
12
12
  model_config = GenFRBCStorageStatus.model_config
13
13
  model_config["validate_assignment"] = True
14
14
 
@@ -4,14 +4,14 @@ import uuid
4
4
  from s2python.generated.gen_s2 import FRBCSystemDescription as GenFRBCSystemDescription
5
5
  from s2python.validate_values_mixin import (
6
6
  catch_and_convert_exceptions,
7
- S2Message,
7
+ S2MessageComponent,
8
8
  )
9
9
  from s2python.frbc.frbc_actuator_description import FRBCActuatorDescription
10
10
  from s2python.frbc.frbc_storage_description import FRBCStorageDescription
11
11
 
12
12
 
13
13
  @catch_and_convert_exceptions
14
- class FRBCSystemDescription(GenFRBCSystemDescription, S2Message["FRBCSystemDescription"]):
14
+ class FRBCSystemDescription(GenFRBCSystemDescription, S2MessageComponent["FRBCSystemDescription"]):
15
15
  model_config = GenFRBCSystemDescription.model_config
16
16
  model_config["validate_assignment"] = True
17
17
 
@@ -3,12 +3,12 @@ import uuid
3
3
  from s2python.generated.gen_s2 import FRBCTimerStatus as GenFRBCTimerStatus
4
4
  from s2python.validate_values_mixin import (
5
5
  catch_and_convert_exceptions,
6
- S2Message,
6
+ S2MessageComponent,
7
7
  )
8
8
 
9
9
 
10
10
  @catch_and_convert_exceptions
11
- class FRBCTimerStatus(GenFRBCTimerStatus, S2Message["FRBCTimerStatus"]):
11
+ class FRBCTimerStatus(GenFRBCTimerStatus, S2MessageComponent["FRBCTimerStatus"]):
12
12
  model_config = GenFRBCTimerStatus.model_config
13
13
  model_config["validate_assignment"] = True
14
14
 
@@ -4,13 +4,13 @@ import uuid
4
4
  from s2python.generated.gen_s2 import FRBCUsageForecast as GenFRBCUsageForecast
5
5
  from s2python.validate_values_mixin import (
6
6
  catch_and_convert_exceptions,
7
- S2Message,
7
+ S2MessageComponent,
8
8
  )
9
9
  from s2python.frbc.frbc_usage_forecast_element import FRBCUsageForecastElement
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
- class FRBCUsageForecast(GenFRBCUsageForecast, S2Message["FRBCUsageForecast"]):
13
+ class FRBCUsageForecast(GenFRBCUsageForecast, S2MessageComponent["FRBCUsageForecast"]):
14
14
  model_config = GenFRBCUsageForecast.model_config
15
15
  model_config["validate_assignment"] = True
16
16
 
@@ -5,12 +5,12 @@ from s2python.generated.gen_s2 import (
5
5
  )
6
6
  from s2python.validate_values_mixin import (
7
7
  catch_and_convert_exceptions,
8
- S2Message,
8
+ S2MessageComponent,
9
9
  )
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
- class FRBCUsageForecastElement(GenFRBCUsageForecastElement, S2Message["FRBCUsageForecastElement"]):
13
+ class FRBCUsageForecastElement(GenFRBCUsageForecastElement, S2MessageComponent["FRBCUsageForecastElement"]):
14
14
  model_config = GenFRBCUsageForecastElement.model_config
15
15
  model_config["validate_assignment"] = True
16
16
 
s2python/message.py ADDED
@@ -0,0 +1,50 @@
1
+ from typing import Union
2
+
3
+ from s2python.frbc import (
4
+ FRBCActuatorStatus,
5
+ FRBCFillLevelTargetProfile,
6
+ FRBCInstruction,
7
+ FRBCLeakageBehaviour,
8
+ FRBCStorageStatus,
9
+ FRBCSystemDescription,
10
+ FRBCTimerStatus,
11
+ FRBCUsageForecast
12
+ )
13
+ from s2python.ppbc import (
14
+ PPBCScheduleInstruction,
15
+ )
16
+
17
+ from s2python.common import (
18
+ Handshake,
19
+ HandshakeResponse,
20
+ InstructionStatusUpdate,
21
+ PowerForecast,
22
+ PowerMeasurement,
23
+ ReceptionStatus,
24
+ ResourceManagerDetails,
25
+ RevokeObject,
26
+ SelectControlType,
27
+ SessionRequest
28
+ )
29
+
30
+ S2Message = Union[
31
+ FRBCActuatorStatus,
32
+ FRBCFillLevelTargetProfile,
33
+ FRBCInstruction,
34
+ FRBCLeakageBehaviour,
35
+ FRBCStorageStatus,
36
+ FRBCSystemDescription,
37
+ FRBCTimerStatus,
38
+ FRBCUsageForecast,
39
+ PPBCScheduleInstruction,
40
+ Handshake,
41
+ HandshakeResponse,
42
+ InstructionStatusUpdate,
43
+ PowerForecast,
44
+ PowerMeasurement,
45
+ ReceptionStatus,
46
+ ResourceManagerDetails,
47
+ RevokeObject,
48
+ SelectControlType,
49
+ SessionRequest,
50
+ ]
@@ -5,14 +5,14 @@ from s2python.generated.gen_s2 import (
5
5
  )
6
6
 
7
7
  from s2python.validate_values_mixin import (
8
- S2Message,
8
+ S2MessageComponent,
9
9
  catch_and_convert_exceptions,
10
10
  )
11
11
 
12
12
 
13
13
  @catch_and_convert_exceptions
14
14
  class PPBCEndInterruptionInstruction(
15
- GenPPBCEndInterruptionInstruction, S2Message["PPBCEndInterruptionInstruction"]
15
+ GenPPBCEndInterruptionInstruction, S2MessageComponent["PPBCEndInterruptionInstruction"]
16
16
  ):
17
17
  model_config = GenPPBCEndInterruptionInstruction.model_config
18
18
  model_config["validate_assignment"] = True
@@ -6,7 +6,7 @@ from s2python.generated.gen_s2 import (
6
6
  )
7
7
 
8
8
  from s2python.validate_values_mixin import (
9
- S2Message,
9
+ S2MessageComponent,
10
10
  catch_and_convert_exceptions,
11
11
  )
12
12
 
@@ -15,7 +15,7 @@ from s2python.ppbc.ppbc_power_sequence_container import PPBCPowerSequenceContain
15
15
 
16
16
  @catch_and_convert_exceptions
17
17
  class PPBCPowerProfileDefinition(
18
- GenPPBCPowerProfileDefinition, S2Message["PPBCPowerProfileDefinition"]
18
+ GenPPBCPowerProfileDefinition, S2MessageComponent["PPBCPowerProfileDefinition"]
19
19
  ):
20
20
  model_config = GenPPBCPowerProfileDefinition.model_config
21
21
  model_config["validate_assignment"] = True
@@ -5,7 +5,7 @@ from s2python.generated.gen_s2 import (
5
5
  )
6
6
 
7
7
  from s2python.validate_values_mixin import (
8
- S2Message,
8
+ S2MessageComponent,
9
9
  catch_and_convert_exceptions,
10
10
  )
11
11
 
@@ -16,7 +16,7 @@ from s2python.ppbc.ppbc_power_sequence_container_status import (
16
16
 
17
17
  @catch_and_convert_exceptions
18
18
  class PPBCPowerProfileStatus(
19
- GenPPBCPowerProfileStatus, S2Message["PPBCPowerProfileStatus"]
19
+ GenPPBCPowerProfileStatus, S2MessageComponent["PPBCPowerProfileStatus"]
20
20
  ):
21
21
  model_config = GenPPBCPowerProfileStatus.model_config
22
22
  model_config["validate_assignment"] = True
@@ -6,7 +6,7 @@ from s2python.generated.gen_s2 import (
6
6
  )
7
7
 
8
8
  from s2python.validate_values_mixin import (
9
- S2Message,
9
+ S2MessageComponent,
10
10
  catch_and_convert_exceptions,
11
11
  )
12
12
 
@@ -15,7 +15,7 @@ from s2python.common import Duration
15
15
 
16
16
 
17
17
  @catch_and_convert_exceptions
18
- class PPBCPowerSequence(GenPPBCPowerSequence, S2Message["PPBCPowerSequence"]):
18
+ class PPBCPowerSequence(GenPPBCPowerSequence, S2MessageComponent["PPBCPowerSequence"]):
19
19
  model_config = GenPPBCPowerSequence.model_config
20
20
  model_config["validate_assignment"] = True
21
21
 
@@ -7,7 +7,7 @@ from s2python.generated.gen_s2 import (
7
7
  )
8
8
 
9
9
  from s2python.validate_values_mixin import (
10
- S2Message,
10
+ S2MessageComponent,
11
11
  catch_and_convert_exceptions,
12
12
  )
13
13
 
@@ -16,7 +16,7 @@ from s2python.ppbc.ppbc_power_sequence import PPBCPowerSequence
16
16
 
17
17
  @catch_and_convert_exceptions
18
18
  class PPBCPowerSequenceContainer(
19
- GenPPBCPowerSequenceContainer, S2Message["PPBCPowerSequenceContainer"]
19
+ GenPPBCPowerSequenceContainer, S2MessageComponent["PPBCPowerSequenceContainer"]
20
20
  ):
21
21
  model_config = GenPPBCPowerSequenceContainer.model_config
22
22
  model_config["validate_assignment"] = True
@@ -6,14 +6,14 @@ from s2python.generated.gen_s2 import (
6
6
  )
7
7
 
8
8
  from s2python.validate_values_mixin import (
9
- S2Message,
9
+ S2MessageComponent,
10
10
  catch_and_convert_exceptions,
11
11
  )
12
12
 
13
13
 
14
14
  @catch_and_convert_exceptions
15
15
  class PPBCPowerSequenceContainerStatus(
16
- GenPPBCPowerSequenceContainerStatus, S2Message["PPBCPowerSequenceContainerStatus"]
16
+ GenPPBCPowerSequenceContainerStatus, S2MessageComponent["PPBCPowerSequenceContainerStatus"]
17
17
  ):
18
18
  model_config = GenPPBCPowerSequenceContainerStatus.model_config
19
19
  model_config["validate_assignment"] = True
@@ -5,7 +5,7 @@ from s2python.generated.gen_s2 import (
5
5
  )
6
6
 
7
7
  from s2python.validate_values_mixin import (
8
- S2Message,
8
+ S2MessageComponent,
9
9
  catch_and_convert_exceptions,
10
10
  )
11
11
 
@@ -14,7 +14,7 @@ from s2python.common import Duration, PowerForecastValue
14
14
 
15
15
  @catch_and_convert_exceptions
16
16
  class PPBCPowerSequenceElement(
17
- GenPPBCPowerSequenceElement, S2Message["PPBCPowerSequenceElement"]
17
+ GenPPBCPowerSequenceElement, S2MessageComponent["PPBCPowerSequenceElement"]
18
18
  ):
19
19
  model_config = GenPPBCPowerSequenceElement.model_config
20
20
  model_config["validate_assignment"] = True
@@ -5,13 +5,13 @@ from s2python.generated.gen_s2 import (
5
5
  )
6
6
  from s2python.validate_values_mixin import (
7
7
  catch_and_convert_exceptions,
8
- S2Message,
8
+ S2MessageComponent,
9
9
  )
10
10
 
11
11
 
12
12
  @catch_and_convert_exceptions
13
13
  class PPBCScheduleInstruction(
14
- GenPPBCScheduleInstruction, S2Message["PPBCScheduleInstruction"]
14
+ GenPPBCScheduleInstruction, S2MessageComponent["PPBCScheduleInstruction"]
15
15
  ):
16
16
  model_config = GenPPBCScheduleInstruction.model_config
17
17
  model_config["validate_assignment"] = True
@@ -5,14 +5,14 @@ from s2python.generated.gen_s2 import (
5
5
  )
6
6
 
7
7
  from s2python.validate_values_mixin import (
8
- S2Message,
8
+ S2MessageComponent,
9
9
  catch_and_convert_exceptions,
10
10
  )
11
11
 
12
12
 
13
13
  @catch_and_convert_exceptions
14
14
  class PPBCStartInterruptionInstruction(
15
- GenPPBCStartInterruptionInstruction, S2Message["PPBCStartInterruptionInstruction"]
15
+ GenPPBCStartInterruptionInstruction, S2MessageComponent["PPBCStartInterruptionInstruction"]
16
16
  ):
17
17
  model_config = GenPPBCStartInterruptionInstruction.model_config
18
18
  model_config["validate_assignment"] = True
s2python/s2_connection.py CHANGED
@@ -27,7 +27,7 @@ from s2python.reception_status_awaiter import ReceptionStatusAwaiter
27
27
  from s2python.s2_control_type import S2ControlType
28
28
  from s2python.s2_parser import S2Parser
29
29
  from s2python.s2_validation_error import S2ValidationError
30
- from s2python.validate_values_mixin import S2Message
30
+ from s2python.message import S2Message
31
31
  from s2python.version import S2_VERSION
32
32
 
33
33
  logger = logging.getLogger("s2python")
@@ -141,7 +141,7 @@ class MessageHandlers:
141
141
  """
142
142
  handler = self.handlers.get(type(msg))
143
143
  if handler is not None:
144
- send_okay = SendOkay(connection, msg.message_id) # type: ignore[attr-defined]
144
+ send_okay = SendOkay(connection, msg.message_id) # type: ignore[attr-defined, union-attr]
145
145
 
146
146
  try:
147
147
  if asyncio.iscoroutinefunction(handler):
@@ -158,9 +158,9 @@ class MessageHandlers:
158
158
  except Exception:
159
159
  if not send_okay.status_is_send.is_set():
160
160
  await connection.respond_with_reception_status(
161
- subject_message_id=str(msg.message_id), # type: ignore[attr-defined]
161
+ subject_message_id=str(msg.message_id), # type: ignore[attr-defined, union-attr]
162
162
  status=ReceptionStatusValues.PERMANENT_ERROR,
163
- diagnostic_label=f"While processing message {msg.message_id} " # type: ignore[attr-defined]
163
+ diagnostic_label=f"While processing message {msg.message_id} " # type: ignore[attr-defined, union-attr] # pylint: disable=line-too-long
164
164
  f"an unrecoverable error occurred.",
165
165
  )
166
166
  raise
@@ -490,17 +490,17 @@ class S2Connection: # pylint: disable=too-many-instance-attributes
490
490
  await self._send_and_forget(s2_msg)
491
491
  logger.debug(
492
492
  "Waiting for ReceptionStatus for %s %s seconds",
493
- s2_msg.message_id, # type: ignore[attr-defined]
493
+ s2_msg.message_id, # type: ignore[attr-defined, union-attr]
494
494
  timeout_reception_status,
495
495
  )
496
496
  try:
497
497
  reception_status = await self.reception_status_awaiter.wait_for_reception_status(
498
- s2_msg.message_id, timeout_reception_status # type: ignore[attr-defined]
498
+ s2_msg.message_id, timeout_reception_status # type: ignore[attr-defined, union-attr]
499
499
  )
500
500
  except TimeoutError:
501
501
  logger.error(
502
502
  "Did not receive a reception status on time for %s",
503
- s2_msg.message_id, # type: ignore[attr-defined]
503
+ s2_msg.message_id, # type: ignore[attr-defined, union-attr]
504
504
  )
505
505
  self._stop_event.set()
506
506
  raise
@@ -4,7 +4,7 @@ import typing
4
4
  from s2python.common import ControlType as ProtocolControlType
5
5
  from s2python.frbc import FRBCInstruction
6
6
  from s2python.ppbc import PPBCScheduleInstruction
7
- from s2python.validate_values_mixin import S2Message
7
+ from s2python.message import S2Message
8
8
 
9
9
  if typing.TYPE_CHECKING:
10
10
  from s2python.s2_connection import S2Connection, MessageHandlers
s2python/s2_parser.py CHANGED
@@ -26,14 +26,15 @@ from s2python.frbc import (
26
26
  )
27
27
  from s2python.ppbc import PPBCScheduleInstruction
28
28
 
29
- from s2python.validate_values_mixin import S2Message
29
+ from s2python.message import S2Message
30
+ from s2python.validate_values_mixin import S2MessageComponent
30
31
  from s2python.s2_validation_error import S2ValidationError
31
32
 
32
33
 
33
34
  LOGGER = logging.getLogger(__name__)
34
35
  S2MessageType = str
35
36
 
36
- M = TypeVar("M", bound=S2Message)
37
+ M = TypeVar("M", bound=S2MessageComponent)
37
38
 
38
39
 
39
40
  # May be generated with development_utilities/generate_s2_message_type_to_class.py
@@ -15,7 +15,7 @@ MappingIntStrAny = Mapping[IntStr, Any]
15
15
  C = TypeVar("C", bound="BaseModel")
16
16
 
17
17
 
18
- class S2Message(BaseModel, Generic[C]):
18
+ class S2MessageComponent(BaseModel, Generic[C]):
19
19
  def to_json(self: C) -> str:
20
20
  try:
21
21
  return self.model_dump_json(by_alias=True, exclude_none=True)
@@ -59,7 +59,7 @@ def convert_to_s2exception(f: Callable) -> Callable:
59
59
  return inner
60
60
 
61
61
 
62
- def catch_and_convert_exceptions(input_class: Type[S2Message[B_co]]) -> Type[S2Message[B_co]]:
62
+ def catch_and_convert_exceptions(input_class: Type[S2MessageComponent[B_co]]) -> Type[S2MessageComponent[B_co]]:
63
63
  input_class.__init__ = convert_to_s2exception(input_class.__init__) # type: ignore[method-assign]
64
64
  input_class.__setattr__ = convert_to_s2exception(input_class.__setattr__) # type: ignore[method-assign]
65
65
  input_class.model_validate_json = convert_to_s2exception( # type: ignore[method-assign]
@@ -1,65 +0,0 @@
1
- s2python/__init__.py,sha256=e5lwvqsPl-z7IfEd0hRQhLBRKBYcuw2eqrecXnMfLdg,384
2
- s2python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- s2python/reception_status_awaiter.py,sha256=jKMliFk1XxwsEGtx3vFESbJhUtClB7cTu-td90-qBN8,2137
4
- s2python/s2_connection.py,sha256=S36VNTLP3kMvcdiaw4Slw438CDPF7O1mugEarx8KIwY,20075
5
- s2python/s2_control_type.py,sha256=Orx3RJ8b-ybftU8zJJ5zzUVlS_Ns81OTxucKTcaYgA8,2874
6
- s2python/s2_parser.py,sha256=0WZvQl_Lcmw8YhHf5kQxxxhwMFYA6Uegkmw1i0s12k0,4297
7
- s2python/s2_validation_error.py,sha256=BkOLoNsrcQ3MzdCYaPDgs1Wu6lPdlQDpZsTpykKGQmE,384
8
- s2python/utils.py,sha256=QX9b-mi-H_YUGTmGmJsrAbaWWM3dgaoaRLRXHHlaZDE,212
9
- s2python/validate_values_mixin.py,sha256=hfXW-ViHSwahIgD2r1tmdOtt9uOZEdMCf9Bw2mRJUM8,2541
10
- s2python/version.py,sha256=IBzoytgbYYYekQnSTfSmWeYAZ4c_yUFU2oLIAG4UYjs,45
11
- s2python/common/__init__.py,sha256=yEAXCS59XpNOEXbEXoN04SwultP-3evgVzFuEUSgB5I,1345
12
- s2python/common/duration.py,sha256=Sw1l0-omcPCzlWJP-xkMioQjiBwjTICGoqtYi8BoVOM,649
13
- s2python/common/handshake.py,sha256=43MGJWjbPT53DQUP2kclMY82wefcW2uJ3UyHezJPZZU,449
14
- s2python/common/handshake_response.py,sha256=CFZ9tPbYWRqvl8HlvcOSRW1akAf8P63Vv_t0dbxAaKA,505
15
- s2python/common/instruction_status_update.py,sha256=d-Z_0fZh_yIC-cupkaDG-x19uVxznQVHsyacZW5hwQ0,674
16
- s2python/common/number_range.py,sha256=4OT4zzmsgytM0cScBuIqcTl0w1I0gAcbcaN7oRfJiak,723
17
- s2python/common/power_forecast.py,sha256=foJKA9Wmm-CzkK7qIfaW4963NqoY1-pZcvBXmUMPazw,686
18
- s2python/common/power_forecast_element.py,sha256=HdetbhqTqXa_TWMkpL7P7r3yKdmiNMFmZNtrMT4fAlw,787
19
- s2python/common/power_forecast_value.py,sha256=o-KegTZjUsrziNenoZZ9pjfYrkrLG_b5Cr8GcVcebD4,393
20
- s2python/common/power_measurement.py,sha256=t6qDcisnI8xSEmfOZeI35MMgkBB5vFqnnc5KsqrPiqk,675
21
- s2python/common/power_range.py,sha256=tvzb9cyVs1NLsiN6jo8jdHo9vRqCu4bnvkBvsoqKUbw,668
22
- s2python/common/power_value.py,sha256=yVo0OotIk1_SccOLMfkDAYp4V5xCoPUgHDEJBGg8GCs,345
23
- s2python/common/reception_status.py,sha256=hOgLDy7KN0aWPiKfN9u-AUUeXnrpW2UDVZRAcUkefZY,507
24
- s2python/common/resource_manager_details.py,sha256=CCvnS21vywcaZAAQzPIzU42CkydnBbkAVjgoKbtDeSE,1026
25
- s2python/common/revoke_object.py,sha256=6PoKLZjPSz43O_W58zSUFNYamRJD-X1YF1gi0WLtt9s,567
26
- s2python/common/role.py,sha256=N8nYdMquBIwNx5RS8UrMGHDHdXy57P_iAcDpdDYm62A,309
27
- s2python/common/select_control_type.py,sha256=xCd18THcBthEJjLz9otHscb4pgxsUYghlcxzlEXvhPs,505
28
- s2python/common/session_request.py,sha256=kFAqUkl9_yVSLvCT3E0BUQKJC-JPhZk3rW01GiT3tQ4,484
29
- s2python/common/support.py,sha256=Kbrf_KGB45Wfr8j2pqDe1lLde6CIr3nl_LYkWnilmV0,1015
30
- s2python/common/timer.py,sha256=_zokHPmPHKHx-H9vBau18pcN1HrYBIhWSKkzFzd999w,538
31
- s2python/common/transition.py,sha256=nUdJaiWgf6tAgfAMqJmdsKmob063NcZJZMt0ysjjkWE,1046
32
- s2python/frbc/__init__.py,sha256=ROV3qZoldPkdgVFfMQr5Mf3GDfBzXaMfhNNCuXY6T0s,1104
33
- s2python/frbc/frbc_actuator_description.py,sha256=Ig2jmf2_qsDBfuW90rAVD-e0hkmkIqKdTcQZI3XY3S8,6148
34
- s2python/frbc/frbc_actuator_status.py,sha256=4XGk-ueXq6o_kOLTXGK_bfEFdJy8p8jjHDLyohzykSQ,955
35
- s2python/frbc/frbc_fill_level_target_profile.py,sha256=od1w2nR35sckV4Bvp_EpfZaMJxKRrDu66X8mliSRuec,862
36
- s2python/frbc/frbc_fill_level_target_profile_element.py,sha256=KG0th6Zp3T7QnE0eZXpaC3X1zVWkUAi-tSmik0ZXGKk,1262
37
- s2python/frbc/frbc_instruction.py,sha256=EyNnt2P9w0955eYoeWPqaHSco0NzbvYAGD0F9vYS0SM,791
38
- s2python/frbc/frbc_leakage_behaviour.py,sha256=Esjmsy9jyi2naokTVu6y9oPBVjjlTyEguPF2snQMj7w,776
39
- s2python/frbc/frbc_leakage_behaviour_element.py,sha256=rpfp87zl7xgcx4bXLj362VkdrKOxhs9m9fZDe42z4tg,1085
40
- s2python/frbc/frbc_operation_mode.py,sha256=B30t7ITSCAzBdNZv4hns7VacVsRN0DyydgTvoF9JYdY,1881
41
- s2python/frbc/frbc_operation_mode_element.py,sha256=uin-wgbySldMBbjk14l_ZOH7lpsyXeo1jjCYolB1RNI,1055
42
- s2python/frbc/frbc_storage_description.py,sha256=K1bjmG5_2SP14PMIkkldTyvTWQzDTC9KYFuiksW0AS8,604
43
- s2python/frbc/frbc_storage_status.py,sha256=TKQeX1vsnYrblgS8UeDu0Siy7p0zedYck85vFVkdiT8,505
44
- s2python/frbc/frbc_system_description.py,sha256=g94kqGRNcPXcQQzpb9Wz7dDncbuJsmA4KHa0r7b3r4w,962
45
- s2python/frbc/frbc_timer_status.py,sha256=Lh95iJ62FQGeqSTH5oDJnxzWBCzaNZAjunQyGEPOlcM,693
46
- s2python/frbc/frbc_usage_forecast.py,sha256=e5tvKpVAsKbjQxN-g8T3RDNivwibJVtkjqmlOHpd2ek,729
47
- s2python/frbc/frbc_usage_forecast_element.py,sha256=Njox8S11L3b_b8F-eengIRCSMvHQwp6LgVCE3_u3DPo,583
48
- s2python/frbc/rm.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
- s2python/generated/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
50
- s2python/generated/gen_s2.py,sha256=eg9J0pcWxCy0oXO8eq9AtoB-GONHZLNd8JANpMhKQCQ,63573
51
- s2python/ppbc/__init__.py,sha256=Rnfl_1n0gkc9mASSzBBMFEKYzJqugV5POtttjLWx_pI,665
52
- s2python/ppbc/ppbc_end_interruption_instruction.py,sha256=4rkgcBSVUkiQU3ZB22wfeTCYNLxGqFChyVbYdQQTQtU,1179
53
- s2python/ppbc/ppbc_power_profile_definition.py,sha256=xLPSoDNS7P_asLmx2dwgZZv6b29YlwOaTNRp1sUR-TQ,973
54
- s2python/ppbc/ppbc_power_profile_status.py,sha256=EP9qjLTx9PYranSQIA3FKRbKjN6vGuffRG5X-nK4v2k,749
55
- s2python/ppbc/ppbc_power_sequence.py,sha256=8ppPEFUE8dh8Tm2bH18CWT12N870HCr22FKlET8zXDQ,1140
56
- s2python/ppbc/ppbc_power_sequence_container.py,sha256=hxm_czNgficyvfROcea27eRz3jWndkfQYh6Jybo4eHM,811
57
- s2python/ppbc/ppbc_power_sequence_container_status.py,sha256=b2G21rSshVhGwIjzY3qHOeX6WXHYLcKiLhyR1R688zo,1142
58
- s2python/ppbc/ppbc_power_sequence_element.py,sha256=F2JfZcykBFIl1rCwk9tPhnXmF4O752msT73IsDEeJVU,779
59
- s2python/ppbc/ppbc_schedule_instruction.py,sha256=tOJUMw3z5uTKNADkS23N_ELJnTd8Qede_bbOldatOvk,1080
60
- s2python/ppbc/ppbc_start_interruption_instruction.py,sha256=LLwnocArKzwnk9WWhV9iTX60Eq2Qvyn1q7LtUhiccfs,1201
61
- s2_python-0.3.1.dist-info/METADATA,sha256=6DMGsWryknhecBV1v6URD3ZfNNbdhJorr1KFj_VxHt4,3595
62
- s2_python-0.3.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
63
- s2_python-0.3.1.dist-info/entry_points.txt,sha256=feX-xmgJZgSe5-jxMgFKPKCJz4Ys3eQcGrsXsirNZyM,61
64
- s2_python-0.3.1.dist-info/top_level.txt,sha256=OLFq0oDhr77Mp-EYLEcWk5P3jvooOt4IHkTI5KYJMc8,9
65
- s2_python-0.3.1.dist-info/RECORD,,