Use camel case for feature profiles
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 30 Mar 2022 08:52:01 +0000 (10:52 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 30 Mar 2022 08:52:01 +0000 (10:52 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts
src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
src/types/ocpp/1.6/Configuration.ts

index bf7943f5e91412c4262216bb5d906828e2ff7f53..4d08d493cc93ebf58db83b8ff1cf068c89f92395 100644 (file)
@@ -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');
index a9aaab7975e0a5645f9de4c7f7b2fdec5673e16e..937edd41cc22000530c000dbba844a2282d4fe8a 100644 (file)
@@ -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<GetDiagnosticsResponse> {
     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`
index 8e4f58fecfa54d121d7c70b7a9ab2f3194109772..8888dd45ddf28fd9d2ac64f4dc048ada9b808ac8 100644 (file)
@@ -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 {