Flag to exclude asset from smart charging
MODIFY
src/server/rest/v1/service/AssetService.ts
src/server/rest/v1/service/AssetService.ts
@@ -387,6 +387,7 @@ export default class AssetService {
name: filteredRequest.name,
siteAreaID: filteredRequest.siteAreaID,
assetType: filteredRequest.assetType,
+ excludeFromSmartCharging: filteredRequest.excludeFromSmartCharging,
fluctuationPercent: filteredRequest.fluctuationPercent,
staticValueWatt: filteredRequest.staticValueWatt,
coordinates: filteredRequest.coordinates,
@@ -446,6 +447,7 @@ export default class AssetService {
asset.name = filteredRequest.name;
asset.siteAreaID = filteredRequest.siteAreaID;
asset.assetType = filteredRequest.assetType;
+ asset.excludeFromSmartCharging = filteredRequest.excludeFromSmartCharging;
asset.fluctuationPercent = filteredRequest.fluctuationPercent;
asset.staticValueWatt = filteredRequest.staticValueWatt;
asset.coordinates = filteredRequest.coordinates;

MODIFY
src/server/rest/v1/service/security/AssetSecurity.ts
src/server/rest/v1/service/security/AssetSecurity.ts
@@ -63,6 +63,7 @@ export default class AssetSecurity {
filteredRequest.name = sanitize(request.name),
filteredRequest.siteAreaID = sanitize(request.siteAreaID),
filteredRequest.assetType = sanitize(request.assetType),
+ filteredRequest.excludeFromSmartCharging = sanitize(request.excludeFromSmartCharging);
filteredRequest.fluctuationPercent = sanitize(request.fluctuationPercent),
filteredRequest.staticValueWatt = sanitize(request.staticValueWatt),
filteredRequest.image = request.image;

MODIFY
src/storage/mongodb/AssetStorage.ts
src/storage/mongodb/AssetStorage.ts
@@ -51,6 +51,7 @@ export default class AssetStorage {
coordinates: Utils.containsGPSCoordinates(assetToSave.coordinates) ? assetToSave.coordinates.map(
(coordinate) => Utils.convertToFloat(coordinate)) : [],
assetType: assetToSave.assetType,
+ excludeFromSmartCharging: Utils.convertToBoolean(assetToSave.excludeFromSmartCharging),
fluctuationPercent: Utils.convertToFloat(assetToSave.fluctuationPercent),
staticValueWatt: Utils.convertToFloat(assetToSave.staticValueWatt),
dynamicAsset: assetToSave.dynamicAsset,

MODIFY
src/types/Asset.ts
src/types/Asset.ts
@@ -18,6 +18,7 @@ export default interface Asset extends CreatedUpdatedProps, AbstractCurrentConsu
connectionID?: string;
meterID?: string;
values: Consumption[],
+ excludeFromSmartCharging?: boolean,
}
export enum AssetType {

Flag to exclude asset from smart charging