s2-python 0.3.0__tar.gz → 0.4.0__tar.gz

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 (73) hide show
  1. {s2_python-0.3.0 → s2_python-0.4.0}/PKG-INFO +2 -2
  2. {s2_python-0.3.0 → s2_python-0.4.0}/setup.cfg +1 -1
  3. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2_python.egg-info/PKG-INFO +2 -2
  4. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2_python.egg-info/SOURCES.txt +12 -1
  5. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/duration.py +2 -2
  6. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/handshake.py +2 -2
  7. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/handshake_response.py +2 -2
  8. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/instruction_status_update.py +2 -2
  9. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/number_range.py +2 -2
  10. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/power_forecast.py +2 -2
  11. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/power_forecast_element.py +2 -2
  12. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/power_forecast_value.py +2 -2
  13. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/power_measurement.py +2 -2
  14. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/power_range.py +2 -2
  15. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/power_value.py +2 -2
  16. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/reception_status.py +2 -2
  17. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/resource_manager_details.py +2 -2
  18. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/revoke_object.py +2 -2
  19. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/role.py +2 -2
  20. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/select_control_type.py +2 -2
  21. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/session_request.py +2 -2
  22. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/timer.py +2 -2
  23. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/transition.py +2 -2
  24. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_actuator_description.py +2 -2
  25. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_actuator_status.py +2 -2
  26. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_fill_level_target_profile.py +2 -2
  27. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_fill_level_target_profile_element.py +2 -2
  28. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_instruction.py +2 -2
  29. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_leakage_behaviour.py +2 -2
  30. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_leakage_behaviour_element.py +2 -2
  31. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_operation_mode.py +2 -2
  32. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_operation_mode_element.py +2 -2
  33. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_storage_description.py +2 -2
  34. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_storage_status.py +2 -2
  35. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_system_description.py +2 -2
  36. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_timer_status.py +2 -2
  37. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_usage_forecast.py +2 -2
  38. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/frbc_usage_forecast_element.py +2 -2
  39. s2_python-0.4.0/src/s2python/message.py +50 -0
  40. s2_python-0.4.0/src/s2python/ppbc/__init__.py +12 -0
  41. s2_python-0.4.0/src/s2python/ppbc/ppbc_end_interruption_instruction.py +32 -0
  42. s2_python-0.4.0/src/s2python/ppbc/ppbc_power_profile_definition.py +27 -0
  43. s2_python-0.4.0/src/s2python/ppbc/ppbc_power_profile_status.py +26 -0
  44. s2_python-0.4.0/src/s2python/ppbc/ppbc_power_sequence.py +30 -0
  45. s2_python-0.4.0/src/s2python/ppbc/ppbc_power_sequence_container.py +27 -0
  46. s2_python-0.4.0/src/s2python/ppbc/ppbc_power_sequence_container_status.py +32 -0
  47. s2_python-0.4.0/src/s2python/ppbc/ppbc_power_sequence_element.py +25 -0
  48. s2_python-0.4.0/src/s2python/ppbc/ppbc_schedule_instruction.py +33 -0
  49. s2_python-0.4.0/src/s2python/ppbc/ppbc_start_interruption_instruction.py +32 -0
  50. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/s2_connection.py +7 -7
  51. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/s2_control_type.py +27 -3
  52. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/s2_parser.py +12 -4
  53. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/validate_values_mixin.py +2 -2
  54. {s2_python-0.3.0 → s2_python-0.4.0}/README.rst +0 -0
  55. {s2_python-0.3.0 → s2_python-0.4.0}/pyproject.toml +0 -0
  56. {s2_python-0.3.0 → s2_python-0.4.0}/setup.py +0 -0
  57. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2_python.egg-info/dependency_links.txt +0 -0
  58. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2_python.egg-info/entry_points.txt +0 -0
  59. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2_python.egg-info/not-zip-safe +0 -0
  60. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2_python.egg-info/requires.txt +0 -0
  61. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2_python.egg-info/top_level.txt +0 -0
  62. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/__init__.py +0 -0
  63. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/__init__.py +0 -0
  64. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/common/support.py +0 -0
  65. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/__init__.py +0 -0
  66. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/frbc/rm.py +0 -0
  67. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/generated/__init__.py +0 -0
  68. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/generated/gen_s2.py +0 -0
  69. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/py.typed +0 -0
  70. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/reception_status_awaiter.py +0 -0
  71. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/s2_validation_error.py +0 -0
  72. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/utils.py +0 -0
  73. {s2_python-0.3.0 → s2_python-0.4.0}/src/s2python/version.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: s2-python
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: S2 Protocol Python Wrapper
5
5
  Home-page: https://github.com/flexiblepower/s2-ws-json-python
