result1, result2, result3
MODIFY
src/server/rest/v1/service/ChargingStationService.ts
src/server/rest/v1/service/ChargingStationService.ts
@@ -463,15 +463,15 @@ export default class ChargingStationService {
}
}
// Call the limitation
- const result = await chargingStationVendor.setStaticPowerLimitation(req.tenant, chargingStation,
+ const result1 = await chargingStationVendor.setStaticPowerLimitation(req.tenant, chargingStation,
chargePoint, filteredRequest.ampLimitValue);
- if (result.status !== OCPPConfigurationStatus.ACCEPTED && result.status !== OCPPConfigurationStatus.REBOOT_REQUIRED) {
+ if (result1.status !== OCPPConfigurationStatus.ACCEPTED && result1.status !== OCPPConfigurationStatus.REBOOT_REQUIRED) {
throw new AppError({
source: chargingStation.id,
action: action,
errorCode: HTTPError.LIMIT_POWER_ERROR,
module: MODULE_NAME, method: 'handleChargingStationLimitPower',
- message: `Cannot limit the charger's power to ${filteredRequest.ampLimitValue}A: '${result.status}'`,
+ message: `Cannot limit the charger's power to ${filteredRequest.ampLimitValue}A: '${result1.status}'`,
detailedMessages: { result },
user: req.user
});
@@ -489,7 +489,7 @@ export default class ChargingStationService {
message: `The charger's power limit has been successfully set to ${filteredRequest.ampLimitValue}A`,
detailedMessages: { result }
});
- res.json({ status: result.status });
+ res.json({ status: result1.status });
next();
}
@@ -770,11 +770,11 @@ export default class ChargingStationService {
UtilsService.assertObjectExists(action, chargingStation, `Charging Station ID '${filteredRequest.chargingStationID}' does not exist`,
MODULE_NAME, 'handleRequestChargingStationOcppParameters', req.user);
// Get the configuration
- let result = await OCPPUtils.requestAndSaveChargingStationOcppParameters(req.tenant, chargingStation);
+ let result2 = await OCPPUtils.requestAndSaveChargingStationOcppParameters(req.tenant, chargingStation);
if (filteredRequest.forceUpdateOCPPParamsFromTemplate) {
- result = await OCPPUtils.updateChargingStationOcppParametersWithTemplate(req.tenant, chargingStation);
+ result2 = await OCPPUtils.updateChargingStationOcppParametersWithTemplate(req.tenant, chargingStation);
}
- res.json(result);
+ res.json(result2);
next();
}
@@ -1713,23 +1713,23 @@ export default class ChargingStationService {
});
}
// Get composite schedule
- let result: any;
+ let result3: any;
if (filteredRequest.args.connectorId === 0) {
- result = [] as OCPPGetCompositeScheduleCommandResult[];
+ result3 = [] as OCPPGetCompositeScheduleCommandResult[];
for (const connector of chargingStation.connectors) {
// Connector ID > 0
const chargePoint = Utils.getChargePointFromID(chargingStation, connector.chargePointID);
- result.push(await chargingStationVendor.getCompositeSchedule(
+ result3.push(await chargingStationVendor.getCompositeSchedule(
req.tenant, chargingStation, chargePoint, connector.connectorId, filteredRequest.args.duration, filteredRequest.args.chargingRateUnit));
}
} else {
// Connector ID > 0
const connector = Utils.getConnectorFromID(chargingStation, filteredRequest.args.connectorId);
const chargePoint = Utils.getChargePointFromID(chargingStation, connector?.chargePointID);
- result = await chargingStationVendor.getCompositeSchedule(
+ result3 = await chargingStationVendor.getCompositeSchedule(
req.tenant, chargingStation, chargePoint, filteredRequest.args.connectorId, filteredRequest.args.duration, filteredRequest.args.chargingRateUnit);
}
- return result;
+ return result3;
}
private static async executeChargingStationStartTransaction(action: ServerAction, chargingStation: ChargingStation, command: Command,
@@ -1860,15 +1860,15 @@ export default class ChargingStationService {
filteredRequest: HttpChargingStationChangeConfigurationRequest, req: Request, res: Response, next: NextFunction,
chargingStationClient: ChargingStationClient): Promise<OCPPChangeConfigurationCommandResult> {
// Change the config
- const result = await chargingStationClient.changeConfiguration({
+ const result4 = await chargingStationClient.changeConfiguration({
key: filteredRequest.args.key,
value: filteredRequest.args.value
});
// Check
- if (result.status === OCPPConfigurationStatus.ACCEPTED ||
- result.status === OCPPConfigurationStatus.REBOOT_REQUIRED) {
+ if (result4.status === OCPPConfigurationStatus.ACCEPTED ||
+ result4.status === OCPPConfigurationStatus.REBOOT_REQUIRED) {
// Reboot?
- if (result.status === OCPPConfigurationStatus.REBOOT_REQUIRED) {
+ if (result4.status === OCPPConfigurationStatus.REBOOT_REQUIRED) {
await Logging.logWarning({
tenantID: req.tenant.id,
siteID: chargingStation.siteID,
@@ -1881,7 +1881,7 @@ export default class ChargingStationService {
module: MODULE_NAME, method: 'handleChargingStationCommand',
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
message: `Reboot is required due to change of OCPP Parameter '${filteredRequest.args.key}' to '${filteredRequest.args.value}'`,
- detailedMessages: { result }
+ detailedMessages: { result4 }
});
}
// Custom param?
@@ -1923,6 +1923,6 @@ export default class ChargingStationService {
await chargingStationVendor.checkUpdateOfOCPPParams(req.tenant, chargingStation, filteredRequest.args.key, filteredRequest.args.value);
}
}
- return result;
+ return result4;
}
}

result1, result2, result3