Updated AssetType enum
MODIFY
src/integration/asset/greencom/GreencomAssetIntegration.ts
src/integration/asset/greencom/GreencomAssetIntegration.ts
@@ -67,15 +67,15 @@ export default class GreencomAssetIntegration extends AssetIntegration<AssetSett
// Convert data
if (data.power && data.energy) {
switch (asset.assetType) {
- case AssetType.CO:
+ case AssetType.CONSUMPTION:
consumption.currentInstantWatts = data.power.average;
consumption.currentConsumptionWh = data.energy.sum;
break;
- case AssetType.PR:
+ case AssetType.PRODUCTION:
consumption.currentInstantWatts = data.power.average * -1;
consumption.currentConsumptionWh = data.energy.sum * -1;
break;
- case AssetType.CO_PR:
+ case AssetType.CONSUMPTION_AND_PRODUCTION:
consumption.currentInstantWatts = data.power.charge.average - data.power.discharge.average;
consumption.currentConsumptionWh = data.energy.charge.sum - data.energy.discharge.sum;
break;

MODIFY
src/integration/asset/schneider/SchneiderAssetIntegration.ts
src/integration/asset/schneider/SchneiderAssetIntegration.ts
@@ -71,7 +71,7 @@ export default class SchneiderAssetIntegration extends AssetIntegration<AssetSet
value: newConsumptionWh,
timestamp: new Date()
};
- const energyDirection = asset.assetType === AssetType.PR ? -1 : 1;
+ const energyDirection = asset.assetType === AssetType.PRODUCTION ? -1 : 1;
// Amperage
consumption.currentInstantAmpsL1 = this.getPropertyValue(data, SchneiderProperty.AMPERAGE_L1) * energyDirection;
consumption.currentInstantAmpsL2 = this.getPropertyValue(data, SchneiderProperty.AMPERAGE_L2) * energyDirection;

MODIFY
src/types/Asset.ts
src/types/Asset.ts
@@ -21,9 +21,9 @@ export default interface Asset extends CreatedUpdatedProps, AbstractCurrentConsu
}
export enum AssetType {
- CO = 'CO',
- PR = 'PR',
- CO_PR = 'CO-PR',
+ CONSUMPTION = 'CO',
+ PRODUCTION = 'PR',
+ CONSUMPTION_AND_PRODUCTION = 'CO-PR',
}
export enum SchneiderProperty {

Updated AssetType enum