Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Commit

Permalink
Merge pull request #2777 from sap-labs-france/Smart-Charging---remove…
Browse files Browse the repository at this point in the history
…d-reset-static-limit-+-current-limit-bug

Smart Charging - Remove static limit reset + fix current limit bug
  • Loading branch information
LucasBrazi06 authored Sep 3, 2021
2 parents 58d1cb7 + cc76544 commit cc7cf82
Showing 1 changed file with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,34 +304,15 @@ export default abstract class ChargingStationVendorIntegration {
});
results.push(ret);
}
// Reapply the current limitation
for (const chargePoint of chargingStation.chargePoints) {
await this.setStaticPowerLimitation(tenant, chargingStation, chargePoint,
this.getStaticPowerLimitation(chargingStation, chargePoint));
}
return results;
}
// Reapply the current limitation
if (result.status === OCPPClearChargingProfileStatus.ACCEPTED) {
for (const chargePoint of chargingStation.chargePoints) {
await this.setStaticPowerLimitation(tenant, chargingStation, chargePoint,
this.getStaticPowerLimitation(chargingStation, chargePoint));
}
}
return result;
}
// Connector ID > 0
// Clear the Profile
const result = await chargingStationClient.clearChargingProfile({
connectorId: chargingProfile.connectorID
});
// Reapply the current limitation
if (result.status === OCPPClearChargingProfileStatus.ACCEPTED) {
for (const chargePoint of chargingStation.chargePoints) {
await this.setStaticPowerLimitation(tenant, chargingStation, chargePoint,
this.getStaticPowerLimitation(chargingStation, chargePoint));
}
}
return result;
} catch (error) {
await Logging.logError({
Expand Down Expand Up @@ -654,6 +635,8 @@ export default abstract class ChargingStationVendorIntegration {
if (moment(chargingSchedule.startSchedule).isAfter(now)) {
chargingSchedule.startSchedule.setDate(currentDate.getDate() - 1);
}
} else if (moment(chargingSchedule.startSchedule).isAfter(now)) {
return null;
}
// Check if the Charging Profile is active
if (moment(chargingSchedule.startSchedule).add(chargingSchedule.duration, 's').isAfter(now)) {
Expand Down

0 comments on commit cc7cf82

Please sign in to comment.