split Unlock Connector
ADD
src/assets/server/rest/v1/schemas/chargingstation/chargingstation-action-unlock-connector.json
+{
+ "title": "Unlock Connector",
+ "type": "object",
+ "properties": {
+ "chargingStationID": {
+ "$ref": "chargingstation.json#/definitions/id"
+ },
+ "args": {
+ "type": "object",
+ "properties": {
+ "connectorId": {
+ "$ref": "chargingstation.json#/definitions/connector/properties/connectorId"
+ }
+ },
+ "required": [
+ "connectorId"
+ ]
+ }
+ },
+ "required": [
+ "chargingStationID"
+ ]
+}

MODIFY
src/server/rest/v1/service/ChargingStationService.ts
src/server/rest/v1/service/ChargingStationService.ts
@@ -1219,6 +1219,12 @@ export default class ChargingStationService {
result = await ChargingStationService.executeChargingStationCommand(
req.tenant, req.user, chargingStation, action, command, filteredRequest.args);
break;
+ // Unlock Connector
+ case Command.UNLOCK_CONNECTOR:
+ filteredRequest = ChargingStationValidator.getInstance().validateChargingStationActionUnlockConnectorReq(req.body);
+ result = await ChargingStationService.executeChargingStationCommand(
+ req.tenant, req.user, chargingStation, action, command, filteredRequest.args);
+ break;
// Update Firmware
case Command.UPDATE_FIRMWARE:
filteredRequest = ChargingStationValidator.getInstance().validateChargingStationActionUpdateFirmwareReq(req.body);

MODIFY
src/server/rest/v1/validator/ChargingStationValidator.ts
src/server/rest/v1/validator/ChargingStationValidator.ts
-import { HttpChargingProfilesRequest, HttpChargingStationChangeAvailabilityRequest, HttpChargingStationChangeConfigurationRequest, HttpChargingStationClearCacheRequest, HttpChargingStationCommandDataTransferRequest, HttpChargingStationCommandRequest, HttpChargingStationConnectorRequest, HttpChargingStationGetCompositeScheduleRequest, HttpChargingStationGetDiagnosticsRequest, HttpChargingStationGetFirmwareRequest, HttpChargingStationLimitPowerRequest, HttpChargingStationOcppParametersRequest, HttpChargingStationOcppRequest, HttpChargingStationParamsUpdateRequest, HttpChargingStationRequest, HttpChargingStationResetRequest, HttpChargingStationStartTransactionRequest, HttpChargingStationStopTransactionRequest, HttpChargingStationUpdateFirmwareRequest, HttpChargingStationsInErrorRequest, HttpChargingStationsRequest, HttpDownloadQrCodeRequest, HttpTriggerSmartChargingRequest } from '../../../../types/requests/HttpChargingStationRequest';
+import { HttpChargingProfilesRequest, HttpChargingStationChangeAvailabilityRequest, HttpChargingStationChangeConfigurationRequest, HttpChargingStationClearCacheRequest, HttpChargingStationCommandDataTransferRequest, HttpChargingStationCommandRequest, HttpChargingStationCommandUnlockConnectorRequest, HttpChargingStationConnectorRequest, HttpChargingStationGetCompositeScheduleRequest, HttpChargingStationGetDiagnosticsRequest, HttpChargingStationGetFirmwareRequest, HttpChargingStationLimitPowerRequest, HttpChargingStationOcppParametersRequest, HttpChargingStationOcppRequest, HttpChargingStationParamsUpdateRequest, HttpChargingStationRequest, HttpChargingStationResetRequest, HttpChargingStationStartTransactionRequest, HttpChargingStationStopTransactionRequest, HttpChargingStationUpdateFirmwareRequest, HttpChargingStationsInErrorRequest, HttpChargingStationsRequest, HttpDownloadQrCodeRequest, HttpTriggerSmartChargingRequest } from '../../../../types/requests/HttpChargingStationRequest';
import { ChargingProfile } from '../../../../types/ChargingProfile';
import HttpDatabaseRequest from '../../../../types/requests/HttpDatabaseRequest';
@@ -20,6 +20,7 @@ export default class ChargingStationValidator extends SchemaValidator {
private chargingStationActionStartTransaction: Schema;
private chargingStationActionStopTransaction: Schema;
private chargingStationActionGetCompositeSchedule: Schema;
+ private chargingStationActionUnlockConnector: Schema;
private chargingStationActionUpdateFirmware: Schema;
private chargingStationActionReset: Schema;
private chargingStationQRCodeGenerate: Schema;
@@ -51,6 +52,7 @@ export default class ChargingStationValidator extends SchemaValidator {
this.chargingStationActionStartTransaction = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/chargingstation/chargingstation-action-start-transaction.json`, 'utf8'));
this.chargingStationActionStopTransaction = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/chargingstation/chargingstation-action-stop-transaction.json`, 'utf8'));
this.chargingStationActionGetCompositeSchedule = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/chargingstation/chargingstation-action-get-composite-schedule.json`, 'utf8'));
+ this.chargingStationActionUnlockConnector = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/chargingstation/chargingstation-action-unlock-connector.json`, 'utf8'));
this.chargingStationActionUpdateFirmware = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/chargingstation/chargingstation-action-update-firmware.json`, 'utf8'));
this.chargingStationActionReset = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/chargingstation/chargingstation-action-reset.json`, 'utf8'));
this.chargingStationQRCodeGenerate = JSON.parse(fs.readFileSync(`${global.appRoot}/assets/server/rest/v1/schemas/chargingstation/chargingstation-qrcode-generate.json`, 'utf8'));
@@ -143,6 +145,12 @@ export default class ChargingStationValidator extends SchemaValidator {
return data;
}
+ public validateChargingStationActionUnlockConnectorReq(data: any): HttpChargingStationCommandUnlockConnectorRequest {
+ // Validate schema for Unlock Connector
+ this.validate(this.chargingStationActionUnlockConnector, data);
+ return data;
+ }
+
public validateChargingStationActionUpdateFirmwareReq(data: any): HttpChargingStationUpdateFirmwareRequest {
// Validate schema for Update Firmware
this.validate(this.chargingStationActionUpdateFirmware, data);

MODIFY
src/types/requests/HttpChargingStationRequest.ts
src/types/requests/HttpChargingStationRequest.ts
@@ -167,6 +167,13 @@ export interface HttpChargingStationGetCompositeScheduleRequest {
}
}
+export interface HttpChargingStationCommandUnlockConnectorRequest {
+ chargingStationID: string,
+ args: {
+ connectorId: string
+ }
+}
+
export interface HttpChargingStationUpdateFirmwareRequest {
chargingStationID: string,
args: {

split Unlock Connector