Skip to content

Conversation

Jared-Newell-Mobility
Copy link
Contributor

@Jared-Newell-Mobility Jared-Newell-Mobility commented Jan 25, 2024

Fixes #583

Copy link
Contributor

@OrangeTux OrangeTux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to warn users using a DeprecationWarning. For example by doing something like this:

import warnings
from dataclasses import dataclass

@dataclass
class CancelReservation:
    reservation_id: int


@dataclass
class CancelReservationPayload(CancelReservation):
    def __post_init__(self):
        warnings.warn("CancelReservationPayload is deprecated, use CancelReservation instead.")

CancelReservation(reservation_id=3)
CancelReservationPayload(reservation_id=3)

Creating a CancelReservation() doesn't have any different effect. Whereas creating a CancelReservationPayload() prints a warning to stdout:

/tmp/deprecation.py:12: UserWarning: CancelReservationPayload is deprecated, use CancelReservation instead

Initializing a CancelReservation() doesn't have any affect. Creating a `CancelReservationPayload()

@Jared-Newell-Mobility Jared-Newell-Mobility merged commit 3052b5c into master Feb 2, 2024
@Jared-Newell-Mobility Jared-Newell-Mobility deleted the v1.6/2.0.1-Remove-suffix-Payload-from-all-calls-and-call-results branch February 2, 2024 14:17
Jared-Newell-Mobility added a commit that referenced this pull request Apr 25, 2024
- OCPP v1.6/v2.0.1 deprecate dataclasses from calls and call results with the suffix 'Payload' by @Jared-Newell-Mobility in #584
- In GA, validate project against Python 3.11 and 3.12. by @Jared-Newell-Mobility in #589
- drop support for python 3.7 by @Jared-Newell-Mobility in #585
- Update Code Owners by @Jared-Newell-Mobility in #588
- Revert "drop support for python 3.7" by @Jared-Newell-Mobility in #597
- OCPP 2.0.1 Wrong data type in CostUpdated total_cost by @Jared-Newell-Mobility in #596
- Update tests to use Call and CallResult without the suffix Payload by @Jared-Newell-Mobility in #595
- Fix camel_to_snake_case for "v2x" by @Jared-Newell-Mobility in #594
- Correct naming of members of v201.enums.AttributeType by @Jared-Newell-Mobility in #578
- Drop support for python 3.7 by @Jared-Newell-Mobility in #598
- Remove v1.6 deprecated enum variants by @Jared-Newell-Mobility in #575
- Typo in CostUpdated Action #435 by @Jared-Newell-Mobility in #491-
- Remove support for ocpp 2.0 by @Jared-Newell-Mobility in #576
- v201.datatypes.ChargingNeedsType.request_energy_transfer is mistyped by @Jared-Newell-Mobility in #496
- v201.enums.StatusInfoReasonType.invaild_schedule by @Jared-Newell-Mobility in #521
- update to match Appendix 2. Standardized Units Of Measure by @Jared-Newell-Mobility in #512
- v16/schemas/StopTransaction.json missing "Hertz" #207 by @Jared-Newell-Mobility in #497
- Correct v2g serialisation/deserialisation by @Jared-Newell-Mobility in #606
- 2.0.1 dataclasses have a incorrect types that don't match carnality by @Jared-Newell-Mobility in #529
- Readthedocs_configuration_is_outdated by @Jared-Newell-Mobility in #608
- Readthedocs_configuration_is_outdated_config_update by @Jared-Newell-Mobility in #609
- The serialisation of soc to SoC should not occur in camel case if it is existing at the beginning of a field by @Jared-Newell-Mobility in #527
- Fix case conversion for soc in non "State of Charge" context by @Jared-Newell-Mobility in #607
- Handle recursively serializing a dataclasses as a dictionary. by @Jared-Newell-Mobility in #547
- v2.0.1 Action enums corrected by @Jared-Newell-Mobility in #580
- URL does not get converted from snake_case responder_url to camelCase responderURL by @Jared-Newell-Mobility in #592
- v1.6 Action Enum members corrected by @Jared-Newell-Mobility in #600
- Introduce Experimental Module For v2.1 by @Jared-Newell-Mobility in #605
- Bump to 1.0.0-rc.1 by @Jared-Newell-Mobility in #611
- fix typo in DataTypeEnum -> value_too_high by @d2avids in #612
- fix typo CostUpdated enum for 201 by @OSkrk in #620
ajmirsky pushed a commit to ajmirsky/ocpp that referenced this pull request Nov 26, 2024
ajmirsky pushed a commit to ajmirsky/ocpp that referenced this pull request Nov 26, 2024
- OCPP v1.6/v2.0.1 deprecate dataclasses from calls and call results with the suffix 'Payload' by @Jared-Newell-Mobility in mobilityhouse#584
- In GA, validate project against Python 3.11 and 3.12. by @Jared-Newell-Mobility in mobilityhouse#589
- drop support for python 3.7 by @Jared-Newell-Mobility in mobilityhouse#585
- Update Code Owners by @Jared-Newell-Mobility in mobilityhouse#588
- Revert "drop support for python 3.7" by @Jared-Newell-Mobility in mobilityhouse#597
- OCPP 2.0.1 Wrong data type in CostUpdated total_cost by @Jared-Newell-Mobility in mobilityhouse#596
- Update tests to use Call and CallResult without the suffix Payload by @Jared-Newell-Mobility in mobilityhouse#595
- Fix camel_to_snake_case for "v2x" by @Jared-Newell-Mobility in mobilityhouse#594
- Correct naming of members of v201.enums.AttributeType by @Jared-Newell-Mobility in mobilityhouse#578
- Drop support for python 3.7 by @Jared-Newell-Mobility in mobilityhouse#598
- Remove v1.6 deprecated enum variants by @Jared-Newell-Mobility in mobilityhouse#575
- Typo in CostUpdated Action mobilityhouse#435 by @Jared-Newell-Mobility in mobilityhouse#491-
- Remove support for ocpp 2.0 by @Jared-Newell-Mobility in mobilityhouse#576
- v201.datatypes.ChargingNeedsType.request_energy_transfer is mistyped by @Jared-Newell-Mobility in mobilityhouse#496
- v201.enums.StatusInfoReasonType.invaild_schedule by @Jared-Newell-Mobility in mobilityhouse#521
- update to match Appendix 2. Standardized Units Of Measure by @Jared-Newell-Mobility in mobilityhouse#512
- v16/schemas/StopTransaction.json missing "Hertz" mobilityhouse#207 by @Jared-Newell-Mobility in mobilityhouse#497
- Correct v2g serialisation/deserialisation by @Jared-Newell-Mobility in mobilityhouse#606
- 2.0.1 dataclasses have a incorrect types that don't match carnality by @Jared-Newell-Mobility in mobilityhouse#529
- Readthedocs_configuration_is_outdated by @Jared-Newell-Mobility in mobilityhouse#608
- Readthedocs_configuration_is_outdated_config_update by @Jared-Newell-Mobility in mobilityhouse#609
- The serialisation of soc to SoC should not occur in camel case if it is existing at the beginning of a field by @Jared-Newell-Mobility in mobilityhouse#527
- Fix case conversion for soc in non "State of Charge" context by @Jared-Newell-Mobility in mobilityhouse#607
- Handle recursively serializing a dataclasses as a dictionary. by @Jared-Newell-Mobility in mobilityhouse#547
- v2.0.1 Action enums corrected by @Jared-Newell-Mobility in mobilityhouse#580
- URL does not get converted from snake_case responder_url to camelCase responderURL by @Jared-Newell-Mobility in mobilityhouse#592
- v1.6 Action Enum members corrected by @Jared-Newell-Mobility in mobilityhouse#600
- Introduce Experimental Module For v2.1 by @Jared-Newell-Mobility in mobilityhouse#605
- Bump to 1.0.0-rc.1 by @Jared-Newell-Mobility in mobilityhouse#611
- fix typo in DataTypeEnum -> value_too_high by @d2avids in mobilityhouse#612
- fix typo CostUpdated enum for 201 by @OSkrk in mobilityhouse#620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Remove suffex 'Payload' from all calls and call results
2 participants