diff --git a/CHANGELOG.md b/CHANGELOG.md index 9cbda533c..204421a2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - [#508](https://github.com/mobilityhouse/ocpp/issues/508) Exception - OccurrenceConstraintViolationError doc string correction ## DEPRECATED ## +- [#599](https://github.com/mobilityhouse/ocpp/issues/599) v1.6 Action Enum members corrected IMPORTANT SEE UPGRADE PATH [#599](https://github.com/mobilityhouse/ocpp/issues/599) - [#579](https://github.com/mobilityhouse/ocpp/issues/579) v2.0.1 Action enums corrected - IMPORTANT SEE UPGRADE PATH [#579](https://github.com/mobilityhouse/ocpp/issues/579) ## BREAKING ## @@ -55,7 +56,6 @@ - [#528](https://github.com/mobilityhouse/ocpp/issues/528) v2.0.1 CertificateHashDataChainType childCertificateHashData requires the default of None. - [#510](https://github.com/mobilityhouse/ocpp/issues/510) v2.0.1 UnitOfMeasureType - Enums missing and update docstring to allow use for variableCharacteristics. - [#508](https://github.com/mobilityhouse/ocpp/issues/508) Exception - OccurrenceConstraintViolationError doc string correction. - - [#511](https://github.com/mobilityhouse/ocpp/issues/511) 2.0.1 Units of Measure update to match Appendix 2. Standardized Units Of Measure ## 0.22.0 (2023-11-03) @@ -64,9 +64,7 @@ - [#278](https://github.com/mobilityhouse/ocpp/pull/278) Fix types for attributes of OCPP 1.6's type `IdTagInfo`. Thanks [@chan-vince](https://github.com/chan-vince) - [#504](https://github.com/mobilityhouse/ocpp/pull/504) Add missing tech_info attribute to v2.0.1 EventDataType. Thanks [@LokiHokie](https://github.com/LokiHokie) - [#381](https://github.com/mobilityhouse/ocpp/issues/381) Add FormationError and OccurrenceConstraintViolationError. - - [#373](https://github.com/mobilityhouse/ocpp/issues/373) v201.datatypes.ChargingNeedsType.request_energy_transfer is mistyped - - [#207](https://github.com/mobilityhouse/ocpp/issues/207) v16/schemas/StopTransaction.json missing "Hertz" ## 0.21.0 (2023-10-19) diff --git a/ocpp/v16/enums.py b/ocpp/v16/enums.py index 5cff0415d..e80175d01 100644 --- a/ocpp/v16/enums.py +++ b/ocpp/v16/enums.py @@ -1,3 +1,5 @@ +from warnings import warn + try: # breaking change introduced in python 3.11 from enum import StrEnum @@ -11,6 +13,14 @@ class StrEnum(str, Enum): # pragma: no cover class Action(StrEnum): """An Action is a required part of a Call message.""" + def __init__(self, *args, **kwargs): + warn( + message="Action enum contains deprecated members and will be removed in " + "the next major release, please use snake case members.", + category=DeprecationWarning, + ) + + # --------- Soon to be deprecated --------------------- Authorize = "Authorize" BootNotification = "BootNotification" CancelReservation = "CancelReservation" @@ -51,6 +61,48 @@ class Action(StrEnum): UnlockConnector = "UnlockConnector" UpdateFirmware = "UpdateFirmware" + # -------------------------------------------------------- + + authorize = "Authorize" + boot_notification = "BootNotification" + cancel_reservation = "CancelReservation" + certificate_signed = "CertificateSigned" + change_availability = "ChangeAvailability" + change_configuration = "ChangeConfiguration" + clear_cache = "ClearCache" + clear_charging_profile = "ClearChargingProfile" + data_transfer = "DataTransfer" + delete_certificate = "DeleteCertificate" + diagnostics_status_notification = "DiagnosticsStatusNotification" + extended_trigger_message = "ExtendedTriggerMessage" + firmware_status_notification = "FirmwareStatusNotification" + get_composite_schedule = "GetCompositeSchedule" + get_configuration = "GetConfiguration" + get_diagnostics = "GetDiagnostics" + get_installed_certificate_ids = "GetInstalledCertificateIds" + get_local_list_version = "GetLocalListVersion" + get_log = "GetLog" + heartbeat = "Heartbeat" + install_certificate = "InstallCertificate" + log_status_notification = "LogStatusNotification" + meter_values = "MeterValues" + remote_start_transaction = "RemoteStartTransaction" + remote_stop_transaction = "RemoteStopTransaction" + reserve_now = "ReserveNow" + reset = "Reset" + security_event_notification = "SecurityEventNotification" + send_local_list = "SendLocalList" + set_charging_profile = "SetChargingProfile" + sign_certificate = "SignCertificate" + signed_firmware_status_notification = "SignedFirmwareStatusNotification" + signed_update_firmware = "SignedUpdateFirmware" + start_transaction = "StartTransaction" + status_notification = "StatusNotification" + stop_transaction = "StopTransaction" + trigger_message = "TriggerMessage" + unlock_connector = "UnlockConnector" + update_firmware = "UpdateFirmware" + class AuthorizationStatus(StrEnum): """