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

v2.0.1 Action enums corrected #580

Merged
merged 18 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@
- [#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

## DEPRECATED ##
- [#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 ##
Copy link
Collaborator

Choose a reason for hiding this comment

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

These changes are not yet breaking, I suggest to change the title to "Deprecated".

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Satisfied with commit acba23f

- [#574](https://github.com/mobilityhouse/ocpp/issues/574) Remove v1.6 deprecated enum members - IMPORTANT see upgrade path [#574](https://github.com/mobilityhouse/ocpp/issues/574)
- [#498](https://github.com/mobilityhouse/ocpp/issues/498) Remove support for OCPP 2.0 - IMPORTANT SEE UPGRADE PATH [#498](https://github.com/mobilityhouse/ocpp/issues/498)


## 0.26.0 (2024-01-17)

- [#544](https://github.com/mobilityhouse/ocpp/issues/544) ocpp/charge_point.py - Pass `Call.unique_id` to the `on` and `after` routing handlers.
Expand Down
77 changes: 75 additions & 2 deletions ocpp/v201/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,
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you apply the comment I made here to this PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Satisfied with commit 50e4a95


# --------- Soon to be deprecated ---------------------
Authorize = "Authorize"
BootNotification = "BootNotification"
CancelReservation = "CancelReservation"
Expand Down Expand Up @@ -75,9 +85,72 @@ class Action(StrEnum):
UnlockConnector = "UnlockConnector"
UnpublishFirmware = "UnpublishFirmware"
UpdateFirmware = "UpdateFirmware"
# --------------------------------------------------------


# Enums
authorize = "Authorize"
boot_notification = "BootNotification"
cancel_reservation = "CancelReservation"
certificate_signed = "CertificateSigned"
change_availability = "ChangeAvailability"
clear_cache = "ClearCache"
clear_charging_profile = "ClearChargingProfile"
clear_display_message = "ClearDisplayMessage"
cleared_charging_limit = "ClearedChargingLimit"
clear_variable_monitoring = "ClearVariableMonitoring"
cost_update = "CostUpdate"
customer_information = "CustomerInformation"
data_transfer = "DataTransfer"
delete_certificate = "DeleteCertificate"
firmware_status_notification = "FirmwareStatusNotification"
get_15118_ev_certificate = "Get15118EVCertificate"
get_base_report = "GetBaseReport"
get_certificate_status = "GetCertificateStatus"
get_charging_profiles = "GetChargingProfiles"
get_composite_schedule = "GetCompositeSchedule"
get_display_messages = "GetDisplayMessages"
get_installed_certificate_ids = "GetInstalledCertificateIds"
get_local_list_version = "GetLocalListVersion"
get_log = "GetLog"
get_monitoring_report = "GetMonitoringReport"
get_report = "GetReport"
get_transaction_status = "GetTransactionStatus"
get_variables = "GetVariables"
heartbeat = "Heartbeat"
install_certificate = "InstallCertificate"
log_status_notification = "LogStatusNotification"
meter_values = "MeterValues"
notify_charging_limit = "NotifyChargingLimit"
notify_customer_information = "NotifyCustomerInformation"
notify_display_messages = "NotifyDisplayMessages"
notify_ev_charging_needs = "NotifyEVChargingNeeds"
notify_ev_charging_schedule = "NotifyEVChargingSchedule"
notify_event = "NotifyEvent"
notify_monitoring_report = "NotifyMonitoringReport"
notify_report = "NotifyReport"
publish_firmware = "PublishFirmware"
publish_firmware_status_notification = "PublishFirmwareStatusNotification"
report_charging_profiles = "ReportChargingProfiles"
request_start_transaction = "RequestStartTransaction"
request_stop_transaction = "RequestStopTransaction"
reservation_status_update = "ReservationStatusUpdate"
reserve_now = "ReserveNow"
reset = "Reset"
security_event_notification = "SecurityEventNotification"
send_local_list = "SendLocalList"
set_charging_profile = "SetChargingProfile"
set_display_message = "SetDisplayMessage"
set_monitoring_base = "SetMonitoringBase"
set_monitoring_level = "SetMonitoringLevel"
set_network_profile = "SetNetworkProfile"
set_variable_monitoring = "SetVariableMonitoring"
set_variables = "SetVariables"
sign_certificate = "SignCertificate"
status_notification = "StatusNotification"
transaction_event = "TransactionEvent"
trigger_message = "TriggerMessage"
unlock_connector = "UnlockConnector"
unpublish_firmware = "UnpublishFirmware"
update_firmware = "UpdateFirmware"


class APNAuthenticationType(StrEnum):
Expand Down
Loading