import { OCPP16Constants } from './1.6/OCPP16Constants';
import { OCPP20Constants } from './2.0/OCPP20Constants';
import { OCPPConstants } from './OCPPConstants';
-import { type ChargingStation, ChargingStationConfigurationUtils } from '../../charging-station';
+import { type ChargingStation, getConfigurationKey } from '../../charging-station';
import { BaseError } from '../../exception';
import {
ChargePointErrorCode,
ErrorType,
FileType,
IncomingRequestCommand,
- type JsonObject,
type JsonType,
MessageTrigger,
MessageType,
}
public static convertDateToISOString<T extends JsonType>(obj: T): void {
- for (const key in obj as JsonObject) {
+ for (const key in obj) {
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
if (obj![key] instanceof Date) {
- obj![key] = (obj![key] as Date).toISOString();
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
+ (obj![key] as string) = (obj![key] as Date).toISOString();
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
} else if (obj![key] !== null && typeof obj![key] === 'object') {
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
OCPPServiceUtils.convertDateToISOString<T>(obj![key] as T);
}
}
}
if (
measurand !== MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER &&
- ChargingStationConfigurationUtils.getConfigurationKey(
+ getConfigurationKey(
chargingStation,
StandardParametersKey.MeterValuesSampledData,
)?.value?.includes(measurand) === false
phase &&
sampledValueTemplates[index]?.phase === phase &&
sampledValueTemplates[index]?.measurand === measurand &&
- ChargingStationConfigurationUtils.getConfigurationKey(
+ getConfigurationKey(
chargingStation,
StandardParametersKey.MeterValuesSampledData,
)?.value?.includes(measurand) === true
!phase &&
!sampledValueTemplates[index].phase &&
sampledValueTemplates[index]?.measurand === measurand &&
- ChargingStationConfigurationUtils.getConfigurationKey(
+ getConfigurationKey(
chargingStation,
StandardParametersKey.MeterValuesSampledData,
)?.value?.includes(measurand) === true