From: Jérôme Benoit Date: Wed, 30 Mar 2022 08:52:01 +0000 (+0200) Subject: Use camel case for feature profiles X-Git-Tag: v1.1.57~21 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=b22787b4c007f73464575409dea8d6a19810c723;p=e-mobility-charging-stations-simulator.git Use camel case for feature profiles Signed-off-by: Jérôme Benoit --- 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 {