6
6
  Author: Flexiblepower
@@ -8,7 +8,7 @@ license_files = LICENSE.txt
8
8
  long_description = file: README.rst
9
9
  long_description_content_type = text/x-rst; charset=UTF-8
10
10
  url = https://github.com/flexiblepower/s2-ws-json-python
11
- version = 0.3.0
11
+ version = 0.4.0
12
12
  platforms = Linux
13
13
  classifiers =
14
14
  Development Status :: 4 - Beta
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: s2-python
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: S2 Protocol Python Wrapper
5
5
  Home-page: https://github.com/flexiblepower/s2-ws-json-python
6
6
  Author: Flexiblepower
@@ -10,6 +10,7 @@ src/s2_python.egg-info/not-zip-safe
10
10
  src/s2_python.egg-info/requires.txt
11
11
  src/s2_python.egg-info/top_level.txt
12
12
  src/s2python/__init__.py
13
+ src/s2python/message.py
13
14
  src/s2python/py.typed
14
15
  src/s2python/reception_status_awaiter.py
15
16
  src/s2python/s2_connection.py
@@ -58,4 +59,14 @@ src/s2python/frbc/frbc_usage_forecast.py
58
59
  src/s2python/frbc/frbc_usage_forecast_element.py
59
60
  src/s2python/frbc/rm.py
60
61
  src/s2python/generated/__init__.py
61
- src/s2python/generated/gen_s2.py
62
+ src/s2python/generated/gen_s2.py
63
+ src/s2python/ppbc/__init__.py
64
+ src/s2python/ppbc/ppbc_end_interruption_instruction.py
65
+ src/s2python/ppbc/ppbc_power_profile_definition.py
66
+ src/s2python/ppbc/ppbc_power_profile_status.py
67
+ src/s2python/ppbc/ppbc_power_sequence.py
68
+ src/s2python/ppbc/ppbc_power_sequence_container.py
69
+ src/s2python/ppbc/ppbc_power_sequence_container_status.py
70
+ src/s2python/ppbc/ppbc_power_sequence_element.py
71
+ src/s2python/ppbc/ppbc_schedule_instruction.py
72
+ src/s2python/ppbc/ppbc_start_interruption_instruction.py
@@ -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
 
@@ -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
 
@@ -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
 
