Trigger smart charging when site area is updated
MODIFY
src/server/rest/service/SiteAreaService.ts
src/server/rest/service/SiteAreaService.ts
@@ -307,7 +307,6 @@ export default class SiteAreaService {
siteArea.name = filteredRequest.name;
siteArea.address = filteredRequest.address;
siteArea.image = filteredRequest.image;
- const siteAreaMaxPowerHasChanged = siteArea.maximumPower !== filteredRequest.maximumPower;
siteArea.maximumPower = filteredRequest.maximumPower;
siteArea.voltage = filteredRequest.voltage;
if (filteredRequest.smartCharging && filteredRequest.numberOfPhases === 1) {
@@ -341,7 +340,7 @@ export default class SiteAreaService {
// Update Site Area
await SiteAreaStorage.saveSiteArea(req.user.tenantID, siteArea, true);
// Regtrigger Smart Charging
- if (siteAreaMaxPowerHasChanged && filteredRequest.smartCharging) {
+ if (filteredRequest.smartCharging) {
// eslint-disable-next-line @typescript-eslint/no-misused-promises
setTimeout(async () => {
const siteAreaLock = await LockingHelper.createAndAquireExclusiveLockForSiteArea(req.user.tenantID, siteArea);

Trigger smart charging when site area is updated