Skip to content

Commit

Permalink
v1.6 Action Enum members corrected (#600)
Browse files Browse the repository at this point in the history
See issue #599
  • Loading branch information
Jared-Newell-Mobility authored Feb 14, 2024
1 parent 9fb5769 commit b380900
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 3 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
52 changes: 52 additions & 0 deletions ocpp/v16/enums.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from warnings import warn

try:
# breaking change introduced in python 3.11
from enum import StrEnum
Expand All @@ -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"
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit b380900

Please sign in to comment.