Enhanced Logging
MODIFY
src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts
src/integration/charging-station-vendor/ChargingStationVendorIntegration.ts
@@ -500,7 +500,7 @@ export default abstract class ChargingStationVendorIntegration {
tenantID: tenantID,
source: chargingStation.id,
action: ServerAction.GET_CONNECTOR_CURRENT_LIMIT,
- message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${result.limitSource}'`,
+ message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)}'`,
module: MODULE_NAME, method: 'getCurrentConnectorLimit',
detailedMessages: { result }
});
@@ -534,7 +534,7 @@ export default abstract class ChargingStationVendorIntegration {
tenantID: tenantID,
source: chargingStation.id,
action: ServerAction.GET_CONNECTOR_CURRENT_LIMIT,
- message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${result.limitSource}'`,
+ message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)}'`,
module: MODULE_NAME, method: 'getCurrentConnectorLimit',
detailedMessages: { result }
});
@@ -560,7 +560,7 @@ export default abstract class ChargingStationVendorIntegration {
tenantID: tenantID,
source: chargingStation.id,
action: ServerAction.GET_CONNECTOR_CURRENT_LIMIT,
- message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${result.limitSource}'`,
+ message: `Connector ID '${connectorID}' current limit: ${result.limitAmps} A, ${result.limitWatts} W, source '${Utils.getConnectorLimitSourceString(result.limitSource)}'`,
module: MODULE_NAME, method: 'getCurrentConnectorLimit',
detailedMessages: { result }
});

MODIFY
src/utils/Utils.ts
src/utils/Utils.ts
import { AnalyticsSettingsType, BillingSettingsType, PricingSettingsType, RefundSettingsType, RoamingSettingsType, SettingDBContent, SmartChargingContentType } from '../types/Setting';
import { ChargePointStatus, OCPPProtocol, OCPPVersion } from '../types/ocpp/OCPPServer';
-import ChargingStation, { ChargePoint, Connector, CurrentType, StaticLimitAmps } from '../types/ChargingStation';
+import ChargingStation, { ChargePoint, Connector, ConnectorCurrentLimitSource, CurrentType, StaticLimitAmps } from '../types/ChargingStation';
import User, { UserRole, UserStatus } from '../types/User';
import { ActionsResponse } from '../types/GlobalType';
@@ -332,6 +332,17 @@ export default class Utils {
}
}
+ public static getConnectorLimitSourceString(limitSource: ConnectorCurrentLimitSource): string {
+ switch (limitSource) {
+ case ConnectorCurrentLimitSource.CHARGING_PROFILE:
+ return 'Charging Profile';
+ case ConnectorCurrentLimitSource.CONNECTOR:
+ return 'Connector';
+ case ConnectorCurrentLimitSource.STATIC_LIMITATION:
+ return 'Static Limitation';
+ }
+ }
+
public static async checkTenant(tenantID: string): Promise<void> {
if (!tenantID) {
throw new BackendError({

Enhanced Logging