From 2c823cfc67bf6aed9e0de8dd1b114d602167b31c Mon Sep 17 00:00:00 2001 From: Jared Newell Date: Tue, 6 Feb 2024 10:02:39 +0100 Subject: [PATCH] updated memebers + change log --- CHANGELOG.md | 2 ++ ocpp/v16/enums.py | 50 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 149f2876b..d4ed193a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,6 @@ # Change log + +- [#599](https://github.com/mobilityhouse/ocpp/issues/599) v1.6 Action Enum members corrected - [#564](https://github.com/mobilityhouse/ocpp/issues/564) Add support For Python 3.11 and 3.12 - [#583](https://github.com/mobilityhouse/ocpp/issues/583) OCPP v1.6/v2.0.1 deprecate dataclasses from calls and call results with the suffix 'Payload' diff --git a/ocpp/v16/enums.py b/ocpp/v16/enums.py index 1d84ba10b..21a44c5ed 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,12 @@ 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( + "Action enum contains deprecated members and will be removed in the next major release, please use snake case members." + ) + + # --------- Soon to be deprecated --------------------- Authorize = "Authorize" BootNotification = "BootNotification" CancelReservation = "CancelReservation" @@ -51,6 +59,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): """