-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add S2 Message Union type #37
Conversation
Signed-off-by: Victor Garcia Reolid <[email protected]>
@victorgarcia98 Apologies for a late response. I do not work at TNO anymore and it took some time to get settled in my new situation again. Reviewing now! |
# Conflicts: # src/s2python/generated/gen_s2.py
…ut-file-type openapi --output src/s2python/generated/gen_s2.py` Signed-off-by: F.N. Claessen <[email protected]>
…s2-message/literals # Conflicts: # src/s2python/common/handshake.py # src/s2python/common/handshake_response.py # src/s2python/common/instruction_status_update.py # src/s2python/common/number_range.py # src/s2python/common/power_forecast.py # src/s2python/common/power_forecast_element.py # src/s2python/common/power_forecast_value.py # src/s2python/common/power_measurement.py # src/s2python/common/power_range.py # src/s2python/common/power_value.py # src/s2python/common/reception_status.py # src/s2python/common/resource_manager_details.py # src/s2python/common/revoke_object.py # src/s2python/common/role.py # src/s2python/common/select_control_type.py # src/s2python/common/session_request.py # src/s2python/common/timer.py # src/s2python/common/transition.py # src/s2python/frbc/frbc_actuator_description.py # src/s2python/frbc/frbc_actuator_status.py # src/s2python/frbc/frbc_fill_level_target_profile.py # src/s2python/frbc/frbc_fill_level_target_profile_element.py # src/s2python/frbc/frbc_instruction.py # src/s2python/frbc/frbc_leakage_behaviour.py # src/s2python/frbc/frbc_leakage_behaviour_element.py # src/s2python/frbc/frbc_operation_mode.py # src/s2python/frbc/frbc_operation_mode_element.py # src/s2python/frbc/frbc_storage_description.py # src/s2python/frbc/frbc_storage_status.py # src/s2python/frbc/frbc_system_description.py # src/s2python/frbc/frbc_timer_status.py # src/s2python/frbc/frbc_usage_forecast.py # src/s2python/frbc/frbc_usage_forecast_element.py # src/s2python/generated/gen_s2.py
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
This reverts commit fd59de6.
As suggested, I removed all changes relating to the Literal issue. This PR now only contains the addition of the (On a side note, Home Assistant has now released a version compatible with Pydantic v2. 😅 ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the addition! I added a couple of comments as examples but I believe we should be able to limit a number of types from S2MessageComponent
to S2Message
as only messages are expected there.
Signed-off-by: F.N. Claessen <[email protected]>
…ble type "str": "type[PPBCScheduleInstruction]"; expected "str": "Union[type[FRBCActuatorStatus], type[FRBCFillLevelTargetProfile], type[FRBCInstruction], type[FRBCLeakageBehaviour], type[FRBCStorageStatus], <13 more items>]" [dict-item]` Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
…lated to flexiblepower/s2-ws-json#21) Signed-off-by: F.N. Claessen <[email protected]>
… bug? Related to flexiblepower/s2-ws-json#21)" This reverts commit dc3d706.
… under flexiblepower/s2-ws-json#21 instead Signed-off-by: F.N. Claessen <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved by Víctor and I.
Recently, I had the need to wrap the S2 messages in an envelope to simulate accelerated interactions between a CEM and a RM.
Nonetheless, for this to work, the
message_type
had to be aLiteral
. This PR refactors the code to use Literals instead of regular fields.Example usage: