From cc765441aaae8f69d71c11d4969a14587c0735d3 Mon Sep 17 00:00:00 2001 From: OliveGerste <33114317+OliveGerste@users.noreply.github.com> Date: Fri, 3 Sep 2021 14:13:17 +0200 Subject: [PATCH] Removed static limit reset + current limit bug --- .../ChargingStationVendorIntegration.ts | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts b/src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts index 9e0180aa44..41c27b94b7 100644 --- a/src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts +++ b/src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts @@ -304,20 +304,8 @@ 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 @@ -325,13 +313,6 @@ export default abstract class ChargingStationVendorIntegration { 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({ @@ -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)) {