Skip to content
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

ReceptionStatus.subject_message_id in case of INVALID_DATA #21

Open
lfse-slafleur opened this issue Sep 9, 2024 · 1 comment
Open

Comments

@lfse-slafleur
Copy link
Member

It is possible that a message cannot be read due to various reasons. The S2 standard defines that a ReceptionStatus should be send where the status is set to INVALID_DATA: https://github.com/flexiblepower/s2-ws-json/wiki/Common_messages#receptionstatusvalues
In that case, a message_id is impossible to retrieve.

However, in ReceptionStatus the subject_message_id field is required (https://github.com/flexiblepower/s2-ws-json/wiki/Common_messages#receptionstatus). What should we define as the subject_message_id if the message_id is not retrievable and the ReceptionStatus.status is INVALID_DATA?

@lfse-slafleur
Copy link
Member Author

For now we are using '00000000-0000-0000-0000-000000000000' in s2-python

Flix6x added a commit to flexiblepower/s2-python that referenced this issue Jan 23, 2025
Flix6x added a commit to flexiblepower/s2-python that referenced this issue Jan 23, 2025
Flix6x added a commit to flexiblepower/s2-python that referenced this issue Jan 23, 2025
Flix6x added a commit to flexiblepower/s2-python that referenced this issue Jan 23, 2025
* add S2 Message Union type

Signed-off-by: Victor Garcia Reolid <[email protected]>

* chore: move to Literals as Pydantic 2 does

* chore: run `datamodel-codegen --input specification/openapi.yml --input-file-type openapi --output src/s2python/generated/gen_s2.py`

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: rename old S2Message to S2MessageComponent

Signed-off-by: F.N. Claessen <[email protected]>

* style: pylint

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: prefer S2Message over S2MessageComponent

Signed-off-by: F.N. Claessen <[email protected]>

* Revert "refactor: prefer S2Message over S2MessageComponent"

This reverts commit fd59de6.

* refactor: prefer S2Message over S2MessageComponent in s2_parser.py

Signed-off-by: F.N. Claessen <[email protected]>

* fix: `src/s2python/s2_parser.py:49: error: Dict entry 8 has incompatible 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]>

* refactor: prefer S2Message over S2MessageComponent in s2_control_type.py

Signed-off-by: F.N. Claessen <[email protected]>

* refactor: prefer S2Message over S2MessageComponent in s2_connection.py

Signed-off-by: F.N. Claessen <[email protected]>

* fix: s2_parser.py has 1 place that still requires the S2MessageComponent

Signed-off-by: F.N. Claessen <[email protected]>

* dev: change subject_message_id to message_id (did mypy find a bug? Related to flexiblepower/s2-ws-json#21)

Signed-off-by: F.N. Claessen <[email protected]>

* Revert "dev: change subject_message_id to message_id (did mypy find a bug? Related to flexiblepower/s2-ws-json#21)"

This reverts commit dc3d706.

* fix: type ignore union-attr instead; underlying issue should be fixed under flexiblepower/s2-ws-json#21 instead

Signed-off-by: F.N. Claessen <[email protected]>

* fix: linting

Signed-off-by: F.N. Claessen <[email protected]>

---------

Signed-off-by: Victor Garcia Reolid <[email protected]>
Signed-off-by: F.N. Claessen <[email protected]>
Co-authored-by: F.N. Claessen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant