key: string
): void {
if (!Utils.isUndefined(template[deprecatedKey])) {
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
- template[key] = template[deprecatedKey];
+ template[key] = template[deprecatedKey] as unknown;
delete template[deprecatedKey];
}
}
addMessageListener();
if (!Utils.isUndefined(workerData)) {
startChargingStation({
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- index: workerData.index as number,
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- templateFile: workerData.templateFile as string,
+ index: (workerData as Record<string, unknown>).index as number,
+ templateFile: (workerData as Record<string, unknown>).templateFile as string,
});
}
}
OCPP16RequestCommand,
StatusNotificationRequest,
} from '../../../types/ocpp/1.6/Requests';
+import MeasurandPerPhaseSampledValueTemplates, {
+ SampledValueTemplate,
+} from '../../../types/MeasurandPerPhaseSampledValueTemplates';
import {
MeterValueUnit,
MeterValuesRequest,
import type ChargingStation from '../../ChargingStation';
import Constants from '../../../utils/Constants';
import { ErrorType } from '../../../types/ocpp/ErrorType';
-import MeasurandPerPhaseSampledValueTemplates from '../../../types/MeasurandPerPhaseSampledValueTemplates';
import MeasurandValues from '../../../types/MeasurandValues';
import { OCPP16BootNotificationResponse } from '../../../types/ocpp/1.6/Responses';
import { OCPP16ChargePointErrorCode } from '../../../types/ocpp/1.6/ChargePointErrorCode';
const phaseValue = `L${phase}-N`;
meterValue.sampledValue.push(
OCPP16ServiceUtils.buildSampledValue(
- powerPerPhaseSampledValueTemplates[`L${phase}`] ?? powerSampledValueTemplate,
- powerMeasurandValues[`L${phase}`],
+ (powerPerPhaseSampledValueTemplates[`L${phase}`] as SampledValueTemplate) ??
+ powerSampledValueTemplate,
+ powerMeasurandValues[`L${phase}`] as number,
null,
phaseValue as OCPP16MeterValuePhase
)
const phaseValue = `L${phase}`;
meterValue.sampledValue.push(
OCPP16ServiceUtils.buildSampledValue(
- currentPerPhaseSampledValueTemplates[phaseValue] ?? currentSampledValueTemplate,
- currentMeasurandValues[phaseValue],
+ (currentPerPhaseSampledValueTemplates[phaseValue] as SampledValueTemplate) ??
+ currentSampledValueTemplate,
+ currentMeasurandValues[phaseValue] as number,
null,
phaseValue as OCPP16MeterValuePhase
)
if (
sectionName &&
!Configuration.isUndefined(Configuration.getConfig()[sectionName]) &&
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
- !Configuration.isUndefined(Configuration.getConfig()[sectionName][key])
+ !Configuration.isUndefined(Configuration.getConfig()[sectionName] as Record<string, unknown>)[
+ key
+ ]
) {
console.error(
chalk`{green ${Configuration.logPrefix()}} {red Deprecated configuration key '${key}' usage in section '${sectionName}'${
import Configuration from './Configuration';
import DailyRotateFile from 'winston-daily-rotate-file';
+import { Format } from 'logform';
import Utils from './Utils';
let transports: transport[];
const logger: Logger = createLogger({
level: Configuration.getLogLevel(),
- format: format.combine(format.splat(), format[Configuration.getLogFormat()]()),
+ format: format.combine(format.splat(), (format[Configuration.getLogFormat()] as () => Format)()),
transports: transports,
});
if (Configuration.getLogConsole()) {
logger.add(
new Console({
- format: format.combine(format.splat(), format[Configuration.getLogFormat()]()),
+ format: format.combine(
+ format.splat(),
+ (format[Configuration.getLogFormat()] as () => Format)()
+ ),
})
);
}