Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Use camel case for feature profiles
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
  • Loading branch information
Jérôme Benoit committed Mar 30, 2022
1 parent 68cb8b9 commit b22787b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/charging-station/ChargingStation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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');
Expand Down
16 changes: 8 additions & 8 deletions src/charging-station/ocpp/1.6/OCPP16IncomingRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down Expand Up @@ -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`
Expand Down
8 changes: 4 additions & 4 deletions src/types/ocpp/1.6/Configuration.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit b22787b

Please sign in to comment.