From 3052b5cc3849c8e233e6a950054200232d02a70d Mon Sep 17 00:00:00 2001 From: Jared-Newell-Mobility <119603687+Jared-Newell-Mobility@users.noreply.github.com> Date: Fri, 2 Feb 2024 15:17:18 +0100 Subject: [PATCH 01/10] OCPP v1.6/v2.0.1 deprecate dataclasses from calls and call results with the suffix 'Payload' (#584) Fixes #583 --- CHANGELOG.md | 2 + ocpp/v16/call.py | 596 ++++++++++++++++++++++-- ocpp/v16/call_result.py | 594 ++++++++++++++++++++++-- ocpp/v201/call.py | 961 ++++++++++++++++++++++++++++++++++++--- ocpp/v201/call_result.py | 961 ++++++++++++++++++++++++++++++++++++--- 5 files changed, 2907 insertions(+), 207 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06e14504c..e05bb06d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Change log +- [#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' + ## 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. diff --git a/ocpp/v16/call.py b/ocpp/v16/call.py index fe07e7d6d..46e167b1a 100644 --- a/ocpp/v16/call.py +++ b/ocpp/v16/call.py @@ -1,3 +1,4 @@ +import warnings from dataclasses import dataclass, field from typing import Dict, List, Optional @@ -37,34 +38,34 @@ @dataclass -class CancelReservationPayload: +class CancelReservation: reservation_id: int @dataclass -class CertificateSignedPayload: +class CertificateSigned: certificate_chain: str @dataclass -class ChangeAvailabilityPayload: +class ChangeAvailability: connector_id: int type: AvailabilityType @dataclass -class ChangeConfigurationPayload: +class ChangeConfiguration: key: str value: str @dataclass -class ClearCachePayload: +class ClearCache: pass @dataclass -class ClearChargingProfilePayload: +class ClearChargingProfile: id: Optional[int] = None connector_id: Optional[int] = None charging_profile_purpose: Optional[ChargingProfilePurposeType] = None @@ -72,30 +73,30 @@ class ClearChargingProfilePayload: @dataclass -class DeleteCertificatePayload: +class DeleteCertificate: certificate_hash_data: Dict @dataclass -class ExtendedTriggerMessagePayload: +class ExtendedTriggerMessage: requested_message: MessageTrigger connector_id: Optional[int] = None @dataclass -class GetCompositeSchedulePayload: +class GetCompositeSchedule: connector_id: int duration: int charging_rate_unit: Optional[ChargingRateUnitType] = None @dataclass -class GetConfigurationPayload: +class GetConfiguration: key: Optional[List] = None @dataclass -class GetDiagnosticsPayload: +class GetDiagnostics: location: str retries: Optional[int] = None retry_interval: Optional[int] = None @@ -104,17 +105,17 @@ class GetDiagnosticsPayload: @dataclass -class GetInstalledCertificateIdsPayload: +class GetInstalledCertificateIds: certificate_type: CertificateUse @dataclass -class GetLocalListVersionPayload: +class GetLocalListVersion: pass @dataclass -class GetLogPayload: +class GetLog: log: Dict log_type: Log request_id: int @@ -123,25 +124,25 @@ class GetLogPayload: @dataclass -class InstallCertificatePayload: +class InstallCertificate: certificate_type: CertificateUse certificate: str @dataclass -class RemoteStartTransactionPayload: +class RemoteStartTransaction: id_tag: str connector_id: Optional[int] = None charging_profile: Optional[Dict] = None @dataclass -class RemoteStopTransactionPayload: +class RemoteStopTransaction: transaction_id: int @dataclass -class ReserveNowPayload: +class ReserveNow: connector_id: int expiry_date: str id_tag: str @@ -150,25 +151,25 @@ class ReserveNowPayload: @dataclass -class ResetPayload: +class Reset: type: ResetType @dataclass -class SendLocalListPayload: +class SendLocalList: list_version: int update_type: UpdateType local_authorization_list: List = field(default_factory=list) @dataclass -class SetChargingProfilePayload: +class SetChargingProfile: connector_id: int cs_charging_profiles: Dict @dataclass -class SignedUpdateFirmwarePayload: +class SignedUpdateFirmware: request_id: int firmware: Dict retries: Optional[int] = None @@ -176,18 +177,18 @@ class SignedUpdateFirmwarePayload: @dataclass -class TriggerMessagePayload: +class TriggerMessage: requested_message: MessageTrigger connector_id: Optional[int] = None @dataclass -class UnlockConnectorPayload: +class UnlockConnector: connector_id: int @dataclass -class UpdateFirmwarePayload: +class UpdateFirmware: location: str retrieve_date: str retries: Optional[int] = None @@ -199,12 +200,12 @@ class UpdateFirmwarePayload: @dataclass -class AuthorizePayload: +class Authorize: id_tag: str @dataclass -class BootNotificationPayload: +class BootNotification: charge_point_model: str charge_point_vendor: str charge_box_serial_number: Optional[str] = None @@ -217,53 +218,53 @@ class BootNotificationPayload: @dataclass -class DiagnosticsStatusNotificationPayload: +class DiagnosticsStatusNotification: status: DiagnosticsStatus @dataclass -class FirmwareStatusNotificationPayload: +class FirmwareStatusNotification: status: FirmwareStatus @dataclass -class HeartbeatPayload: +class Heartbeat: pass @dataclass -class LogStatusNotificationPayload: +class LogStatusNotification: status: UploadLogStatus request_id: int @dataclass -class MeterValuesPayload: +class MeterValues: connector_id: int meter_value: List = field(default_factory=list) transaction_id: Optional[int] = None @dataclass -class SecurityEventNotificationPayload: +class SecurityEventNotification: type: str timestamp: str tech_info: Optional[str] @dataclass -class SignCertificatePayload: +class SignCertificate: csr: str @dataclass -class SignedFirmwareStatusNotificationPayload: +class SignedFirmwareStatusNotification: status: FirmwareStatus request_id: int @dataclass -class StartTransactionPayload: +class StartTransaction: connector_id: int id_tag: str meter_start: int @@ -272,7 +273,7 @@ class StartTransactionPayload: @dataclass -class StopTransactionPayload: +class StopTransaction: meter_stop: int timestamp: str transaction_id: int @@ -282,7 +283,7 @@ class StopTransactionPayload: @dataclass -class StatusNotificationPayload: +class StatusNotification: connector_id: int error_code: ChargePointErrorCode status: ChargePointStatus @@ -292,12 +293,527 @@ class StatusNotificationPayload: vendor_error_code: Optional[str] = None -# The DataTransfer CALL can be send both from Central System as well as from a +# The DataTransfer CALL can be sent both from Central System as well as from a # Charge Point. @dataclass -class DataTransferPayload: +class DataTransfer: vendor_id: str message_id: Optional[str] = None data: Optional[str] = None + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CancelReservationPayload(CancelReservation): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CertificateSignedPayload(CertificateSigned): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ChangeAvailabilityPayload(ChangeAvailability): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ChangeConfigurationPayload(ChangeConfiguration): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearCachePayload(ClearCache): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearChargingProfilePayload(ClearChargingProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DeleteCertificatePayload(DeleteCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ExtendedTriggerMessagePayload(ExtendedTriggerMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetCompositeSchedulePayload(GetCompositeSchedule): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetConfigurationPayload(GetConfiguration): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetDiagnosticsPayload(GetDiagnostics): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetInstalledCertificateIdsPayload(GetInstalledCertificateIds): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetLocalListVersionPayload(GetLocalListVersion): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetLogPayload(GetLog): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class InstallCertificatePayload(InstallCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class RemoteStartTransactionPayload(RemoteStartTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class RemoteStopTransactionPayload(RemoteStopTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ReserveNowPayload(ReserveNow): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ResetPayload(Reset): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SendLocalListPayload(SendLocalList): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetChargingProfilePayload(SetChargingProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SignedUpdateFirmwarePayload(SignedUpdateFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class TriggerMessagePayload(TriggerMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UnlockConnectorPayload(UnlockConnector): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UpdateFirmwarePayload(UpdateFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# The CALL messages that flow from Charge Point to Central System are listed +# in the bottom part of this module. + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class AuthorizePayload(Authorize): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class BootNotificationPayload(BootNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DiagnosticsStatusNotificationPayload(DiagnosticsStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class FirmwareStatusNotificationPayload(FirmwareStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class HeartbeatPayload(Heartbeat): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class LogStatusNotificationPayload(LogStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class MeterValuesPayload(MeterValues): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SecurityEventNotificationPayload(SecurityEventNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SignCertificatePayload(SignCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SignedFirmwareStatusNotificationPayload(SignedFirmwareStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class StartTransactionPayload(StartTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class StopTransactionPayload(StopTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class StatusNotificationPayload(StatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# The DataTransfer CALL can be send both from Central System as well as from a +# Charge Point. + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DataTransferPayload(DataTransfer): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) diff --git a/ocpp/v16/call_result.py b/ocpp/v16/call_result.py index 4e105d33b..cb76ec16a 100644 --- a/ocpp/v16/call_result.py +++ b/ocpp/v16/call_result.py @@ -1,3 +1,4 @@ +import warnings from dataclasses import dataclass from typing import Dict, List, Optional @@ -46,65 +47,65 @@ @dataclass -class AuthorizePayload: +class Authorize: id_tag_info: IdTagInfo @dataclass -class BootNotificationPayload: +class BootNotification: current_time: str interval: int status: RegistrationStatus @dataclass -class DiagnosticsStatusNotificationPayload: +class DiagnosticsStatusNotification: pass @dataclass -class FirmwareStatusNotificationPayload: +class FirmwareStatusNotification: pass @dataclass -class HeartbeatPayload: +class Heartbeat: current_time: str @dataclass -class LogStatusNotificationPayload: +class LogStatusNotification: pass @dataclass -class SecurityEventNotificationPayload: +class SecurityEventNotification: pass @dataclass -class SignCertificatePayload: +class SignCertificate: status: GenericStatus @dataclass -class MeterValuesPayload: +class MeterValues: pass @dataclass -class StartTransactionPayload: +class StartTransaction: transaction_id: int id_tag_info: IdTagInfo @dataclass -class StatusNotificationPayload: +class StatusNotification: pass @dataclass -class StopTransactionPayload: +class StopTransaction: id_tag_info: Optional[IdTagInfo] = None @@ -113,53 +114,53 @@ class StopTransactionPayload: @dataclass -class CancelReservationPayload: +class CancelReservation: status: CancelReservationStatus @dataclass -class CertificateSignedPayload: +class CertificateSigned: status: CertificateSignedStatus @dataclass -class ChangeAvailabilityPayload: +class ChangeAvailability: status: AvailabilityStatus @dataclass -class ChangeConfigurationPayload: +class ChangeConfiguration: status: ConfigurationStatus @dataclass -class ClearCachePayload: +class ClearCache: status: ClearCacheStatus @dataclass -class ClearChargingProfilePayload: +class ClearChargingProfile: status: ClearChargingProfileStatus @dataclass -class DeleteCertificatePayload: +class DeleteCertificate: status: DeleteCertificateStatus @dataclass -class ExtendedTriggerMessagePayload: +class ExtendedTriggerMessage: status: TriggerMessageStatus @dataclass -class GetInstalledCertificateIdsPayload: +class GetInstalledCertificateIds: status: GetInstalledCertificateStatus certificate_hash_data: Optional[List] = None @dataclass -class GetCompositeSchedulePayload: +class GetCompositeSchedule: status: GetCompositeScheduleStatus connector_id: Optional[int] = None schedule_start: Optional[str] = None @@ -167,84 +168,84 @@ class GetCompositeSchedulePayload: @dataclass -class GetConfigurationPayload: +class GetConfiguration: configuration_key: Optional[List] = None unknown_key: Optional[List] = None @dataclass -class GetDiagnosticsPayload: +class GetDiagnostics: file_name: Optional[str] = None @dataclass -class GetLocalListVersionPayload: +class GetLocalListVersion: list_version: int @dataclass -class GetLogPayload: +class GetLog: status: LogStatus filename: Optional[str] = None @dataclass -class InstallCertificatePayload: +class InstallCertificate: status: CertificateStatus @dataclass -class RemoteStartTransactionPayload: +class RemoteStartTransaction: status: RemoteStartStopStatus @dataclass -class RemoteStopTransactionPayload: +class RemoteStopTransaction: status: RemoteStartStopStatus @dataclass -class ReserveNowPayload: +class ReserveNow: status: ReservationStatus @dataclass -class ResetPayload: +class Reset: status: ResetStatus @dataclass -class SendLocalListPayload: +class SendLocalList: status: UpdateStatus @dataclass -class SetChargingProfilePayload: +class SetChargingProfile: status: ChargingProfileStatus @dataclass -class SignedFirmwareStatusNotificationPayload: +class SignedFirmwareStatusNotification: pass @dataclass -class SignedUpdateFirmwarePayload: +class SignedUpdateFirmware: status: UpdateFirmwareStatus @dataclass -class TriggerMessagePayload: +class TriggerMessage: status: TriggerMessageStatus @dataclass -class UnlockConnectorPayload: +class UnlockConnector: status: UnlockStatus @dataclass -class UpdateFirmwarePayload: +class UpdateFirmware: pass @@ -253,6 +254,521 @@ class UpdateFirmwarePayload: @dataclass -class DataTransferPayload: +class DataTransfer: status: DataTransferStatus data: Optional[str] = None + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class AuthorizePayload(Authorize): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class BootNotificationPayload(BootNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DiagnosticsStatusNotificationPayload(DiagnosticsStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class FirmwareStatusNotificationPayload(FirmwareStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class HeartbeatPayload(Heartbeat): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class LogStatusNotificationPayload(LogStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SecurityEventNotificationPayload(SecurityEventNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SignCertificatePayload(SignCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class MeterValuesPayload(MeterValues): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class StartTransactionPayload(StartTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class StatusNotificationPayload(StatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class StopTransactionPayload(StopTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# The CALLRESULT messages that flow from Charge Point to Central System are +# listed in the bottom part of this module. + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CancelReservationPayload(CancelReservation): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CertificateSignedPayload(CertificateSigned): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ChangeAvailabilityPayload(ChangeAvailability): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ChangeConfigurationPayload(ChangeConfiguration): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearCachePayload(ClearCache): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearChargingProfilePayload(ClearChargingProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DeleteCertificatePayload(DeleteCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ExtendedTriggerMessagePayload(ExtendedTriggerMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetInstalledCertificateIdsPayload(GetInstalledCertificateIds): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetCompositeSchedulePayload(GetCompositeSchedule): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetConfigurationPayload(GetConfiguration): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetDiagnosticsPayload(GetDiagnostics): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetLocalListVersionPayload(GetLocalListVersion): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetLogPayload(GetLog): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class InstallCertificatePayload(InstallCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class RemoteStartTransactionPayload(RemoteStartTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class RemoteStopTransactionPayload(RemoteStopTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ReserveNowPayload(ReserveNow): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ResetPayload(Reset): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SendLocalListPayload(SendLocalList): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetChargingProfilePayload(SetChargingProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SignedFirmwareStatusNotificationPayload(SignedFirmwareStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SignedUpdateFirmwarePayload(SignedUpdateFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class TriggerMessagePayload(TriggerMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UnlockConnectorPayload(UnlockConnector): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UpdateFirmwarePayload(UpdateFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# The DataTransfer CALLRESULT can be send both from Central System as well as +# from a Charge Point. + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DataTransferPayload(DataTransfer): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) diff --git a/ocpp/v201/call.py b/ocpp/v201/call.py index bff98238b..461f37365 100644 --- a/ocpp/v201/call.py +++ b/ocpp/v201/call.py @@ -1,9 +1,10 @@ +import warnings from dataclasses import dataclass from typing import Any, Dict, List, Optional @dataclass -class AuthorizePayload: +class Authorize: id_token: Dict certificate: Optional[str] = None iso15118_certificate_hash_data: Optional[List] = None @@ -11,72 +12,72 @@ class AuthorizePayload: @dataclass -class BootNotificationPayload: +class BootNotification: charging_station: Dict reason: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class CancelReservationPayload: +class CancelReservation: reservation_id: int custom_data: Optional[Dict[str, Any]] = None @dataclass -class CertificateSignedPayload: +class CertificateSigned: certificate_chain: str certificate_type: Optional[str] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ChangeAvailabilityPayload: +class ChangeAvailability: operational_status: str evse: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearCachePayload: +class ClearCache: custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearChargingProfilePayload: +class ClearChargingProfile: charging_profile_id: Optional[int] = None charging_profile_criteria: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearDisplayMessagePayload: +class ClearDisplayMessage: id: int custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearVariableMonitoringPayload: +class ClearVariableMonitoring: id: List custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearedChargingLimitPayload: +class ClearedChargingLimit: charging_limit_source: str evse_id: Optional[int] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class CostUpdatedPayload: +class CostUpdated: total_cost: int transaction_id: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class CustomerInformationPayload: +class CustomerInformation: request_id: int report: bool clear: bool @@ -87,7 +88,7 @@ class CustomerInformationPayload: @dataclass -class DataTransferPayload: +class DataTransfer: vendor_id: str message_id: Optional[str] = None data: Optional[Any] = None @@ -95,20 +96,20 @@ class DataTransferPayload: @dataclass -class DeleteCertificatePayload: +class DeleteCertificate: certificate_hash_data: Dict custom_data: Optional[Dict[str, Any]] = None @dataclass -class FirmwareStatusNotificationPayload: +class FirmwareStatusNotification: status: str request_id: Optional[int] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class Get15118EVCertificatePayload: +class Get15118EVCertificate: iso15118_schema_version: str action: str exi_request: str @@ -116,20 +117,20 @@ class Get15118EVCertificatePayload: @dataclass -class GetBaseReportPayload: +class GetBaseReport: request_id: int report_base: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetCertificateStatusPayload: +class GetCertificateStatus: ocsp_request_data: Dict custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetChargingProfilesPayload: +class GetChargingProfiles: request_id: int charging_profile: Dict evse_id: Optional[int] = None @@ -137,7 +138,7 @@ class GetChargingProfilesPayload: @dataclass -class GetCompositeSchedulePayload: +class GetCompositeSchedule: duration: int evse_id: int charging_rate_unit: Optional[str] = None @@ -145,7 +146,7 @@ class GetCompositeSchedulePayload: @dataclass -class GetDisplayMessagesPayload: +class GetDisplayMessages: request_id: int id: Optional[List] = None priority: Optional[str] = None @@ -154,18 +155,18 @@ class GetDisplayMessagesPayload: @dataclass -class GetInstalledCertificateIdsPayload: +class GetInstalledCertificateIds: certificate_type: Optional[List] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetLocalListVersionPayload: +class GetLocalListVersion: custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetLogPayload: +class GetLog: log: Dict log_type: str request_id: int @@ -175,7 +176,7 @@ class GetLogPayload: @dataclass -class GetMonitoringReportPayload: +class GetMonitoringReport: request_id: int component_variable: Optional[List] = None monitoring_criteria: Optional[List] = None @@ -183,7 +184,7 @@ class GetMonitoringReportPayload: @dataclass -class GetReportPayload: +class GetReport: request_id: int component_variable: Optional[List] = None component_criteria: Optional[List] = None @@ -191,45 +192,45 @@ class GetReportPayload: @dataclass -class GetTransactionStatusPayload: +class GetTransactionStatus: transaction_id: Optional[str] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetVariablesPayload: +class GetVariables: get_variable_data: List custom_data: Optional[Dict[str, Any]] = None @dataclass -class HeartbeatPayload: +class Heartbeat: custom_data: Optional[Dict[str, Any]] = None @dataclass -class InstallCertificatePayload: +class InstallCertificate: certificate_type: str certificate: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class LogStatusNotificationPayload: +class LogStatusNotification: status: str request_id: Optional[int] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class MeterValuesPayload: +class MeterValues: evse_id: int meter_value: List custom_data: Optional[Dict[str, Any]] = None @dataclass -class NotifyChargingLimitPayload: +class NotifyChargingLimit: charging_limit: Dict charging_schedule: Optional[List] = None evse_id: Optional[int] = None @@ -237,7 +238,7 @@ class NotifyChargingLimitPayload: @dataclass -class NotifyCustomerInformationPayload: +class NotifyCustomerInformation: data: str seq_no: int generated_at: str @@ -247,7 +248,7 @@ class NotifyCustomerInformationPayload: @dataclass -class NotifyDisplayMessagesPayload: +class NotifyDisplayMessages: request_id: int message_info: Optional[List] = None tbc: Optional[bool] = None @@ -255,7 +256,7 @@ class NotifyDisplayMessagesPayload: @dataclass -class NotifyEVChargingNeedsPayload: +class NotifyEVChargingNeeds: charging_needs: Dict evse_id: int max_schedule_tuples: Optional[int] = None @@ -263,7 +264,7 @@ class NotifyEVChargingNeedsPayload: @dataclass -class NotifyEVChargingSchedulePayload: +class NotifyEVChargingSchedule: time_base: str charging_schedule: Dict evse_id: int @@ -271,7 +272,7 @@ class NotifyEVChargingSchedulePayload: @dataclass -class NotifyEventPayload: +class NotifyEvent: generated_at: str seq_no: int event_data: List @@ -280,7 +281,7 @@ class NotifyEventPayload: @dataclass -class NotifyMonitoringReportPayload: +class NotifyMonitoringReport: request_id: int seq_no: int generated_at: str @@ -290,7 +291,7 @@ class NotifyMonitoringReportPayload: @dataclass -class NotifyReportPayload: +class NotifyReport: request_id: int generated_at: str seq_no: int @@ -300,7 +301,7 @@ class NotifyReportPayload: @dataclass -class PublishFirmwarePayload: +class PublishFirmware: location: str checksum: str request_id: int @@ -310,7 +311,7 @@ class PublishFirmwarePayload: @dataclass -class PublishFirmwareStatusNotificationPayload: +class PublishFirmwareStatusNotification: status: str location: Optional[List] = None request_id: Optional[int] = None @@ -318,7 +319,7 @@ class PublishFirmwareStatusNotificationPayload: @dataclass -class ReportChargingProfilesPayload: +class ReportChargingProfiles: request_id: int charging_limit_source: str charging_profile: List @@ -328,7 +329,7 @@ class ReportChargingProfilesPayload: @dataclass -class RequestStartTransactionPayload: +class RequestStartTransaction: id_token: Dict remote_start_id: int evse_id: Optional[int] = None @@ -338,20 +339,20 @@ class RequestStartTransactionPayload: @dataclass -class RequestStopTransactionPayload: +class RequestStopTransaction: transaction_id: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class ReservationStatusUpdatePayload: +class ReservationStatusUpdate: reservation_id: int reservation_update_status: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class ReserveNowPayload: +class ReserveNow: id: int expiry_date_time: str id_token: Dict @@ -362,14 +363,14 @@ class ReserveNowPayload: @dataclass -class ResetPayload: +class Reset: type: str evse_id: Optional[int] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class SecurityEventNotificationPayload: +class SecurityEventNotification: type: str timestamp: str tech_info: Optional[str] = None @@ -377,7 +378,7 @@ class SecurityEventNotificationPayload: @dataclass -class SendLocalListPayload: +class SendLocalList: version_number: int update_type: str local_authorization_list: Optional[List] = None @@ -385,58 +386,58 @@ class SendLocalListPayload: @dataclass -class SetChargingProfilePayload: +class SetChargingProfile: evse_id: int charging_profile: Dict custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetDisplayMessagePayload: +class SetDisplayMessage: message: Dict custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetMonitoringBasePayload: +class SetMonitoringBase: monitoring_base: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetMonitoringLevelPayload: +class SetMonitoringLevel: severity: int custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetNetworkProfilePayload: +class SetNetworkProfile: configuration_slot: int connection_data: Dict custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetVariableMonitoringPayload: +class SetVariableMonitoring: set_monitoring_data: List custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetVariablesPayload: +class SetVariables: set_variable_data: List custom_data: Optional[Dict[str, Any]] = None @dataclass -class SignCertificatePayload: +class SignCertificate: csr: str certificate_type: Optional[str] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class StatusNotificationPayload: +class StatusNotification: timestamp: str connector_status: str evse_id: int @@ -445,7 +446,7 @@ class StatusNotificationPayload: @dataclass -class TransactionEventPayload: +class TransactionEvent: event_type: str timestamp: str trigger_reason: str @@ -462,29 +463,861 @@ class TransactionEventPayload: @dataclass -class TriggerMessagePayload: +class TriggerMessage: requested_message: str evse: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class UnlockConnectorPayload: +class UnlockConnector: evse_id: int connector_id: int custom_data: Optional[Dict[str, Any]] = None @dataclass -class UnpublishFirmwarePayload: +class UnpublishFirmware: checksum: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class UpdateFirmwarePayload: +class UpdateFirmware: request_id: int firmware: Dict retries: Optional[int] = None retry_interval: Optional[int] = None custom_data: Optional[Dict[str, Any]] = None + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class AuthorizePayload(Authorize): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class BootNotificationPayload(BootNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CancelReservationPayload(CancelReservation): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CertificateSignedPayload(CertificateSigned): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ChangeAvailabilityPayload(ChangeAvailability): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearCachePayload(ClearCache): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearChargingProfilePayload(ClearChargingProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearDisplayMessagePayload(ClearDisplayMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearVariableMonitoringPayload(ClearVariableMonitoring): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearedChargingLimitPayload(ClearedChargingLimit): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CostUpdatedPayload(CostUpdated): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CustomerInformationPayload(CustomerInformation): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DataTransferPayload(DataTransfer): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DeleteCertificatePayload(DeleteCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class FirmwareStatusNotificationPayload(FirmwareStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class Get15118EVCertificatePayload(Get15118EVCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetBaseReportPayload(GetBaseReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetCertificateStatusPayload(GetCertificateStatus): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetChargingProfilesPayload(GetChargingProfiles): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetCompositeSchedulePayload(GetCompositeSchedule): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetDisplayMessagesPayload(GetDisplayMessages): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetInstalledCertificateIdsPayload(GetInstalledCertificateIds): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetLocalListVersionPayload(GetLocalListVersion): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetLogPayload(GetLog): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetMonitoringReportPayload(GetMonitoringReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetReportPayload(GetReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetTransactionStatusPayload(GetTransactionStatus): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetVariablesPayload(GetVariables): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class HeartbeatPayload(Heartbeat): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class InstallCertificatePayload(InstallCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class LogStatusNotificationPayload(LogStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class MeterValuesPayload(MeterValues): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyChargingLimitPayload(NotifyChargingLimit): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyCustomerInformationPayload(NotifyCustomerInformation): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyDisplayMessagesPayload(NotifyDisplayMessages): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyEVChargingNeedsPayload(NotifyEVChargingNeeds): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyEVChargingSchedulePayload(NotifyEVChargingSchedule): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyEventPayload(NotifyEvent): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyMonitoringReportPayload(NotifyMonitoringReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyReportPayload(NotifyReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class PublishFirmwarePayload(PublishFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class PublishFirmwareStatusNotificationPayload(PublishFirmwareStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ReportChargingProfilesPayload(ReportChargingProfiles): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class RequestStartTransactionPayload(RequestStartTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class RequestStopTransactionPayload(RequestStopTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ReservationStatusUpdatePayload(ReservationStatusUpdate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ReserveNowPayload(ReserveNow): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ResetPayload(Reset): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SecurityEventNotificationPayload(SecurityEventNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SendLocalListPayload(SendLocalList): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetChargingProfilePayload(SetChargingProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetDisplayMessagePayload(SetDisplayMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetMonitoringBasePayload(SetMonitoringBase): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetMonitoringLevelPayload(SetMonitoringLevel): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetNetworkProfilePayload(SetNetworkProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetVariableMonitoringPayload(SetVariableMonitoring): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetVariablesPayload(SetVariables): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SignCertificatePayload(SignCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class StatusNotificationPayload(StatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class TransactionEventPayload(TransactionEvent): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class TriggerMessagePayload(TriggerMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UnlockConnectorPayload(UnlockConnector): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UnpublishFirmwarePayload(UnpublishFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UpdateFirmwarePayload(UpdateFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) diff --git a/ocpp/v201/call_result.py b/ocpp/v201/call_result.py index 3a59b07a2..520537ce0 100644 --- a/ocpp/v201/call_result.py +++ b/ocpp/v201/call_result.py @@ -1,16 +1,17 @@ +import warnings from dataclasses import dataclass from typing import Any, Dict, List, Optional @dataclass -class AuthorizePayload: +class Authorize: id_token_info: Dict certificate_status: Optional[str] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class BootNotificationPayload: +class BootNotification: current_time: str interval: int status: str @@ -19,72 +20,72 @@ class BootNotificationPayload: @dataclass -class CancelReservationPayload: +class CancelReservation: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class CertificateSignedPayload: +class CertificateSigned: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ChangeAvailabilityPayload: +class ChangeAvailability: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearCachePayload: +class ClearCache: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearChargingProfilePayload: +class ClearChargingProfile: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearDisplayMessagePayload: +class ClearDisplayMessage: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearVariableMonitoringPayload: +class ClearVariableMonitoring: clear_monitoring_result: List custom_data: Optional[Dict[str, Any]] = None @dataclass -class ClearedChargingLimitPayload: +class ClearedChargingLimit: custom_data: Optional[Dict[str, Any]] = None @dataclass -class CostUpdatedPayload: +class CostUpdated: custom_data: Optional[Dict[str, Any]] = None @dataclass -class CustomerInformationPayload: +class CustomerInformation: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class DataTransferPayload: +class DataTransfer: status: str status_info: Optional[Dict] = None data: Optional[Any] = None @@ -92,19 +93,19 @@ class DataTransferPayload: @dataclass -class DeleteCertificatePayload: +class DeleteCertificate: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class FirmwareStatusNotificationPayload: +class FirmwareStatusNotification: custom_data: Optional[Dict[str, Any]] = None @dataclass -class Get15118EVCertificatePayload: +class Get15118EVCertificate: status: str exi_response: str status_info: Optional[Dict] = None @@ -112,14 +113,14 @@ class Get15118EVCertificatePayload: @dataclass -class GetBaseReportPayload: +class GetBaseReport: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetCertificateStatusPayload: +class GetCertificateStatus: status: str status_info: Optional[Dict] = None ocsp_result: Optional[str] = None @@ -127,14 +128,14 @@ class GetCertificateStatusPayload: @dataclass -class GetChargingProfilesPayload: +class GetChargingProfiles: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetCompositeSchedulePayload: +class GetCompositeSchedule: status: str status_info: Optional[Dict] = None schedule: Optional[Dict] = None @@ -142,14 +143,14 @@ class GetCompositeSchedulePayload: @dataclass -class GetDisplayMessagesPayload: +class GetDisplayMessages: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetInstalledCertificateIdsPayload: +class GetInstalledCertificateIds: status: str status_info: Optional[Dict] = None certificate_hash_data_chain: Optional[List] = None @@ -157,13 +158,13 @@ class GetInstalledCertificateIdsPayload: @dataclass -class GetLocalListVersionPayload: +class GetLocalListVersion: version_number: int custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetLogPayload: +class GetLog: status: str status_info: Optional[Dict] = None filename: Optional[str] = None @@ -171,118 +172,118 @@ class GetLogPayload: @dataclass -class GetMonitoringReportPayload: +class GetMonitoringReport: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetReportPayload: +class GetReport: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetTransactionStatusPayload: +class GetTransactionStatus: messages_in_queue: bool ongoing_indicator: Optional[bool] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class GetVariablesPayload: +class GetVariables: get_variable_result: List custom_data: Optional[Dict[str, Any]] = None @dataclass -class HeartbeatPayload: +class Heartbeat: current_time: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class InstallCertificatePayload: +class InstallCertificate: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class LogStatusNotificationPayload: +class LogStatusNotification: custom_data: Optional[Dict[str, Any]] = None @dataclass -class MeterValuesPayload: +class MeterValues: custom_data: Optional[Dict[str, Any]] = None @dataclass -class NotifyChargingLimitPayload: +class NotifyChargingLimit: custom_data: Optional[Dict[str, Any]] = None @dataclass -class NotifyCustomerInformationPayload: +class NotifyCustomerInformation: custom_data: Optional[Dict[str, Any]] = None @dataclass -class NotifyDisplayMessagesPayload: +class NotifyDisplayMessages: custom_data: Optional[Dict[str, Any]] = None @dataclass -class NotifyEVChargingNeedsPayload: +class NotifyEVChargingNeeds: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class NotifyEVChargingSchedulePayload: +class NotifyEVChargingSchedule: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class NotifyEventPayload: +class NotifyEvent: custom_data: Optional[Dict[str, Any]] = None @dataclass -class NotifyMonitoringReportPayload: +class NotifyMonitoringReport: custom_data: Optional[Dict[str, Any]] = None @dataclass -class NotifyReportPayload: +class NotifyReport: custom_data: Optional[Dict[str, Any]] = None @dataclass -class PublishFirmwarePayload: +class PublishFirmware: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class PublishFirmwareStatusNotificationPayload: +class PublishFirmwareStatusNotification: custom_data: Optional[Dict[str, Any]] = None @dataclass -class ReportChargingProfilesPayload: +class ReportChargingProfiles: custom_data: Optional[Dict[str, Any]] = None @dataclass -class RequestStartTransactionPayload: +class RequestStartTransaction: status: str status_info: Optional[Dict] = None transaction_id: Optional[str] = None @@ -290,104 +291,104 @@ class RequestStartTransactionPayload: @dataclass -class RequestStopTransactionPayload: +class RequestStopTransaction: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ReservationStatusUpdatePayload: +class ReservationStatusUpdate: custom_data: Optional[Dict[str, Any]] = None @dataclass -class ReserveNowPayload: +class ReserveNow: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class ResetPayload: +class Reset: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class SecurityEventNotificationPayload: +class SecurityEventNotification: custom_data: Optional[Dict[str, Any]] = None @dataclass -class SendLocalListPayload: +class SendLocalList: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetChargingProfilePayload: +class SetChargingProfile: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetDisplayMessagePayload: +class SetDisplayMessage: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetMonitoringBasePayload: +class SetMonitoringBase: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetMonitoringLevelPayload: +class SetMonitoringLevel: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetNetworkProfilePayload: +class SetNetworkProfile: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetVariableMonitoringPayload: +class SetVariableMonitoring: set_monitoring_result: List custom_data: Optional[Dict[str, Any]] = None @dataclass -class SetVariablesPayload: +class SetVariables: set_variable_result: List custom_data: Optional[Dict[str, Any]] = None @dataclass -class SignCertificatePayload: +class SignCertificate: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class StatusNotificationPayload: +class StatusNotification: custom_data: Optional[Dict[str, Any]] = None @dataclass -class TransactionEventPayload: +class TransactionEvent: total_cost: Optional[int] = None charging_priority: Optional[int] = None id_token_info: Optional[Dict] = None @@ -396,27 +397,859 @@ class TransactionEventPayload: @dataclass -class TriggerMessagePayload: +class TriggerMessage: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class UnlockConnectorPayload: +class UnlockConnector: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None @dataclass -class UnpublishFirmwarePayload: +class UnpublishFirmware: status: str custom_data: Optional[Dict[str, Any]] = None @dataclass -class UpdateFirmwarePayload: +class UpdateFirmware: status: str status_info: Optional[Dict] = None custom_data: Optional[Dict[str, Any]] = None + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class AuthorizePayload(Authorize): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class BootNotificationPayload(BootNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CancelReservationPayload(CancelReservation): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CertificateSignedPayload(CertificateSigned): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ChangeAvailabilityPayload(ChangeAvailability): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearCachePayload(ClearCache): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearChargingProfilePayload(ClearChargingProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearDisplayMessagePayload(ClearDisplayMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearVariableMonitoringPayload(ClearVariableMonitoring): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ClearedChargingLimitPayload(ClearedChargingLimit): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CostUpdatedPayload(CostUpdated): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class CustomerInformationPayload(CustomerInformation): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DataTransferPayload(DataTransfer): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class DeleteCertificatePayload(DeleteCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class FirmwareStatusNotificationPayload(FirmwareStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class Get15118EVCertificatePayload(Get15118EVCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetBaseReportPayload(GetBaseReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetCertificateStatusPayload(GetCertificateStatus): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetChargingProfilesPayload(GetChargingProfiles): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetCompositeSchedulePayload(GetCompositeSchedule): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetDisplayMessagesPayload(GetDisplayMessages): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetInstalledCertificateIdsPayload(GetInstalledCertificateIds): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetLocalListVersionPayload(GetLocalListVersion): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetLogPayload(GetLog): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetMonitoringReportPayload(GetMonitoringReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetReportPayload(GetReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetTransactionStatusPayload(GetTransactionStatus): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class GetVariablesPayload(GetVariables): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class HeartbeatPayload(Heartbeat): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class InstallCertificatePayload(InstallCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class LogStatusNotificationPayload(LogStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class MeterValuesPayload(MeterValues): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyChargingLimitPayload(NotifyChargingLimit): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyCustomerInformationPayload(NotifyCustomerInformation): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyDisplayMessagesPayload(NotifyDisplayMessages): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyEVChargingNeedsPayload(NotifyEVChargingNeeds): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyEVChargingSchedulePayload(NotifyEVChargingSchedule): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyEventPayload(NotifyEvent): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyMonitoringReportPayload(NotifyMonitoringReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class NotifyReportPayload(NotifyReport): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class PublishFirmwarePayload(PublishFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class PublishFirmwareStatusNotificationPayload(PublishFirmwareStatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ReportChargingProfilesPayload(ReportChargingProfiles): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class RequestStartTransactionPayload(RequestStartTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class RequestStopTransactionPayload(RequestStopTransaction): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ReservationStatusUpdatePayload(ReservationStatusUpdate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ReserveNowPayload(ReserveNow): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class ResetPayload(Reset): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SecurityEventNotificationPayload(SecurityEventNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SendLocalListPayload(SendLocalList): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetChargingProfilePayload(SetChargingProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetDisplayMessagePayload(SetDisplayMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetMonitoringBasePayload(SetMonitoringBase): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetMonitoringLevelPayload(SetMonitoringLevel): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetNetworkProfilePayload(SetNetworkProfile): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetVariableMonitoringPayload(SetVariableMonitoring): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SetVariablesPayload(SetVariables): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class SignCertificatePayload(SignCertificate): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class StatusNotificationPayload(StatusNotification): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class TransactionEventPayload(TransactionEvent): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class TriggerMessagePayload(TriggerMessage): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UnlockConnectorPayload(UnlockConnector): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UnpublishFirmwarePayload(UnpublishFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) + + +# Dataclass soon to be deprecated use equal class name without the suffix 'Payload' +@dataclass +class UpdateFirmwarePayload(UpdateFirmware): + def __post_init__(self): + warnings.warn( + ( + __class__.__name__ + + " is deprecated, use instead " + + __class__.__mro__[1].__name__ + ) + ) From c2141c04c8021874264d3fc78d35ff56f0bfe13d Mon Sep 17 00:00:00 2001 From: Jared Newell Date: Mon, 5 Feb 2024 13:26:30 +0100 Subject: [PATCH 02/10] v2x corrected --- CHANGELOG.md | 1 + ocpp/charge_point.py | 1 + tests/test_charge_point.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e05bb06d0..2b5c238d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Change log - [#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' +- [#591](https://github.com/mobilityhouse/ocpp/issues/591) Camel_to_snake_case doesn't handle v2x correctly ## 0.26.0 (2024-01-17) diff --git a/ocpp/charge_point.py b/ocpp/charge_point.py index 4d7cb9676..e23fbf50d 100644 --- a/ocpp/charge_point.py +++ b/ocpp/charge_point.py @@ -25,6 +25,7 @@ def camel_to_snake_case(data): if isinstance(data, dict): snake_case_dict = {} for key, value in data.items(): + key = key.replace("V2X", "_v2x") s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", key) key = re.sub("([a-z0-9])([A-Z])(?=\\S)", r"\1_\2", s1).lower() diff --git a/tests/test_charge_point.py b/tests/test_charge_point.py index 897fabc2b..e8d71c3fd 100644 --- a/tests/test_charge_point.py +++ b/tests/test_charge_point.py @@ -58,6 +58,8 @@ def heartbeat(self, **kwargs): [ ({"transactionId": "74563478"}, {"transaction_id": "74563478"}), ({"fullSoC": 100}, {"full_soc": 100}), + ({"evMinV2XEnergyRequest": 200}, {"ev_min_v2x_energy_request": 200}), + ({"v2xChargingCtrlr": 200}, {"v2x_charging_ctrlr": 200}), ], ) def test_camel_to_snake_case(test_input, expected): From c587d236613ae0eb8cc739d34d4c6cfa71918c71 Mon Sep 17 00:00:00 2001 From: Jared Newell Date: Mon, 5 Feb 2024 13:28:31 +0100 Subject: [PATCH 03/10] Revert "v2x corrected" This reverts commit c2141c04c8021874264d3fc78d35ff56f0bfe13d. --- CHANGELOG.md | 1 - ocpp/charge_point.py | 1 - tests/test_charge_point.py | 2 -- 3 files changed, 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b5c238d1..e05bb06d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,6 @@ # Change log - [#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' -- [#591](https://github.com/mobilityhouse/ocpp/issues/591) Camel_to_snake_case doesn't handle v2x correctly ## 0.26.0 (2024-01-17) diff --git a/ocpp/charge_point.py b/ocpp/charge_point.py index e23fbf50d..4d7cb9676 100644 --- a/ocpp/charge_point.py +++ b/ocpp/charge_point.py @@ -25,7 +25,6 @@ def camel_to_snake_case(data): if isinstance(data, dict): snake_case_dict = {} for key, value in data.items(): - key = key.replace("V2X", "_v2x") s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", key) key = re.sub("([a-z0-9])([A-Z])(?=\\S)", r"\1_\2", s1).lower() diff --git a/tests/test_charge_point.py b/tests/test_charge_point.py index e8d71c3fd..897fabc2b 100644 --- a/tests/test_charge_point.py +++ b/tests/test_charge_point.py @@ -58,8 +58,6 @@ def heartbeat(self, **kwargs): [ ({"transactionId": "74563478"}, {"transaction_id": "74563478"}), ({"fullSoC": 100}, {"full_soc": 100}), - ({"evMinV2XEnergyRequest": 200}, {"ev_min_v2x_energy_request": 200}), - ({"v2xChargingCtrlr": 200}, {"v2x_charging_ctrlr": 200}), ], ) def test_camel_to_snake_case(test_input, expected): From f1cf457265e4d72db01933d847f7492d2d8062cb Mon Sep 17 00:00:00 2001 From: Jared-Newell-Mobility <119603687+Jared-Newell-Mobility@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:44:11 +0100 Subject: [PATCH 04/10] Validate project against Python 3.11 and Python 3.112 . (#589) --- .github/workflows/pull-request.yml | 2 ++ CHANGELOG.md | 2 +- ocpp/exceptions.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4a69f851a..e37b46c43 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -15,6 +15,8 @@ jobs: - "3.8" - "3.9" - "3.10" + - "3.11" + - "3.12" steps: - uses: actions/checkout@master - name: Set up Python ${{ matrix.version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e05bb06d0..149f2876b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # Change log - +- [#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' ## 0.26.0 (2024-01-17) diff --git a/ocpp/exceptions.py b/ocpp/exceptions.py index cefba9549..867b6a793 100644 --- a/ocpp/exceptions.py +++ b/ocpp/exceptions.py @@ -25,12 +25,12 @@ def __eq__(self, other): def __repr__(self): return ( - f"<{self.__class__.__name__} - description={self.description}," + f"<{self.__class__.__name__} - description={self.description}, " f" details={self.details}>" ) def __str__(self): - return f"{self.__class__.__name__}: {self.description}," f" {self.details}" + return f"{self.__class__.__name__}: {self.description}, " f" {self.details}" class NotImplementedError(OCPPError): From ae02ede445ea56375505d21bd498a88fce937862 Mon Sep 17 00:00:00 2001 From: Jared-Newell-Mobility <119603687+Jared-Newell-Mobility@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:51:17 +0100 Subject: [PATCH 05/10] Drop support for Python 3.7 --- .github/workflows/pull-request.yml | 1 - poetry.lock | 115 ++++------------------------- pyproject.toml | 4 +- tests/conftest.py | 7 +- tests/v16/conftest.py | 7 +- tests/v201/conftest.py | 7 +- 6 files changed, 17 insertions(+), 124 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index e37b46c43..52a5985de 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -11,7 +11,6 @@ jobs: strategy: matrix: version: - - "3.7" - "3.8" - "3.9" - "3.10" diff --git a/poetry.lock b/poetry.lock index b11664c88..34926ea37 100644 --- a/poetry.lock +++ b/poetry.lock @@ -12,18 +12,6 @@ files = [ {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, ] -[[package]] -name = "asynctest" -version = "0.13.0" -description = "Enhance the standard unittest package with features for testing asyncio libraries" -category = "dev" -optional = false -python-versions = ">=3.5" -files = [ - {file = "asynctest-0.13.0-py3-none-any.whl", hash = "sha256:5da6118a7e6d6b54d83a8f7197769d046922a44d2a99c21382f0a6e4fadae676"}, - {file = "asynctest-0.13.0.tar.gz", hash = "sha256:c27862842d15d83e6a34eb0b2866c323880eb3a75e4485b079ea11748fd77fac"}, -] - [[package]] name = "attrs" version = "23.2.0" @@ -36,9 +24,6 @@ files = [ {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, ] -[package.dependencies] -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} - [package.extras] cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] dev = ["attrs[tests]", "pre-commit"] @@ -93,7 +78,6 @@ mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} -typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] @@ -228,7 +212,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "colorama" @@ -358,7 +341,6 @@ files = [ ] [package.dependencies] -importlib-metadata = {version = ">=1.1.0,<4.3", markers = "python_version < \"3.8\""} mccabe = ">=0.7.0,<0.8.0" pycodestyle = ">=2.9.0,<2.10.0" pyflakes = ">=2.5.0,<2.6.0" @@ -387,26 +369,6 @@ files = [ {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, ] -[[package]] -name = "importlib-metadata" -version = "4.2.0" -description = "Read metadata from Python packages" -category = "main" -optional = false -python-versions = ">=3.6" -files = [ - {file = "importlib_metadata-4.2.0-py3-none-any.whl", hash = "sha256:057e92c15bc8d9e8109738a48db0ccb31b4d9d5cfbee5a8670879a30be66304b"}, - {file = "importlib_metadata-4.2.0.tar.gz", hash = "sha256:b7e52a1f8dec14a75ea73e0891f3060099ca1d8e6a462a4dff11c3e119ea1b31"}, -] - -[package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} -zipp = ">=0.5" - -[package.extras] -docs = ["jaraco.packaging (>=8.2)", "rst.linker (>=1.9)", "sphinx"] -testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pep517", "pyfakefs", "pytest (>=4.6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-flake8", "pytest-mypy"] - [[package]] name = "importlib-resources" version = "5.12.0" @@ -488,11 +450,9 @@ files = [ [package.dependencies] attrs = ">=17.4.0" -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} pkgutil-resolve-name = {version = ">=1.3.10", markers = "python_version < \"3.9\""} pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" -typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] @@ -526,6 +486,16 @@ files = [ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, @@ -630,9 +600,6 @@ files = [ {file = "platformdirs-4.0.0.tar.gz", hash = "sha256:cb633b2bcf10c51af60beb0ab06d2f1d69064b43abf4c185ca6b28865f3f9731"}, ] -[package.dependencies] -typing-extensions = {version = ">=4.7.1", markers = "python_version < \"3.8\""} - [package.extras] docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] @@ -649,9 +616,6 @@ files = [ {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, ] -[package.dependencies] -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} - [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] @@ -748,7 +712,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} -importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -771,7 +734,6 @@ files = [ [package.dependencies] pytest = ">=6.1.0" -typing-extensions = {version = ">=3.7.2", markers = "python_version < \"3.8\""} [package.extras] docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] @@ -1001,62 +963,11 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "typed-ast" -version = "1.5.5" -description = "a fork of Python 2 and 3 ast modules with type comment support" -category = "dev" -optional = false -python-versions = ">=3.6" -files = [ - {file = "typed_ast-1.5.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4bc1efe0ce3ffb74784e06460f01a223ac1f6ab31c6bc0376a21184bf5aabe3b"}, - {file = "typed_ast-1.5.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5f7a8c46a8b333f71abd61d7ab9255440d4a588f34a21f126bbfc95f6049e686"}, - {file = "typed_ast-1.5.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:597fc66b4162f959ee6a96b978c0435bd63791e31e4f410622d19f1686d5e769"}, - {file = "typed_ast-1.5.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d41b7a686ce653e06c2609075d397ebd5b969d821b9797d029fccd71fdec8e04"}, - {file = "typed_ast-1.5.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:5fe83a9a44c4ce67c796a1b466c270c1272e176603d5e06f6afbc101a572859d"}, - {file = "typed_ast-1.5.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d5c0c112a74c0e5db2c75882a0adf3133adedcdbfd8cf7c9d6ed77365ab90a1d"}, - {file = "typed_ast-1.5.5-cp310-cp310-win_amd64.whl", hash = "sha256:e1a976ed4cc2d71bb073e1b2a250892a6e968ff02aa14c1f40eba4f365ffec02"}, - {file = "typed_ast-1.5.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c631da9710271cb67b08bd3f3813b7af7f4c69c319b75475436fcab8c3d21bee"}, - {file = "typed_ast-1.5.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b445c2abfecab89a932b20bd8261488d574591173d07827c1eda32c457358b18"}, - {file = "typed_ast-1.5.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc95ffaaab2be3b25eb938779e43f513e0e538a84dd14a5d844b8f2932593d88"}, - {file = "typed_ast-1.5.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61443214d9b4c660dcf4b5307f15c12cb30bdfe9588ce6158f4a005baeb167b2"}, - {file = "typed_ast-1.5.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6eb936d107e4d474940469e8ec5b380c9b329b5f08b78282d46baeebd3692dc9"}, - {file = "typed_ast-1.5.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e48bf27022897577d8479eaed64701ecaf0467182448bd95759883300ca818c8"}, - {file = "typed_ast-1.5.5-cp311-cp311-win_amd64.whl", hash = "sha256:83509f9324011c9a39faaef0922c6f720f9623afe3fe220b6d0b15638247206b"}, - {file = "typed_ast-1.5.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:44f214394fc1af23ca6d4e9e744804d890045d1643dd7e8229951e0ef39429b5"}, - {file = "typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:118c1ce46ce58fda78503eae14b7664163aa735b620b64b5b725453696f2a35c"}, - {file = "typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be4919b808efa61101456e87f2d4c75b228f4e52618621c77f1ddcaae15904fa"}, - {file = "typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:fc2b8c4e1bc5cd96c1a823a885e6b158f8451cf6f5530e1829390b4d27d0807f"}, - {file = "typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:16f7313e0a08c7de57f2998c85e2a69a642e97cb32f87eb65fbfe88381a5e44d"}, - {file = "typed_ast-1.5.5-cp36-cp36m-win_amd64.whl", hash = "sha256:2b946ef8c04f77230489f75b4b5a4a6f24c078be4aed241cfabe9cbf4156e7e5"}, - {file = "typed_ast-1.5.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2188bc33d85951ea4ddad55d2b35598b2709d122c11c75cffd529fbc9965508e"}, - {file = "typed_ast-1.5.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0635900d16ae133cab3b26c607586131269f88266954eb04ec31535c9a12ef1e"}, - {file = "typed_ast-1.5.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:57bfc3cf35a0f2fdf0a88a3044aafaec1d2f24d8ae8cd87c4f58d615fb5b6311"}, - {file = "typed_ast-1.5.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:fe58ef6a764de7b4b36edfc8592641f56e69b7163bba9f9c8089838ee596bfb2"}, - {file = "typed_ast-1.5.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d09d930c2d1d621f717bb217bf1fe2584616febb5138d9b3e8cdd26506c3f6d4"}, - {file = "typed_ast-1.5.5-cp37-cp37m-win_amd64.whl", hash = "sha256:d40c10326893ecab8a80a53039164a224984339b2c32a6baf55ecbd5b1df6431"}, - {file = "typed_ast-1.5.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:fd946abf3c31fb50eee07451a6aedbfff912fcd13cf357363f5b4e834cc5e71a"}, - {file = "typed_ast-1.5.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ed4a1a42df8a3dfb6b40c3d2de109e935949f2f66b19703eafade03173f8f437"}, - {file = "typed_ast-1.5.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:045f9930a1550d9352464e5149710d56a2aed23a2ffe78946478f7b5416f1ede"}, - {file = "typed_ast-1.5.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:381eed9c95484ceef5ced626355fdc0765ab51d8553fec08661dce654a935db4"}, - {file = "typed_ast-1.5.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:bfd39a41c0ef6f31684daff53befddae608f9daf6957140228a08e51f312d7e6"}, - {file = "typed_ast-1.5.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8c524eb3024edcc04e288db9541fe1f438f82d281e591c548903d5b77ad1ddd4"}, - {file = "typed_ast-1.5.5-cp38-cp38-win_amd64.whl", hash = "sha256:7f58fabdde8dcbe764cef5e1a7fcb440f2463c1bbbec1cf2a86ca7bc1f95184b"}, - {file = "typed_ast-1.5.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:042eb665ff6bf020dd2243307d11ed626306b82812aba21836096d229fdc6a10"}, - {file = "typed_ast-1.5.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:622e4a006472b05cf6ef7f9f2636edc51bda670b7bbffa18d26b255269d3d814"}, - {file = "typed_ast-1.5.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1efebbbf4604ad1283e963e8915daa240cb4bf5067053cf2f0baadc4d4fb51b8"}, - {file = "typed_ast-1.5.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0aefdd66f1784c58f65b502b6cf8b121544680456d1cebbd300c2c813899274"}, - {file = "typed_ast-1.5.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:48074261a842acf825af1968cd912f6f21357316080ebaca5f19abbb11690c8a"}, - {file = "typed_ast-1.5.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:429ae404f69dc94b9361bb62291885894b7c6fb4640d561179548c849f8492ba"}, - {file = "typed_ast-1.5.5-cp39-cp39-win_amd64.whl", hash = "sha256:335f22ccb244da2b5c296e6f96b06ee9bed46526db0de38d2f0e5a6597b81155"}, - {file = "typed_ast-1.5.5.tar.gz", hash = "sha256:94282f7a354f36ef5dbce0ef3467ebf6a258e370ab33d5b40c249fa996e590dd"}, -] - [[package]] name = "typing-extensions" version = "4.7.1" description = "Backported and Experimental Type Hints for Python 3.7+" -category = "main" +category = "dev" optional = false python-versions = ">=3.7" files = [ @@ -1100,5 +1011,5 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" -python-versions = "^3.7" -content-hash = "21d1add46de6767e4784710ad659f8881d8eeaf99e0c60b3e1e80d0201600194" +python-versions = "^3.8" +content-hash = "ff5acd04841119c203edb825e4905c233389b9168d15fe345611757b93c11af9" diff --git a/pyproject.toml b/pyproject.toml index 92d56c745..704249463 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,16 +27,14 @@ classifiers = [ 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.7' ] [tool.poetry.dependencies] -python = "^3.7" +python = "^3.8" jsonschema = "^4.4.0" [tool.poetry.dev-dependencies] # Starting from Python 3.8, asynctest is replaced with a unittest.mock.AsyncMock in standard library. -asynctest = { version = "0.13.0", python = "~3.7" } pytest = "^7" pytest-asyncio = "^0.20.3" pytest-cov = "^4.0.0" diff --git a/tests/conftest.py b/tests/conftest.py index 69e0561c0..51c17e22b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,9 +1,4 @@ -try: - from unittest.mock import AsyncMock -except ImportError: - # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence, - # we need to resolve to a package on pypi. - from asynctest import CoroutineMock as AsyncMock +from unittest.mock import AsyncMock import pytest diff --git a/tests/v16/conftest.py b/tests/v16/conftest.py index a8dfc365f..67dea686f 100644 --- a/tests/v16/conftest.py +++ b/tests/v16/conftest.py @@ -1,9 +1,4 @@ -try: - from unittest.mock import AsyncMock -except ImportError: - # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence, - # we need to resolve to a package on pypi. - from asynctest import CoroutineMock as AsyncMock +from unittest.mock import AsyncMock import pytest diff --git a/tests/v201/conftest.py b/tests/v201/conftest.py index ca71fc5b3..97dd2b9dd 100644 --- a/tests/v201/conftest.py +++ b/tests/v201/conftest.py @@ -1,9 +1,4 @@ -try: - from unittest.mock import AsyncMock -except ImportError: - # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence, - # we need to resolve to a package on pypi. - from asynctest import CoroutineMock as AsyncMock +from unittest.mock import AsyncMock import pytest From 1fcc49d51185282bba9b7362b6beef302f109770 Mon Sep 17 00:00:00 2001 From: Jared-Newell-Mobility <119603687+Jared-Newell-Mobility@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:31:38 +0100 Subject: [PATCH 06/10] Update Code Owners (#588) see issue https://github.com/mobilityhouse/ocpp/issues/587 --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ff8ee0574..9cd57fd8f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @OrangeTux @tropxy +* @OrangeTux @tropxy @Jared-Newell-Mobility From 3963e7a5b46c2c2a5598dbcda57b8cc13a3efe14 Mon Sep 17 00:00:00 2001 From: Jared-Newell-Mobility <119603687+Jared-Newell-Mobility@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:34:09 +0100 Subject: [PATCH 07/10] Revert "drop support for python 3.7" (#597) Reverts mobilityhouse/ocpp#585 As this is breaking should be included in release 1.0.0 --- .github/workflows/pull-request.yml | 1 + poetry.lock | 115 +++++++++++++++++++++++++---- pyproject.toml | 4 +- tests/conftest.py | 7 +- tests/v16/conftest.py | 7 +- tests/v201/conftest.py | 7 +- 6 files changed, 124 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 52a5985de..e37b46c43 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -11,6 +11,7 @@ jobs: strategy: matrix: version: + - "3.7" - "3.8" - "3.9" - "3.10" diff --git a/poetry.lock b/poetry.lock index 34926ea37..b11664c88 100644 --- a/poetry.lock +++ b/poetry.lock @@ -12,6 +12,18 @@ files = [ {file = "alabaster-0.7.13.tar.gz", hash = "sha256:a27a4a084d5e690e16e01e03ad2b2e552c61a65469419b907243193de1a84ae2"}, ] +[[package]] +name = "asynctest" +version = "0.13.0" +description = "Enhance the standard unittest package with features for testing asyncio libraries" +category = "dev" +optional = false +python-versions = ">=3.5" +files = [ + {file = "asynctest-0.13.0-py3-none-any.whl", hash = "sha256:5da6118a7e6d6b54d83a8f7197769d046922a44d2a99c21382f0a6e4fadae676"}, + {file = "asynctest-0.13.0.tar.gz", hash = "sha256:c27862842d15d83e6a34eb0b2866c323880eb3a75e4485b079ea11748fd77fac"}, +] + [[package]] name = "attrs" version = "23.2.0" @@ -24,6 +36,9 @@ files = [ {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, ] +[package.dependencies] +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} + [package.extras] cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] dev = ["attrs[tests]", "pre-commit"] @@ -78,6 +93,7 @@ mypy-extensions = ">=0.4.3" pathspec = ">=0.9.0" platformdirs = ">=2" tomli = {version = ">=1.1.0", markers = "python_full_version < \"3.11.0a7\""} +typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\" and implementation_name == \"cpython\""} typing-extensions = {version = ">=3.10.0.0", markers = "python_version < \"3.10\""} [package.extras] @@ -212,6 +228,7 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "colorama" @@ -341,6 +358,7 @@ files = [ ] [package.dependencies] +importlib-metadata = {version = ">=1.1.0,<4.3", markers = "python_version < \"3.8\""} mccabe = ">=0.7.0,<0.8.0" pycodestyle = ">=2.9.0,<2.10.0" pyflakes = ">=2.5.0,<2.6.0" @@ -369,6 +387,26 @@ files = [ {file = "imagesize-1.4.1.tar.gz", hash = "sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a"}, ] +[[package]] +name = "importlib-metadata" +version = "4.2.0" +description = "Read metadata from Python packages" +category = "main" +optional = false +python-versions = ">=3.6" +files = [ + {file = "importlib_metadata-4.2.0-py3-none-any.whl", hash = "sha256:057e92c15bc8d9e8109738a48db0ccb31b4d9d5cfbee5a8670879a30be66304b"}, + {file = "importlib_metadata-4.2.0.tar.gz", hash = "sha256:b7e52a1f8dec14a75ea73e0891f3060099ca1d8e6a462a4dff11c3e119ea1b31"}, +] + +[package.dependencies] +typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} +zipp = ">=0.5" + +[package.extras] +docs = ["jaraco.packaging (>=8.2)", "rst.linker (>=1.9)", "sphinx"] +testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pep517", "pyfakefs", "pytest (>=4.6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-flake8", "pytest-mypy"] + [[package]] name = "importlib-resources" version = "5.12.0" @@ -450,9 +488,11 @@ files = [ [package.dependencies] attrs = ">=17.4.0" +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} importlib-resources = {version = ">=1.4.0", markers = "python_version < \"3.9\""} pkgutil-resolve-name = {version = ">=1.3.10", markers = "python_version < \"3.9\""} pyrsistent = ">=0.14.0,<0.17.0 || >0.17.0,<0.17.1 || >0.17.1,<0.17.2 || >0.17.2" +typing-extensions = {version = "*", markers = "python_version < \"3.8\""} [package.extras] format = ["fqdn", "idna", "isoduration", "jsonpointer (>1.13)", "rfc3339-validator", "rfc3987", "uri-template", "webcolors (>=1.11)"] @@ -486,16 +526,6 @@ files = [ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"}, - {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, @@ -600,6 +630,9 @@ files = [ {file = "platformdirs-4.0.0.tar.gz", hash = "sha256:cb633b2bcf10c51af60beb0ab06d2f1d69064b43abf4c185ca6b28865f3f9731"}, ] +[package.dependencies] +typing-extensions = {version = ">=4.7.1", markers = "python_version < \"3.8\""} + [package.extras] docs = ["furo (>=2023.7.26)", "proselint (>=0.13)", "sphinx (>=7.1.1)", "sphinx-autodoc-typehints (>=1.24)"] test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4)", "pytest-cov (>=4.1)", "pytest-mock (>=3.11.1)"] @@ -616,6 +649,9 @@ files = [ {file = "pluggy-1.2.0.tar.gz", hash = "sha256:d12f0c4b579b15f5e054301bb226ee85eeeba08ffec228092f8defbaa3a4c4b3"}, ] +[package.dependencies] +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} + [package.extras] dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] @@ -712,6 +748,7 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} iniconfig = "*" packaging = "*" pluggy = ">=0.12,<2.0" @@ -734,6 +771,7 @@ files = [ [package.dependencies] pytest = ">=6.1.0" +typing-extensions = {version = ">=3.7.2", markers = "python_version < \"3.8\""} [package.extras] docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] @@ -963,11 +1001,62 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] +[[package]] +name = "typed-ast" +version = "1.5.5" +description = "a fork of Python 2 and 3 ast modules with type comment support" +category = "dev" +optional = false +python-versions = ">=3.6" +files = [ + {file = "typed_ast-1.5.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:4bc1efe0ce3ffb74784e06460f01a223ac1f6ab31c6bc0376a21184bf5aabe3b"}, + {file = "typed_ast-1.5.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:5f7a8c46a8b333f71abd61d7ab9255440d4a588f34a21f126bbfc95f6049e686"}, + {file = "typed_ast-1.5.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:597fc66b4162f959ee6a96b978c0435bd63791e31e4f410622d19f1686d5e769"}, + {file = "typed_ast-1.5.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d41b7a686ce653e06c2609075d397ebd5b969d821b9797d029fccd71fdec8e04"}, + {file = "typed_ast-1.5.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:5fe83a9a44c4ce67c796a1b466c270c1272e176603d5e06f6afbc101a572859d"}, + {file = "typed_ast-1.5.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:d5c0c112a74c0e5db2c75882a0adf3133adedcdbfd8cf7c9d6ed77365ab90a1d"}, + {file = "typed_ast-1.5.5-cp310-cp310-win_amd64.whl", hash = "sha256:e1a976ed4cc2d71bb073e1b2a250892a6e968ff02aa14c1f40eba4f365ffec02"}, + {file = "typed_ast-1.5.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c631da9710271cb67b08bd3f3813b7af7f4c69c319b75475436fcab8c3d21bee"}, + {file = "typed_ast-1.5.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b445c2abfecab89a932b20bd8261488d574591173d07827c1eda32c457358b18"}, + {file = "typed_ast-1.5.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cc95ffaaab2be3b25eb938779e43f513e0e538a84dd14a5d844b8f2932593d88"}, + {file = "typed_ast-1.5.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:61443214d9b4c660dcf4b5307f15c12cb30bdfe9588ce6158f4a005baeb167b2"}, + {file = "typed_ast-1.5.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:6eb936d107e4d474940469e8ec5b380c9b329b5f08b78282d46baeebd3692dc9"}, + {file = "typed_ast-1.5.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e48bf27022897577d8479eaed64701ecaf0467182448bd95759883300ca818c8"}, + {file = "typed_ast-1.5.5-cp311-cp311-win_amd64.whl", hash = "sha256:83509f9324011c9a39faaef0922c6f720f9623afe3fe220b6d0b15638247206b"}, + {file = "typed_ast-1.5.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:44f214394fc1af23ca6d4e9e744804d890045d1643dd7e8229951e0ef39429b5"}, + {file = "typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:118c1ce46ce58fda78503eae14b7664163aa735b620b64b5b725453696f2a35c"}, + {file = "typed_ast-1.5.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be4919b808efa61101456e87f2d4c75b228f4e52618621c77f1ddcaae15904fa"}, + {file = "typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:fc2b8c4e1bc5cd96c1a823a885e6b158f8451cf6f5530e1829390b4d27d0807f"}, + {file = "typed_ast-1.5.5-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:16f7313e0a08c7de57f2998c85e2a69a642e97cb32f87eb65fbfe88381a5e44d"}, + {file = "typed_ast-1.5.5-cp36-cp36m-win_amd64.whl", hash = "sha256:2b946ef8c04f77230489f75b4b5a4a6f24c078be4aed241cfabe9cbf4156e7e5"}, + {file = "typed_ast-1.5.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2188bc33d85951ea4ddad55d2b35598b2709d122c11c75cffd529fbc9965508e"}, + {file = "typed_ast-1.5.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0635900d16ae133cab3b26c607586131269f88266954eb04ec31535c9a12ef1e"}, + {file = "typed_ast-1.5.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:57bfc3cf35a0f2fdf0a88a3044aafaec1d2f24d8ae8cd87c4f58d615fb5b6311"}, + {file = "typed_ast-1.5.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:fe58ef6a764de7b4b36edfc8592641f56e69b7163bba9f9c8089838ee596bfb2"}, + {file = "typed_ast-1.5.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:d09d930c2d1d621f717bb217bf1fe2584616febb5138d9b3e8cdd26506c3f6d4"}, + {file = "typed_ast-1.5.5-cp37-cp37m-win_amd64.whl", hash = "sha256:d40c10326893ecab8a80a53039164a224984339b2c32a6baf55ecbd5b1df6431"}, + {file = "typed_ast-1.5.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:fd946abf3c31fb50eee07451a6aedbfff912fcd13cf357363f5b4e834cc5e71a"}, + {file = "typed_ast-1.5.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ed4a1a42df8a3dfb6b40c3d2de109e935949f2f66b19703eafade03173f8f437"}, + {file = "typed_ast-1.5.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:045f9930a1550d9352464e5149710d56a2aed23a2ffe78946478f7b5416f1ede"}, + {file = "typed_ast-1.5.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:381eed9c95484ceef5ced626355fdc0765ab51d8553fec08661dce654a935db4"}, + {file = "typed_ast-1.5.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:bfd39a41c0ef6f31684daff53befddae608f9daf6957140228a08e51f312d7e6"}, + {file = "typed_ast-1.5.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8c524eb3024edcc04e288db9541fe1f438f82d281e591c548903d5b77ad1ddd4"}, + {file = "typed_ast-1.5.5-cp38-cp38-win_amd64.whl", hash = "sha256:7f58fabdde8dcbe764cef5e1a7fcb440f2463c1bbbec1cf2a86ca7bc1f95184b"}, + {file = "typed_ast-1.5.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:042eb665ff6bf020dd2243307d11ed626306b82812aba21836096d229fdc6a10"}, + {file = "typed_ast-1.5.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:622e4a006472b05cf6ef7f9f2636edc51bda670b7bbffa18d26b255269d3d814"}, + {file = "typed_ast-1.5.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1efebbbf4604ad1283e963e8915daa240cb4bf5067053cf2f0baadc4d4fb51b8"}, + {file = "typed_ast-1.5.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f0aefdd66f1784c58f65b502b6cf8b121544680456d1cebbd300c2c813899274"}, + {file = "typed_ast-1.5.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:48074261a842acf825af1968cd912f6f21357316080ebaca5f19abbb11690c8a"}, + {file = "typed_ast-1.5.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:429ae404f69dc94b9361bb62291885894b7c6fb4640d561179548c849f8492ba"}, + {file = "typed_ast-1.5.5-cp39-cp39-win_amd64.whl", hash = "sha256:335f22ccb244da2b5c296e6f96b06ee9bed46526db0de38d2f0e5a6597b81155"}, + {file = "typed_ast-1.5.5.tar.gz", hash = "sha256:94282f7a354f36ef5dbce0ef3467ebf6a258e370ab33d5b40c249fa996e590dd"}, +] + [[package]] name = "typing-extensions" version = "4.7.1" description = "Backported and Experimental Type Hints for Python 3.7+" -category = "dev" +category = "main" optional = false python-versions = ">=3.7" files = [ @@ -1011,5 +1100,5 @@ testing = ["big-O", "flake8 (<5)", "jaraco.functools", "jaraco.itertools", "more [metadata] lock-version = "2.0" -python-versions = "^3.8" -content-hash = "ff5acd04841119c203edb825e4905c233389b9168d15fe345611757b93c11af9" +python-versions = "^3.7" +content-hash = "21d1add46de6767e4784710ad659f8881d8eeaf99e0c60b3e1e80d0201600194" diff --git a/pyproject.toml b/pyproject.toml index 704249463..92d56c745 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,14 +27,16 @@ classifiers = [ 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.7' ] [tool.poetry.dependencies] -python = "^3.8" +python = "^3.7" jsonschema = "^4.4.0" [tool.poetry.dev-dependencies] # Starting from Python 3.8, asynctest is replaced with a unittest.mock.AsyncMock in standard library. +asynctest = { version = "0.13.0", python = "~3.7" } pytest = "^7" pytest-asyncio = "^0.20.3" pytest-cov = "^4.0.0" diff --git a/tests/conftest.py b/tests/conftest.py index 51c17e22b..69e0561c0 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,4 +1,9 @@ -from unittest.mock import AsyncMock +try: + from unittest.mock import AsyncMock +except ImportError: + # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence, + # we need to resolve to a package on pypi. + from asynctest import CoroutineMock as AsyncMock import pytest diff --git a/tests/v16/conftest.py b/tests/v16/conftest.py index 67dea686f..a8dfc365f 100644 --- a/tests/v16/conftest.py +++ b/tests/v16/conftest.py @@ -1,4 +1,9 @@ -from unittest.mock import AsyncMock +try: + from unittest.mock import AsyncMock +except ImportError: + # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence, + # we need to resolve to a package on pypi. + from asynctest import CoroutineMock as AsyncMock import pytest diff --git a/tests/v201/conftest.py b/tests/v201/conftest.py index 97dd2b9dd..ca71fc5b3 100644 --- a/tests/v201/conftest.py +++ b/tests/v201/conftest.py @@ -1,4 +1,9 @@ -from unittest.mock import AsyncMock +try: + from unittest.mock import AsyncMock +except ImportError: + # Python 3.7 and below don't include unittest.mock.AsyncMock. Hence, + # we need to resolve to a package on pypi. + from asynctest import CoroutineMock as AsyncMock import pytest From c4d96d9e876d630fee80153a8ef3c3ddaed8d8dd Mon Sep 17 00:00:00 2001 From: Jared-Newell-Mobility <119603687+Jared-Newell-Mobility@users.noreply.github.com> Date: Wed, 7 Feb 2024 13:51:26 +0100 Subject: [PATCH 08/10] OCPP 2.0.1 Wrong data type in CostUpdated total_cost (#596) see issue https://github.com/mobilityhouse/ocpp/issues/557 --- CHANGELOG.md | 1 + ocpp/v201/call.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 149f2876b..4a476590a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Change log +- [#557](https://github.com/mobilityhouse/ocpp/issues/557) OCPP 2.0.1 Wrong data type in CostUpdated total_cost - [#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/v201/call.py b/ocpp/v201/call.py index 461f37365..ddc681606 100644 --- a/ocpp/v201/call.py +++ b/ocpp/v201/call.py @@ -71,7 +71,7 @@ class ClearedChargingLimit: @dataclass class CostUpdated: - total_cost: int + total_cost: float transaction_id: str custom_data: Optional[Dict[str, Any]] = None From ea5f8c1451f5d15907b40dba8efc7cba16a48d74 Mon Sep 17 00:00:00 2001 From: Jared-Newell-Mobility <119603687+Jared-Newell-Mobility@users.noreply.github.com> Date: Wed, 7 Feb 2024 13:54:34 +0100 Subject: [PATCH 09/10] Update tests to use Call and CallResult without the suffix Payload (#595) See issue https://github.com/mobilityhouse/ocpp/issues/593 --- CHANGELOG.md | 1 + ocpp/charge_point.py | 7 ++++++- tests/test_charge_point.py | 30 ++++++++++------------------ tests/v16/conftest.py | 2 +- tests/v16/test_v16_charge_point.py | 14 ++++++------- tests/v201/conftest.py | 2 +- tests/v201/test_v201_charge_point.py | 2 +- 7 files changed, 28 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a476590a..a56837bca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - [#557](https://github.com/mobilityhouse/ocpp/issues/557) OCPP 2.0.1 Wrong data type in CostUpdated total_cost - [#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' +- [#593](https://github.com/mobilityhouse/ocpp/issues/593) Update tests to use Call and CallResult without the suffix Payload ## 0.26.0 (2024-01-17) diff --git a/ocpp/charge_point.py b/ocpp/charge_point.py index 4d7cb9676..0e9337558 100644 --- a/ocpp/charge_point.py +++ b/ocpp/charge_point.py @@ -311,9 +311,14 @@ async def call(self, payload, suppress=True, unique_id=None): unique_id if unique_id is not None else str(self._unique_id_generator()) ) + action_name = payload.__class__.__name__ + # Due to deprecated call and callresults, remove in the future. + if "Payload" in payload.__class__.__name__: + action_name = payload.__class__.__name__[:-7] + call = Call( unique_id=unique_id, - action=payload.__class__.__name__[:-7], + action=action_name, payload=remove_nones(camel_case_payload), ) diff --git a/tests/test_charge_point.py b/tests/test_charge_point.py index 897fabc2b..cefcb1860 100644 --- a/tests/test_charge_point.py +++ b/tests/test_charge_point.py @@ -6,18 +6,12 @@ from ocpp.messages import Call from ocpp.routing import after, create_route_map, on from ocpp.v16 import ChargePoint as cp_16 -from ocpp.v16.call import ( - BootNotificationPayload, - GetConfigurationPayload, - MeterValuesPayload, -) -from ocpp.v16.call_result import ( - BootNotificationPayload as BootNotificationResultPayload, -) +from ocpp.v16.call import BootNotification, GetConfiguration, MeterValues +from ocpp.v16.call_result import BootNotification as BootNotificationResult from ocpp.v16.datatypes import MeterValue, SampledValue from ocpp.v16.enums import Action, RegistrationStatus from ocpp.v20 import ChargePoint as cp_20 -from ocpp.v201.call import SetNetworkProfilePayload +from ocpp.v201.call import SetNetworkProfile from ocpp.v201.datatypes import NetworkConnectionProfileType from ocpp.v201.enums import OCPPInterfaceType, OCPPTransportType, OCPPVersionType @@ -82,7 +76,7 @@ def test_snake_to_camel_case(test_input, expected): def test_remove_nones(): expected_payload = {"charge_point_model": "foo", "charge_point_vendor": "bar"} - payload = BootNotificationPayload( + payload = BootNotification( charge_point_model="foo", charge_point_vendor="bar", charge_box_serial_number=None, @@ -116,9 +110,7 @@ def test_nested_remove_nones(): apn=None, ) - payload = SetNetworkProfilePayload( - configuration_slot=1, connection_data=connection_data - ) + payload = SetNetworkProfile(configuration_slot=1, connection_data=connection_data) payload = asdict(payload) assert expected_payload == remove_nones(payload) @@ -168,7 +160,7 @@ def test_nested_list_remove_nones(): "transaction_id": 5, } - payload = MeterValuesPayload( + payload = MeterValues( connector_id=3, meter_value=[ MeterValue( @@ -231,7 +223,7 @@ def test_remove_nones_with_list_of_strings(): https://github.com/mobilityhouse/ocpp/issues/289. """ payload = asdict( - GetConfigurationPayload(key=["ClockAlignedDataInterval", "ConnectionTimeOut"]) + GetConfiguration(key=["ClockAlignedDataInterval", "ConnectionTimeOut"]) ) assert remove_nones(payload) == { @@ -274,7 +266,7 @@ def on_boot_notification(self, *args, **kwargs): assert kwargs == camel_to_snake_case(payload_a) assert args == () ChargerA.on_boot_notification_call_count += 1 - return BootNotificationResultPayload( + return BootNotificationResult( current_time="foo", interval=1, status=RegistrationStatus.accepted ) @@ -285,7 +277,7 @@ def after_boot_notification(self, call_unique_id, *args, **kwargs): # call_unique_id should not be passed as arg assert args == () ChargerA.after_boot_notification_call_count += 1 - return BootNotificationResultPayload( + return BootNotificationResult( current_time="foo", interval=1, status=RegistrationStatus.accepted ) @@ -300,7 +292,7 @@ def on_boot_notification(self, call_unique_id, *args, **kwargs): # call_unique_id should not be passed as arg assert args == () ChargerB.on_boot_notification_call_count += 1 - return BootNotificationResultPayload( + return BootNotificationResult( current_time="foo", interval=1, status=RegistrationStatus.accepted ) @@ -310,7 +302,7 @@ def after_boot_notification(self, *args, **kwargs): assert kwargs == camel_to_snake_case(payload_b) assert args == () ChargerB.after_boot_notification_call_count += 1 - return BootNotificationResultPayload( + return BootNotificationResult( current_time="foo", interval=1, status=RegistrationStatus.accepted ) diff --git a/tests/v16/conftest.py b/tests/v16/conftest.py index a8dfc365f..b70711ce3 100644 --- a/tests/v16/conftest.py +++ b/tests/v16/conftest.py @@ -49,7 +49,7 @@ def base_central_system(connection): @pytest.fixture def mock_boot_request(): - return call.BootNotificationPayload( + return call.BootNotification( charge_point_vendor="dummy_vendor", charge_point_model="dummy_model", ) diff --git a/tests/v16/test_v16_charge_point.py b/tests/v16/test_v16_charge_point.py index 9d07acf23..37d8d8e3c 100644 --- a/tests/v16/test_v16_charge_point.py +++ b/tests/v16/test_v16_charge_point.py @@ -26,7 +26,7 @@ def on_boot_notification(charge_point_model, charge_point_vendor, **kwargs): # assert charge_point_model == "ICU Eve Mini" assert kwargs["firmware_version"] == "#1:3.4.0-2990#N:217H;1.0-223" - return call_result.BootNotificationPayload( + return call_result.BootNotification( current_time="2018-05-29T17:37:05.495259", interval=350, status="Accepted", @@ -66,7 +66,7 @@ async def test_route_message_without_validation(base_central_system): def on_boot_notification(**kwargs): # noqa assert kwargs["firmware_version"] == "#1:3.4.0-2990#N:217H;1.0-223" - return call_result.BootNotificationPayload( + return call_result.BootNotification( current_time="2018-05-29T17:37:05.495259", interval=350, # 'Yolo' is not a valid value for for field status. @@ -120,7 +120,7 @@ async def test_route_message_not_supported(base_central_system, not_supported_ca def on_boot_notification(**kwargs): # noqa assert kwargs["firmware_version"] == "#1:3.4.0-2990#N:217H;1.0-223" - return call_result.BootNotificationPayload( + return call_result.BootNotification( current_time="2018-05-29T17:37:05.495259", interval=350, # 'Yolo' is not a valid value for for field status. @@ -174,7 +174,7 @@ async def test_route_message_with_no_route(base_central_system, heartbeat_call): async def test_send_call_with_timeout(connection): cs = ChargePoint(id=1234, connection=connection, response_timeout=0.1) - payload = call.ResetPayload(type="Hard") + payload = call.Reset(type="Hard") with pytest.raises(asyncio.TimeoutError): await cs.call(payload) @@ -187,7 +187,7 @@ async def test_send_call_with_timeout(connection): @pytest.mark.asyncio async def test_send_invalid_call(base_central_system): - payload = call.ResetPayload(type="Medium") + payload = call.Reset(type="Medium") with pytest.raises(FormatViolationError): await base_central_system.call(payload) @@ -207,7 +207,7 @@ async def test_raise_call_error(base_central_system): ) await base_central_system.route_message(call_error.to_json()) - payload = call.ClearCachePayload() + payload = call.ClearCache() with pytest.raises(GenericError): await base_central_system.call(payload, suppress=False) @@ -226,7 +226,7 @@ async def test_suppress_call_error(base_central_system): ) await base_central_system.route_message(call_error.to_json()) - payload = call.ClearCachePayload() + payload = call.ClearCache() await base_central_system.call(payload) diff --git a/tests/v201/conftest.py b/tests/v201/conftest.py index ca71fc5b3..42fc4ae86 100644 --- a/tests/v201/conftest.py +++ b/tests/v201/conftest.py @@ -48,7 +48,7 @@ def base_central_system(connection): @pytest.fixture def mock_boot_request(): - return call.BootNotificationPayload( + return call.BootNotification( reason="PowerUp", charging_station=chargingStation, ) diff --git a/tests/v201/test_v201_charge_point.py b/tests/v201/test_v201_charge_point.py index ddbd33808..ba32e7f24 100644 --- a/tests/v201/test_v201_charge_point.py +++ b/tests/v201/test_v201_charge_point.py @@ -24,7 +24,7 @@ def on_boot_notification(reason, charging_station, **kwargs): "model": "ICU Eve Mini", } - return call_result.BootNotificationPayload( + return call_result.BootNotification( current_time="2018-05-29T17:37:05.495259", interval=350, status="Accepted", From 324abdd711f6d1272ff0e5b090892a1254796a7c Mon Sep 17 00:00:00 2001 From: Jared-Newell-Mobility <119603687+Jared-Newell-Mobility@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:01:56 +0100 Subject: [PATCH 10/10] Fix camel_to_snake_case for "v2x" (#594) see issue https://github.com/mobilityhouse/ocpp/issues/591 --- CHANGELOG.md | 1 + ocpp/charge_point.py | 1 + tests/test_charge_point.py | 2 ++ 3 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a56837bca..bdbdd26d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - [#557](https://github.com/mobilityhouse/ocpp/issues/557) OCPP 2.0.1 Wrong data type in CostUpdated total_cost - [#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' +- [#591](https://github.com/mobilityhouse/ocpp/issues/591) Camel_to_snake_case doesn't handle v2x correctly - [#593](https://github.com/mobilityhouse/ocpp/issues/593) Update tests to use Call and CallResult without the suffix Payload ## 0.26.0 (2024-01-17) diff --git a/ocpp/charge_point.py b/ocpp/charge_point.py index 0e9337558..3b985df0d 100644 --- a/ocpp/charge_point.py +++ b/ocpp/charge_point.py @@ -25,6 +25,7 @@ def camel_to_snake_case(data): if isinstance(data, dict): snake_case_dict = {} for key, value in data.items(): + key = key.replace("V2X", "_v2x") s1 = re.sub("(.)([A-Z][a-z]+)", r"\1_\2", key) key = re.sub("([a-z0-9])([A-Z])(?=\\S)", r"\1_\2", s1).lower() diff --git a/tests/test_charge_point.py b/tests/test_charge_point.py index cefcb1860..87052b1e9 100644 --- a/tests/test_charge_point.py +++ b/tests/test_charge_point.py @@ -52,6 +52,8 @@ def heartbeat(self, **kwargs): [ ({"transactionId": "74563478"}, {"transaction_id": "74563478"}), ({"fullSoC": 100}, {"full_soc": 100}), + ({"evMinV2XEnergyRequest": 200}, {"ev_min_v2x_energy_request": 200}), + ({"v2xChargingCtrlr": 200}, {"v2x_charging_ctrlr": 200}), ], ) def test_camel_to_snake_case(test_input, expected):