Fixed OCPP Change Availability
MODIFY
src/assets/server/rest/v1/docs/e-mobility-oas.json
src/assets/server/rest/v1/docs/e-mobility-oas.json
"properties": {
"location": {
"type": "string",
+ "description": "Required. This contains a string containing a URI pointing to a location from which to retrieve the firmware.",
"example": ""
},
"retries": {
"type": "integer",
"minimum": 1,
+ "description": "Optional. This specifies how many times Charge Point must try to download the firmware before giving up. If this field is not present, it is left to Charge Point to decide how many times it wants to retry.",
"example": 1
},
"retrieveDate": {
"type": "string",
+ "description": "Required. This contains the date and time after which the Charge Point is allowed to retrieve the (new) firmware.",
"format": "date-time"
},
"retryInterval": {
"type": "integer",
+ "description": "Optional. The interval in seconds after which a retry may be attempted. If this field is not present, it is left to Charge Point to decide how long to wait between attempts.",
"minimum": 1,
"example": 5
}
- }
- }
},
"required": [
"location",
"retrieveDate"
]
}
+ },
+ "required": [
+ "args"
+ ]
+ }
}
}
},
}
}
},
- "/api/chargingstations/general/availability": {
- "put": {
+ "/api/chargingstations/availability/change": {
+ "post": {
"security": [
{
"bearerAuth": []
"application/json": {
"schema": {
"type": "object",
- "required": [
- "chargeBoxID",
- "location",
- "retrieveDate"
- ],
"properties": {
"chargeBoxID": {
- "type": "string"
+ "type": "string",
+ "example": ""
},
+ "args": {
+ "type": "object",
+ "properties": {
"connectorId": {
"type": "integer",
- "minimum": 1
+ "description": "Required. The id of the connector for which availability needs to change. Id '0' (zero) is used if the availability of the Charge Point and all its connectors needs to change.",
+ "minimum": 0,
+ "example": 1
},
"type": {
- "type": "string"
- }
+ "type": "string",
+ "example": "Operative",
+ "description": "Required. This contains the type of availability change that the Charge Point should perform.",
+ "enum": [
+ "Inoperative",
+ "Operative"
+ ]
}
},
- "examples": {
- "operative": {
- "summary": "Operative",
- "value": {
- "chargeBoxID": "SAP-Mougins-03",
- "connectorId": 1,
- "type": "Operative"
+ "required": [
+ "connectorId",
+ "type"
+ ]
}
},
- "inoperative": {
- "summary": "Inoperative",
- "value": {
- "chargeBoxID": "SAP-Mougins-03",
- "connectorId": 1,
- "type": "Inoperative"
- }
- }
+ "required": [
+ "args"
+ ]
}
}
}

MODIFY
src/server/rest/v1/router/api/ChargingStationRouter.ts
src/server/rest/v1/router/api/ChargingStationRouter.ts
@@ -119,7 +119,7 @@ export default class ChargingStationRouter {
}
protected buildRouteChargingStationChangeAvailability(): void {
- this.router.post(`/${ServerRoute.REST_CHARGING_STATIONS_AVAILABILITY}`, async (req: Request, res: Response, next: NextFunction) => {
+ this.router.post(`/${ServerRoute.REST_CHARGING_STATIONS_CHANGE_AVAILABILITY}`, async (req: Request, res: Response, next: NextFunction) => {
await RouterUtils.handleServerAction(ChargingStationService.handleAction.bind(this), ServerAction.CHARGING_STATION_CHANGE_AVAILABILITY, req, res, next);
});
}

MODIFY
src/types/Server.ts
src/types/Server.ts
@@ -410,7 +410,7 @@ export enum ServerRoute {
REST_CHARGING_STATIONS_GET_COMPOSITE_SCHEDULE = 'chargingstations/compositeschedule',
REST_CHARGING_STATIONS_GET_DIAGNOSTICS = 'chargingstations/diagnostics',
REST_CHARGING_STATIONS_FIRMWARE_UPDATE = 'chargingstations/firmware/update',
- REST_CHARGING_STATIONS_AVAILABILITY = 'chargingstations/general/availability',
+ REST_CHARGING_STATIONS_CHANGE_AVAILABILITY = 'chargingstations/availability/change',
REST_CHARGING_STATIONS_DOWNLOAD_FIRMWARE = 'chargingstations/firmware/:id',
REST_CHARGING_STATIONS_QRCODE_GENERATE = 'chargingstations/:id/connectors/:connectorId/qrcode/generate',

Fixed OCPP Change Availability