From b22787b4c007f73464575409dea8d6a19810c723 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 30 Mar 2022 10:52:01 +0200 Subject: [PATCH] Use camel case for feature profiles MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 4 ++-- .../ocpp/1.6/OCPP16IncomingRequestService.ts | 16 ++++++++-------- src/types/ocpp/1.6/Configuration.ts | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index bf7943f5..4d08d493 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1236,7 +1236,7 @@ export default class ChargingStation { if (!this.getConfigurationKey(StandardParametersKey.SupportedFeatureProfiles)) { this.addConfigurationKey( StandardParametersKey.SupportedFeatureProfiles, - `${SupportedFeatureProfiles.Core},${SupportedFeatureProfiles.Firmware_Management},${SupportedFeatureProfiles.Local_Auth_List_Management},${SupportedFeatureProfiles.Smart_Charging},${SupportedFeatureProfiles.Remote_Trigger}` + `${SupportedFeatureProfiles.Core},${SupportedFeatureProfiles.FirmwareManagement},${SupportedFeatureProfiles.LocalAuthListManagement},${SupportedFeatureProfiles.SmartCharging},${SupportedFeatureProfiles.RemoteTrigger}` ); } this.addConfigurationKey( @@ -1277,7 +1277,7 @@ export default class ChargingStation { if ( !this.getConfigurationKey(StandardParametersKey.LocalAuthListEnabled) && this.getConfigurationKey(StandardParametersKey.SupportedFeatureProfiles)?.value.includes( - SupportedFeatureProfiles.Local_Auth_List_Management + SupportedFeatureProfiles.LocalAuthListManagement ) ) { this.addConfigurationKey(StandardParametersKey.LocalAuthListEnabled, 'false'); diff --git a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts index a9aaab79..937edd41 100644 --- a/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts @@ -381,10 +381,10 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer private handleRequestSetChargingProfile( commandPayload: SetChargingProfileRequest ): SetChargingProfileResponse { - if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.Smart_Charging)) { + if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.SmartCharging)) { logger.error( `${this.chargingStation.logPrefix()} Trying to set charging profile(s) without '${ - OCPP16SupportedFeatureProfiles.Smart_Charging + OCPP16SupportedFeatureProfiles.SmartCharging }' feature enabled in ${ OCPP16StandardParametersKey.SupportedFeatureProfiles } in configuration` @@ -430,10 +430,10 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer private handleRequestClearChargingProfile( commandPayload: ClearChargingProfileRequest ): ClearChargingProfileResponse { - if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.Smart_Charging)) { + if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.SmartCharging)) { logger.error( `${this.chargingStation.logPrefix()} Trying to clear charging profile(s) without '${ - OCPP16SupportedFeatureProfiles.Smart_Charging + OCPP16SupportedFeatureProfiles.SmartCharging }' feature enabled in ${ OCPP16StandardParametersKey.SupportedFeatureProfiles } in configuration` @@ -828,11 +828,11 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer commandPayload: GetDiagnosticsRequest ): Promise { if ( - !this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.Firmware_Management) + !this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.FirmwareManagement) ) { logger.error( `${this.chargingStation.logPrefix()} Trying to get diagnostics without '${ - OCPP16SupportedFeatureProfiles.Firmware_Management + OCPP16SupportedFeatureProfiles.FirmwareManagement }' feature enabled in ${ OCPP16StandardParametersKey.SupportedFeatureProfiles } in configuration` @@ -946,10 +946,10 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer private handleRequestTriggerMessage( commandPayload: OCPP16TriggerMessageRequest ): OCPP16TriggerMessageResponse { - if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.Remote_Trigger)) { + if (!this.chargingStation.hasFeatureProfile(OCPP16SupportedFeatureProfiles.RemoteTrigger)) { logger.error( `${this.chargingStation.logPrefix()} Trying to remote trigger message without '${ - OCPP16SupportedFeatureProfiles.Remote_Trigger + OCPP16SupportedFeatureProfiles.RemoteTrigger }' feature enabled in ${ OCPP16StandardParametersKey.SupportedFeatureProfiles } in configuration` diff --git a/src/types/ocpp/1.6/Configuration.ts b/src/types/ocpp/1.6/Configuration.ts index 8e4f58fe..8888dd45 100644 --- a/src/types/ocpp/1.6/Configuration.ts +++ b/src/types/ocpp/1.6/Configuration.ts @@ -1,10 +1,10 @@ export enum OCPP16SupportedFeatureProfiles { Core = 'Core', - Firmware_Management = 'FirmwareManagement', - Local_Auth_List_Management = 'LocalAuthListManagement', + FirmwareManagement = 'FirmwareManagement', + LocalAuthListManagement = 'LocalAuthListManagement', Reservation = 'Reservation', - Smart_Charging = 'SmartCharging', - Remote_Trigger = 'RemoteTrigger', + SmartCharging = 'SmartCharging', + RemoteTrigger = 'RemoteTrigger', } export enum OCPP16StandardParametersKey { -- 2.34.1