@@ -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
+ ]
@@ -0,0 +1,12 @@
1
+ from s2python.ppbc.ppbc_schedule_instruction import PPBCScheduleInstruction
2
+ from s2python.ppbc.ppbc_end_interruption_instruction import (
3
+ PPBCEndInterruptionInstruction,
4
+ )
5
+ from s2python.ppbc.ppbc_power_profile_definition import PPBCPowerProfileDefinition
6
+ from s2python.ppbc.ppbc_power_sequence_container import PPBCPowerSequenceContainer
7
+ from s2python.ppbc.ppbc_power_sequence import PPBCPowerSequence
8
+ from s2python.ppbc.ppbc_power_profile_status import PPBCPowerProfileStatus
9
+ from s2python.ppbc.ppbc_power_sequence_container_status import (
10
+ PPBCPowerSequenceContainerStatus,
11
+ )
12
+ from s2python.ppbc.ppbc_power_sequence_element import PPBCPowerSequenceElement
@@ -0,0 +1,32 @@
1
+ import uuid
2
+
3
+ from s2python.generated.gen_s2 import (
4
+ PPBCEndInterruptionInstruction as GenPPBCEndInterruptionInstruction,
5
+ )
6
+
7
+ from s2python.validate_values_mixin import (
8
+ S2MessageComponent,
9
+ catch_and_convert_exceptions,
10
+ )
11
+
12
+
13
+ @catch_and_convert_exceptions
14
+ class PPBCEndInterruptionInstruction(
15
+ GenPPBCEndInterruptionInstruction, S2MessageComponent["PPBCEndInterruptionInstruction"]
16
+ ):
17
+ model_config = GenPPBCEndInterruptionInstruction.model_config
18
+ model_config["validate_assignment"] = True
19
+
20
+ id: uuid.UUID = GenPPBCEndInterruptionInstruction.model_fields["id"] # type: ignore[assignment]
21
+ power_profile_id: uuid.UUID = GenPPBCEndInterruptionInstruction.model_fields[
22
+ "power_profile_id"
23
+ ] # type: ignore[assignment]
24
+ sequence_container_id: uuid.UUID = GenPPBCEndInterruptionInstruction.model_fields[
25
+ "sequence_container_id"
26
+ ] # type: ignore[assignment]
27
+ power_sequence_id: uuid.UUID = GenPPBCEndInterruptionInstruction.model_fields[
28
+ "power_sequence_id"
29
+ ] # type: ignore[assignment]
30
+ abnormal_condition: bool = GenPPBCEndInterruptionInstruction.model_fields[
31
+ "abnormal_condition"
32
+ ] # type: ignore[assignment]
@@ -0,0 +1,27 @@
1
+ from typing import List
2
+ import uuid
3
+
4
+ from s2python.generated.gen_s2 import (
5
+ PPBCPowerProfileDefinition as GenPPBCPowerProfileDefinition,
6
+ )
7
+
8
+ from s2python.validate_values_mixin import (
9
+ S2MessageComponent,
10
+ catch_and_convert_exceptions,
11
+ )
12
+
13
+ from s2python.ppbc.ppbc_power_sequence_container import PPBCPowerSequenceContainer
14
+
15
+
16
+ @catch_and_convert_exceptions
17
+ class PPBCPowerProfileDefinition(
18
+ GenPPBCPowerProfileDefinition, S2MessageComponent["PPBCPowerProfileDefinition"]
19
+ ):
20
+ model_config = GenPPBCPowerProfileDefinition.model_config
21
+ model_config["validate_assignment"] = True
22
+
23
+ message_id: uuid.UUID = GenPPBCPowerProfileDefinition.model_fields["message_id"] # type: ignore[assignment]
24
+ id: uuid.UUID = GenPPBCPowerProfileDefinition.model_fields["id"] # type: ignore[assignment]
25
+ power_sequences_containers: List[PPBCPowerSequenceContainer] = (
26
+ GenPPBCPowerProfileDefinition.model_fields["power_sequences_containers"] # type: ignore[assignment]
27
+ )
@@ -0,0 +1,26 @@
1
+ from typing import List
2
+
3
+ from s2python.generated.gen_s2 import (
4
+ PPBCPowerProfileStatus as GenPPBCPowerProfileStatus,
5
+ )
6
+
7
+ from s2python.validate_values_mixin import (
8
+ S2MessageComponent,
9
+ catch_and_convert_exceptions,
10
+ )
11
+
12
+ from s2python.ppbc.ppbc_power_sequence_container_status import (
13
+ PPBCPowerSequenceContainerStatus,
14
+ )
15
+
16
+
17
+ @catch_and_convert_exceptions
18
+ class PPBCPowerProfileStatus(
19
+ GenPPBCPowerProfileStatus, S2MessageComponent["PPBCPowerProfileStatus"]
20
+ ):
21
+ model_config = GenPPBCPowerProfileStatus.model_config
22
+ model_config["validate_assignment"] = True
23
+
24
+ sequence_container_status: List[PPBCPowerSequenceContainerStatus] = (
25
+ GenPPBCPowerProfileStatus.model_fields["sequence_container_status"] # type: ignore[assignment]
26
+ )
@@ -0,0 +1,30 @@
1
+ from typing import List
2
+ import uuid
3
+
4
+ from s2python.generated.gen_s2 import (
5
+ PPBCPowerSequence as GenPPBCPowerSequence,
6
+ )
7
+
8
+ from s2python.validate_values_mixin import (
9
+ S2MessageComponent,
10
+ catch_and_convert_exceptions,
11
+ )
12
+
13
+ from s2python.ppbc.ppbc_power_sequence_element import PPBCPowerSequenceElement
14
+ from s2python.common import Duration
15
+
16
+
17
+ @catch_and_convert_exceptions
18
+ class PPBCPowerSequence(GenPPBCPowerSequence, S2MessageComponent["PPBCPowerSequence"]):
19
+ model_config = GenPPBCPowerSequence.model_config
20
+ model_config["validate_assignment"] = True
21
+
22
+ id: uuid.UUID = GenPPBCPowerSequence.model_fields["id"] # type: ignore[assignment]
23
+ elements: List[PPBCPowerSequenceElement] = GenPPBCPowerSequence.model_fields[
24
+ "elements"
25
+ ] # type: ignore[assignment]
26
+ is_interruptible: bool = GenPPBCPowerSequence.model_fields["is_interruptible"] # type: ignore[assignment]
27
+ max_pause_before: Duration = GenPPBCPowerSequence.model_fields["max_pause_before"] # type: ignore[assignment]
28
+ abnormal_condition_only: bool = GenPPBCPowerSequence.model_fields[
29
+ "abnormal_condition_only"
30
+ ] # type: ignore[assignment]
@@ -0,0 +1,27 @@
1
+ from typing import List
2
+ import uuid
3
+
4
+
5
+ from s2python.generated.gen_s2 import (
6
+ PPBCPowerSequenceContainer as GenPPBCPowerSequenceContainer,
7
+ )
8
+
9
+ from s2python.validate_values_mixin import (
10
+ S2MessageComponent,
11
+ catch_and_convert_exceptions,
12
+ )
13
+
14
+ from s2python.ppbc.ppbc_power_sequence import PPBCPowerSequence
15
+
16
+
17
+ @catch_and_convert_exceptions
18
+ class PPBCPowerSequenceContainer(
19
+ GenPPBCPowerSequenceContainer, S2MessageComponent["PPBCPowerSequenceContainer"]
20
+ ):
21
+ model_config = GenPPBCPowerSequenceContainer.model_config
22
+ model_config["validate_assignment"] = True
23
+
24
+ id: uuid.UUID = GenPPBCPowerSequenceContainer.model_fields["id"] # type: ignore[assignment]
25
+ power_sequences: List[PPBCPowerSequence] = (
26
+ GenPPBCPowerSequenceContainer.model_fields["power_sequences"] # type: ignore[assignment]
27
+ )
@@ -0,0 +1,32 @@
1
+ import uuid
2
+ from typing import Union
3
+
4
+ from s2python.generated.gen_s2 import (
5
+ PPBCPowerSequenceContainerStatus as GenPPBCPowerSequenceContainerStatus,
6
+ )
7
+
8
+ from s2python.validate_values_mixin import (
9
+ S2MessageComponent,
10
+ catch_and_convert_exceptions,
11
+ )
12
+
13
+
14
+ @catch_and_convert_exceptions
15
+ class PPBCPowerSequenceContainerStatus(
16
+ GenPPBCPowerSequenceContainerStatus, S2MessageComponent["PPBCPowerSequenceContainerStatus"]
17
+ ):
18
+ model_config = GenPPBCPowerSequenceContainerStatus.model_config
19
+ model_config["validate_assignment"] = True
20
+
21
+ power_profile_id: uuid.UUID = GenPPBCPowerSequenceContainerStatus.model_fields[
22
+ "power_profile_id" # type: ignore[assignment]
23
+ ]
24
+ sequence_container_id: uuid.UUID = GenPPBCPowerSequenceContainerStatus.model_fields[
25
+ "sequence_container_id" # type: ignore[assignment]
26
+ ]
27
+ selected_sequence_id: Union[uuid.UUID, None] = (
28
+ GenPPBCPowerSequenceContainerStatus.model_fields["selected_sequence_id"] # type: ignore[assignment]
29
+ )
30
+ progress: Union[uuid.UUID, None] = GenPPBCPowerSequenceContainerStatus.model_fields[
31
+ "progress" # type: ignore[assignment]
32
+ ]
@@ -0,0 +1,25 @@
1
+ from typing import List
2
+
3
+ from s2python.generated.gen_s2 import (
4
+ PPBCPowerSequenceElement as GenPPBCPowerSequenceElement,
5
+ )
6
+
7
+ from s2python.validate_values_mixin import (
8
+ S2MessageComponent,
9
+ catch_and_convert_exceptions,
10
+ )
11
+
12
+ from s2python.common import Duration, PowerForecastValue
13
+
14
+
15
+ @catch_and_convert_exceptions
16
+ class PPBCPowerSequenceElement(
17
+ GenPPBCPowerSequenceElement, S2MessageComponent["PPBCPowerSequenceElement"]
18
+ ):
19
+ model_config = GenPPBCPowerSequenceElement.model_config
20
+ model_config["validate_assignment"] = True
21
+
22
+ duration: Duration = GenPPBCPowerSequenceElement.model_fields["duration"] # type: ignore[assignment]
23
+ power_values: List[PowerForecastValue] = GenPPBCPowerSequenceElement.model_fields[
24
+ "power_values"
25
+ ] # type: ignore[assignment]
@@ -0,0 +1,33 @@
1
+ import uuid
2
+
3
+ from s2python.generated.gen_s2 import (
4
+ PPBCScheduleInstruction as GenPPBCScheduleInstruction,
5
+ )
6
+ from s2python.validate_values_mixin import (
7
+ catch_and_convert_exceptions,
8
+ S2MessageComponent,
9
+ )
10
+
11
+
12
+ @catch_and_convert_exceptions
13
+ class PPBCScheduleInstruction(
14
+ GenPPBCScheduleInstruction, S2MessageComponent["PPBCScheduleInstruction"]
15
+ ):
16
+ model_config = GenPPBCScheduleInstruction.model_config
17
+ model_config["validate_assignment"] = True
18
+
19
+ id: uuid.UUID = GenPPBCScheduleInstruction.model_fields["id"] # type: ignore[assignment]
20
+
21
+ power_profile_id: uuid.UUID = GenPPBCScheduleInstruction.model_fields[
22
+ "power_profile_id"
23
+ ] # type: ignore[assignment]
24
+
25
+ message_id: uuid.UUID = GenPPBCScheduleInstruction.model_fields["message_id"] # type: ignore[assignment]
26
+
27
+ sequence_container_id: uuid.UUID = GenPPBCScheduleInstruction.model_fields[
28
+ "sequence_container_id"
29
+ ] # type: ignore[assignment]
30
+
31
+ power_sequence_id: uuid.UUID = GenPPBCScheduleInstruction.model_fields[
32
+ "power_sequence_id"
33
+ ] # type: ignore[assignment]
@@ -0,0 +1,32 @@
1
+ import uuid
2
+
3
+ from s2python.generated.gen_s2 import (
4
+ PPBCStartInterruptionInstruction as GenPPBCStartInterruptionInstruction,
5
+ )
6
+
7
+ from s2python.validate_values_mixin import (
8
+ S2MessageComponent,
9
+ catch_and_convert_exceptions,
10
+ )
11
+
12
+
13
+ @catch_and_convert_exceptions
14
+ class PPBCStartInterruptionInstruction(
15
+ GenPPBCStartInterruptionInstruction, S2MessageComponent["PPBCStartInterruptionInstruction"]
16
+ ):
17
+ model_config = GenPPBCStartInterruptionInstruction.model_config
18
+ model_config["validate_assignment"] = True
19
+
20
+ id: uuid.UUID = GenPPBCStartInterruptionInstruction.model_fields["id"] # type: ignore[assignment]
21
+ power_profile_id: uuid.UUID = GenPPBCStartInterruptionInstruction.model_fields[
22
+ "power_profile_id"
23
+ ] # type: ignore[assignment]
24
+ sequence_container_id: uuid.UUID = GenPPBCStartInterruptionInstruction.model_fields[
25
+ "sequence_container_id"
26
+ ] # type: ignore[assignment]
27
+ power_sequence_id: uuid.UUID = GenPPBCStartInterruptionInstruction.model_fields[
28
+ "power_sequence_id"
29
+ ] # type: ignore[assignment]
30
+ abnormal_condition: bool = GenPPBCStartInterruptionInstruction.model_fields[
31
+ "abnormal_condition"
32
+ ] # type: ignore[assignment]
@@ -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
@@ -3,7 +3,8 @@ import typing
3
3
 
