Fixed vendor integration issues
MODIFY
src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts
src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts
@@ -669,15 +669,19 @@ export default abstract class ChargingStationVendorIntegration {
if (!chargingSchedule) {
return chargingSchedule;
}
+ chargingSchedule['durationMins'] = Math.round(chargingSchedule.duration / 60);
if (chargingSchedule.chargingSchedulePeriod) {
for (const chargingSchedulePeriod of chargingSchedule.chargingSchedulePeriod) {
+ chargingSchedulePeriod['startPeriodMins'] = Math.round(chargingSchedulePeriod.startPeriod / 60);
// Convert to Amps for all phases
if (chargingSchedule.chargingRateUnit === ChargingRateUnitType.WATT) {
+ chargingSchedulePeriod['limitWatts'] = chargingSchedulePeriod.limit;
chargingSchedulePeriod.limit = Utils.convertWattToAmp(chargingStation, connectorID, chargingSchedulePeriod.limit);
}
// Limit is per connector and per phase Convert to max Amp
chargingSchedulePeriod.limit = this.convertLimitAmpToAllPhases(
chargingStation, chargePoint, connectorID, chargingSchedulePeriod.limit);
+ chargingSchedulePeriod['limitWatts'] = Utils.convertAmpToWatt(chargingStation, connectorID, chargingSchedulePeriod.limit);
}
}
// Convert to Amps?

MODIFY
src/server/rest/service/ChargingStationService.ts
src/server/rest/service/ChargingStationService.ts
@@ -381,7 +381,6 @@ export default class ChargingStationService {
public static async handleGetChargingProfiles(action: ServerAction, req: Request, res: Response, next: NextFunction): Promise<void> {
// Filter
const filteredRequest = ChargingStationSecurity.filterChargingStationProfilesRequest(req.query);
- // Check
UtilsService.assertIdIsProvided(action, filteredRequest.ChargeBoxID, MODULE_NAME, 'handleGetChargingProfiles', req.user);
// Check auth
if (!Authorizations.canReadChargingStation(req.user)) {

MODIFY
src/storage/mongodb/ChargingStationStorage.ts
src/storage/mongodb/ChargingStationStorage.ts
@@ -816,6 +816,7 @@ export default class ChargingStationStorage {
_id: chargingProfileFilter._id,
chargingStationID: chargingProfileToSave.chargingStationID,
connectorID: Utils.convertToInt(chargingProfileToSave.connectorID),
+ chargePointID: Utils.convertToInt(chargingProfileToSave.chargePointID),
profile: chargingProfileToSave.profile
};
await global.database.getCollection<any>(tenantID, 'chargingprofiles').findOneAndUpdate(

Fixed vendor integration issues