+import { secondsToMilliseconds } from 'date-fns';
+
import { WorkerBroadcastChannel } from './WorkerBroadcastChannel';
import { BaseError, type OCPPError } from '../../exception';
import {
} from '../../types';
import { Constants, convertToInt, isEmptyObject, isNullOrUndefined, logger } from '../../utils';
import type { ChargingStation } from '../ChargingStation';
-import { getConfigurationKey } from '../ChargingStationConfigurationUtils';
+import { getConfigurationKey } from '../ConfigurationKeyUtils';
import { OCPP16ServiceUtils } from '../ocpp';
const moduleName = 'ChargingStationWorkerBroadcastChannel';
this.chargingStation.getConnectorStatus(requestPayload!.connectorId!)!
.transactionId!,
configuredMeterValueSampleInterval
- ? convertToInt(configuredMeterValueSampleInterval.value) * 1000
+ ? secondsToMilliseconds(convertToInt(configuredMeterValueSampleInterval.value))
: Constants.DEFAULT_METER_VALUES_INTERVAL,
),
],
this.cleanRequestPayload(command, requestPayload);
return this.commandHandlers.get(command)!(requestPayload);
}
- throw new BaseError(`Unknown worker broadcast channel command: ${command}`);
+ throw new BaseError(`Unknown worker broadcast channel command: '${command}'`);
}
private cleanRequestPayload(