4
4
  from s2python.common import ControlType as ProtocolControlType
5
5
  from s2python.frbc import FRBCInstruction
6
- from s2python.validate_values_mixin import S2Message
6
+ from s2python.ppbc import PPBCScheduleInstruction
7
+ from s2python.message import S2Message
7
8
 
8
9
  if typing.TYPE_CHECKING:
9
10
  from s2python.s2_connection import S2Connection, MessageHandlers
@@ -36,10 +37,33 @@ class FRBCControlType(S2ControlType):
36
37
  ) -> None: ...
37
38
 
38
39
  @abc.abstractmethod
39
- def activate(self, conn: "S2Connection") -> None: ...
40
+ def activate(self, conn: "S2Connection") -> None:
41
+ """Overwrite with the actual dctivation logic of your Resource Manager for this particular control type."""
40
42
 
41
43
  @abc.abstractmethod
42
- def deactivate(self, conn: "S2Connection") -> None: ...
44
+ def deactivate(self, conn: "S2Connection") -> None:
45
+ """Overwrite with the actual deactivation logic of your Resource Manager for this particular control type."""
46
+
47
+
48
+ class PPBCControlType(S2ControlType):
49
+ def get_protocol_control_type(self) -> ProtocolControlType:
50
+ return ProtocolControlType.POWER_PROFILE_BASED_CONTROL
51
+
52
+ def register_handlers(self, handlers: "MessageHandlers") -> None:
53
+ handlers.register_handler(PPBCScheduleInstruction, self.handle_instruction)
54
+
55
+ @abc.abstractmethod
56
+ def handle_instruction(
57
+ self, conn: "S2Connection", msg: S2Message, send_okay: typing.Callable[[], None]
58
+ ) -> None: ...
59
+
60
+ @abc.abstractmethod
61
+ def activate(self, conn: "S2Connection") -> None:
62
+ """Overwrite with the actual dctivation logic of your Resource Manager for this particular control type."""
63
+
64
+ @abc.abstractmethod
65
+ def deactivate(self, conn: "S2Connection") -> None:
66
+ """Overwrite with the actual deactivation logic of your Resource Manager for this particular control type."""
43
67
 
44
68
 
45
69
  class NoControlControlType(S2ControlType):
@@ -24,14 +24,17 @@ from s2python.frbc import (
24
24
  FRBCTimerStatus,
25
25
  FRBCUsageForecast,
26
26
  )
27
- from s2python.validate_values_mixin import S2Message
27
+ from s2python.ppbc import PPBCScheduleInstruction
28
+
29
+ from s2python.message import S2Message
30
+ from s2python.validate_values_mixin import S2MessageComponent
28
31
  from s2python.s2_validation_error import S2ValidationError
29
32
 
30
33
 
31
34
  LOGGER = logging.getLogger(__name__)
32
35
  S2MessageType = str
33
36
 
34
- M = TypeVar("M", bound=S2Message)
37
+ M = TypeVar("M", bound=S2MessageComponent)
35
38
 
36
39
 
37
40
  # May be generated with development_utilities/generate_s2_message_type_to_class.py
@@ -44,6 +47,7 @@ TYPE_TO_MESSAGE_CLASS: Dict[str, Type[S2Message]] = {
44
47
  "FRBC.SystemDescription": FRBCSystemDescription,
45
48
  "FRBC.TimerStatus": FRBCTimerStatus,
46
49
  "FRBC.UsageForecast": FRBCUsageForecast,
50
+ "PPBC.ScheduleInstruction": PPBCScheduleInstruction,
47
51
  "Handshake": Handshake,
48
52
  "HandshakeResponse": HandshakeResponse,
49
53
  "InstructionStatusUpdate": InstructionStatusUpdate,
@@ -86,7 +90,9 @@ class S2Parser:
86
90
  return TYPE_TO_MESSAGE_CLASS[message_type].model_validate(message_json)
87
91
 
88
92
  @staticmethod
89
- def parse_as_message(unparsed_message: Union[dict, str, bytes], as_message: Type[M]) -> M:
93
+ def parse_as_message(
94
+ unparsed_message: Union[dict, str, bytes], as_message: Type[M]
95
+ ) -> M:
90
96
  """Parse the message to a specific S2 python message.
91
97
 
92
98
  :param unparsed_message: The message as a JSON-formatted string or as a JSON-parsed dictionary.
@@ -98,7 +104,9 @@ class S2Parser:
98
104
  return as_message.from_dict(message_json)
99
105
 
100
106
  @staticmethod
101
- def parse_message_type(unparsed_message: Union[dict, str, bytes]) -> Optional[S2MessageType]:
107
+ def parse_message_type(
108
+ unparsed_message: Union[dict, str, bytes],
109
+ ) -> Optional[S2MessageType]:
102
110
  """Parse only the message type from the unparsed message.
103
111
 
104
112
  This is useful to call before `parse_as_message` to retrieve the message type and allows for strictly-typed
@@ -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]
File without changes
File without changes
File without changes