From: Jérôme Benoit Date: Sun, 13 Jun 2021 09:24:01 +0000 (+0200) Subject: Add support for transaction data MeterValues X-Git-Tag: v1.0.16~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=fd0c36fab7509aeb48c1fbb40b70072fe64ae63c;p=e-mobility-charging-stations-simulator.git Add support for transaction data MeterValues Signed-off-by: Jérôme Benoit --- diff --git a/README.md b/README.md index c544417a..9ceca281 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ enableStatistics | true/false | true | boolean | enable charging stations statis beginEndMeterValues | true/false | false | boolean | enable Transaction.{Begin,End} MeterValues outOfOrderEndMeterValues | true/false | false | boolean | send Transaction.End MeterValues out of order meteringPerTransaction | true/false | true | boolean | disable metering on a per transaction basis +transactionDataMeterValues | true/false | false | boolean | enable transaction data MeterValues at stop transaction Configuration | | | ChargingStationConfiguration | charging stations OCPP configuration parameters AutomaticTransactionGenerator | | | AutomaticTransactionGenerator | charging stations ATG configuration Connectors | | | Connectors | charging stations connectors configuration diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 6dce9a37..02cb9094 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -161,6 +161,10 @@ export default class ChargingStation { return this.stationInfo.meteringPerTransaction ?? true; } + public getTransactionDataMeterValues(): boolean { + return this.stationInfo.transactionDataMeterValues ?? false; + } + public getEnergyActiveImportRegisterByTransactionId(transactionId: number): number | undefined { if (this.getMeteringPerTransaction()) { for (const connector in this.connectors) { @@ -349,6 +353,7 @@ export default class ChargingStation { delete this.getConnector(connectorId).transactionId; delete this.getConnector(connectorId).idTag; this.getConnector(connectorId).transactionEnergyActiveImportRegisterValue = 0; + delete this.getConnector(connectorId).transactionBeginMeterValue; this.stopMeterValues(connectorId); } @@ -405,9 +410,11 @@ export default class ChargingStation { } else { stationTemplateFromFile.power = stationTemplateFromFile.power as number; stationInfo.maxPower = stationTemplateFromFile.powerUnit === PowerUnits.KILO_WATT - ? (stationTemplateFromFile.power) * 1000 + ? stationTemplateFromFile.power * 1000 : stationTemplateFromFile.power; } + delete stationInfo.power; + delete stationInfo.powerUnit; stationInfo.chargingStationId = this.getChargingStationId(stationTemplateFromFile); stationInfo.resetTime = stationTemplateFromFile.resetTime ? stationTemplateFromFile.resetTime * 1000 : Constants.CHARGING_STATION_DEFAULT_RESET_TIME; return stationInfo; @@ -882,7 +889,7 @@ export default class ChargingStation { const authorizationFile = this.getAuthorizationFile(); if (authorizationFile) { try { - fs.watch(authorizationFile).on('change', (e) => { + fs.watch(authorizationFile).on('change', () => { try { logger.debug(this.logPrefix() + ' Authorization file ' + authorizationFile + ' have changed, reload'); // Initialize authorizedTags @@ -901,8 +908,8 @@ export default class ChargingStation { private startStationTemplateFileMonitoring(): void { try { - // eslint-disable-next-line @typescript-eslint/no-misused-promises - fs.watch(this.stationTemplateFile).on('change', async (e): Promise => { + // eslint-disable-next-line @typescript-eslint/no-misused-promises + fs.watch(this.stationTemplateFile).on('change', async (): Promise => { try { logger.debug(this.logPrefix() + ' Template file ' + this.stationTemplateFile + ' have changed, reload'); // Initialize diff --git a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts index 3c01d452..2e8b540b 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -1,7 +1,7 @@ import { ACElectricUtils, DCElectricUtils } from '../../../utils/ElectricUtils'; import { AuthorizeRequest, OCPP16AuthorizeResponse, OCPP16StartTransactionResponse, OCPP16StopTransactionReason, OCPP16StopTransactionResponse, StartTransactionRequest, StopTransactionRequest } from '../../../types/ocpp/1.6/Transaction'; import { HeartbeatRequest, OCPP16BootNotificationRequest, OCPP16IncomingRequestCommand, OCPP16RequestCommand, StatusNotificationRequest } from '../../../types/ocpp/1.6/Requests'; -import { MeterValue, MeterValueContext, MeterValuePhase, MeterValueUnit, MeterValuesRequest, OCPP16MeterValueMeasurand, OCPP16SampledValue } from '../../../types/ocpp/1.6/MeterValues'; +import { MeterValuePhase, MeterValueUnit, MeterValuesRequest, OCPP16MeterValue, OCPP16MeterValueMeasurand, OCPP16SampledValue } from '../../../types/ocpp/1.6/MeterValues'; import Constants from '../../../utils/Constants'; import { CurrentOutType } from '../../../types/ChargingStationTemplate'; @@ -27,7 +27,8 @@ export default class OCPP16RequestService extends OCPPRequestService { } } - public async sendBootNotification(chargePointModel: string, chargePointVendor: string, chargeBoxSerialNumber?: string, firmwareVersion?: string, chargePointSerialNumber?: string, iccid?: string, imsi?: string, meterSerialNumber?: string, meterType?: string): Promise { + public async sendBootNotification(chargePointModel: string, chargePointVendor: string, chargeBoxSerialNumber?: string, firmwareVersion?: string, + chargePointSerialNumber?: string, iccid?: string, imsi?: string, meterSerialNumber?: string, meterType?: string): Promise { try { const payload: OCPP16BootNotificationRequest = { chargePointModel, @@ -88,21 +89,24 @@ export default class OCPP16RequestService extends OCPPRequestService { public async sendStopTransaction(transactionId: number, meterStop: number, idTag?: string, reason: OCPP16StopTransactionReason = OCPP16StopTransactionReason.NONE): Promise { try { - const payload: StopTransactionRequest = { - transactionId, - ...!Utils.isUndefined(idTag) && { idTag }, - meterStop: meterStop, - timestamp: new Date().toISOString(), - ...reason && { reason }, - }; let connectorId: number; for (const connector in this.chargingStation.connectors) { if (Utils.convertToInt(connector) > 0 && this.chargingStation.getConnector(Utils.convertToInt(connector))?.transactionId === transactionId) { connectorId = Utils.convertToInt(connector); } } + const transactionEndMeterValue = OCPP16ServiceUtils.buildTransactionEndMeterValue(this.chargingStation, connectorId, meterStop); + // FIXME: should be a callback, each OCPP commands implementation must do only one job (this.chargingStation.getBeginEndMeterValues() && !this.chargingStation.getOutOfOrderEndMeterValues()) - && await this.sendTransactionEndMeterValues(connectorId, transactionId, meterStop); + && await this.sendTransactionEndMeterValues(connectorId, transactionId, transactionEndMeterValue); + const payload: StopTransactionRequest = { + transactionId, + ...!Utils.isUndefined(idTag) && { idTag }, + meterStop, + timestamp: new Date().toISOString(), + ...reason && { reason }, + ...this.chargingStation.getTransactionDataMeterValues() && { transactionData: OCPP16ServiceUtils.buildTransactionDataMeterValues(this.chargingStation.getConnector(connectorId).transactionBeginMeterValue, transactionEndMeterValue) }, + }; return await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.STOP_TRANSACTION) as OCPP16StartTransactionResponse; } catch (error) { this.handleRequestError(OCPP16RequestCommand.STOP_TRANSACTION, error); @@ -112,7 +116,7 @@ export default class OCPP16RequestService extends OCPPRequestService { // eslint-disable-next-line consistent-this public async sendMeterValues(connectorId: number, transactionId: number, interval: number, self: OCPPRequestService, debug = false): Promise { try { - const meterValue: MeterValue = { + const meterValue: OCPP16MeterValue = { timestamp: new Date().toISOString(), sampledValue: [], }; @@ -261,45 +265,20 @@ export default class OCPP16RequestService extends OCPPRequestService { } } - public async sendTransactionBeginMeterValues(connectorId: number, transactionId: number, meterBegin: number): Promise { - const meterValue: MeterValue = { - timestamp: new Date().toISOString(), - sampledValue: [], - }; - const meterValuesTemplate: OCPP16SampledValue[] = this.chargingStation.getConnector(connectorId).MeterValues; - for (let index = 0; index < meterValuesTemplate.length; index++) { - // Energy.Active.Import.Register measurand (default) - if (!meterValuesTemplate[index].measurand || meterValuesTemplate[index].measurand === OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER) { - const unitDivider = meterValuesTemplate[index]?.unit === MeterValueUnit.KILO_WATT_HOUR ? 1000 : 1; - meterValue.sampledValue.push(OCPP16ServiceUtils.buildSampledValue(meterValuesTemplate[index], - Utils.roundTo(meterBegin / unitDivider, 4), MeterValueContext.TRANSACTION_BEGIN)); - } - } + public async sendTransactionBeginMeterValues(connectorId: number, transactionId: number, beginMeterValue: OCPP16MeterValue): Promise { const payload: MeterValuesRequest = { connectorId, transactionId, - meterValue, + meterValue: beginMeterValue, }; await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.METER_VALUES); } - public async sendTransactionEndMeterValues(connectorId: number, transactionId: number, meterEnd: number): Promise { - const meterValue: MeterValue = { - timestamp: new Date().toISOString(), - sampledValue: [], - }; - const meterValuesTemplate: OCPP16SampledValue[] = this.chargingStation.getConnector(connectorId).MeterValues; - for (let index = 0; index < meterValuesTemplate.length; index++) { - // Energy.Active.Import.Register measurand (default) - if (!meterValuesTemplate[index].measurand || meterValuesTemplate[index].measurand === OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER) { - const unitDivider = meterValuesTemplate[index]?.unit === MeterValueUnit.KILO_WATT_HOUR ? 1000 : 1; - meterValue.sampledValue.push(OCPP16ServiceUtils.buildSampledValue(meterValuesTemplate[index], Utils.roundTo(meterEnd / unitDivider, 4), MeterValueContext.TRANSACTION_END)); - } - } + public async sendTransactionEndMeterValues(connectorId: number, transactionId: number, endMeterValue: OCPP16MeterValue): Promise { const payload: MeterValuesRequest = { connectorId, transactionId, - meterValue, + meterValue: endMeterValue, }; await this.sendMessage(Utils.generateUUID(), payload, MessageType.CALL_MESSAGE, OCPP16RequestCommand.METER_VALUES); } diff --git a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts index 0f12f2f2..df211827 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ResponseService.ts @@ -4,6 +4,7 @@ import { HeartbeatResponse, OCPP16BootNotificationResponse, OCPP16RegistrationSt import { MeterValuesRequest, MeterValuesResponse } from '../../../types/ocpp/1.6/MeterValues'; import { OCPP16ChargePointStatus } from '../../../types/ocpp/1.6/ChargePointStatus'; +import { OCPP16ServiceUtils } from './OCPP16ServiceUtils'; import { OCPP16StandardParametersKey } from '../../../types/ocpp/1.6/Configuration'; import OCPPResponseService from '../OCPPResponseService'; import Utils from '../../../utils/Utils'; @@ -55,8 +56,10 @@ export default class OCPP16ResponseService extends OCPPResponseService { this.chargingStation.getConnector(connectorId).transactionId = payload.transactionId; this.chargingStation.getConnector(connectorId).idTag = requestPayload.idTag; this.chargingStation.getConnector(connectorId).transactionEnergyActiveImportRegisterValue = 0; + this.chargingStation.getConnector(connectorId).transactionBeginMeterValue = OCPP16ServiceUtils.buildTransactionBeginMeterValue(this.chargingStation, connectorId, + requestPayload.meterStart); this.chargingStation.getBeginEndMeterValues() && await this.chargingStation.ocppRequestService.sendTransactionBeginMeterValues(connectorId, payload.transactionId, - this.chargingStation.getEnergyActiveImportRegisterByTransactionId(payload.transactionId)); + this.chargingStation.getConnector(connectorId).transactionBeginMeterValue); await this.chargingStation.ocppRequestService.sendStatusNotification(connectorId, OCPP16ChargePointStatus.CHARGING); this.chargingStation.getConnector(connectorId).status = OCPP16ChargePointStatus.CHARGING; logger.info(this.chargingStation.logPrefix() + ' Transaction ' + payload.transactionId.toString() + ' STARTED on ' + this.chargingStation.stationInfo.chargingStationId + '#' + connectorId.toString() + ' for idTag ' + requestPayload.idTag); @@ -87,7 +90,8 @@ export default class OCPP16ResponseService extends OCPPResponseService { } if (payload.idTagInfo?.status === OCPP16AuthorizationStatus.ACCEPTED) { (this.chargingStation.getBeginEndMeterValues() && this.chargingStation.getOutOfOrderEndMeterValues()) - && await this.chargingStation.ocppRequestService.sendTransactionEndMeterValues(transactionConnectorId, requestPayload.transactionId, requestPayload.meterStop); + && await this.chargingStation.ocppRequestService.sendTransactionEndMeterValues(transactionConnectorId, requestPayload.transactionId, + OCPP16ServiceUtils.buildTransactionEndMeterValue(this.chargingStation, transactionConnectorId, requestPayload.meterStop)); if (!this.chargingStation.isChargingStationAvailable() || !this.chargingStation.isConnectorAvailable(transactionConnectorId)) { await this.chargingStation.ocppRequestService.sendStatusNotification(transactionConnectorId, OCPP16ChargePointStatus.UNAVAILABLE); this.chargingStation.getConnector(transactionConnectorId).status = OCPP16ChargePointStatus.UNAVAILABLE; diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index 853b46aa..65b599bf 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -1,4 +1,4 @@ -import { MeterValueContext, MeterValueLocation, MeterValuePhase, MeterValueUnit, OCPP16MeterValueMeasurand, OCPP16SampledValue } from '../../../types/ocpp/1.6/MeterValues'; +import { MeterValueContext, MeterValueLocation, MeterValuePhase, MeterValueUnit, OCPP16MeterValue, OCPP16MeterValueMeasurand, OCPP16SampledValue } from '../../../types/ocpp/1.6/MeterValues'; import ChargingStation from '../../ChargingStation'; import Utils from '../../../utils/Utils'; @@ -10,7 +10,7 @@ export class OCPP16ServiceUtils { const errMsg = `${chargingStation.logPrefix()} MeterValues measurand ${measurandType ?? OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER}: powerDivider is undefined`; logger.error(errMsg); throw Error(errMsg); - } else if (chargingStation.stationInfo.powerDivider && chargingStation.stationInfo.powerDivider <= 0) { + } else if (chargingStation.stationInfo?.powerDivider <= 0) { const errMsg = `${chargingStation.logPrefix()} MeterValues measurand ${measurandType ?? OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER}: powerDivider have zero or below value ${chargingStation.stationInfo.powerDivider}`; logger.error(errMsg); throw Error(errMsg); @@ -59,4 +59,44 @@ export class OCPP16ServiceUtils { return MeterValueLocation.EV; } } + + public static buildTransactionBeginMeterValue(chargingStation: ChargingStation, connectorId: number, meterBegin: number): OCPP16MeterValue { + const meterValue: OCPP16MeterValue = { + timestamp: new Date().toISOString(), + sampledValue: [], + }; + const meterValuesTemplate: OCPP16SampledValue[] = chargingStation.getConnector(connectorId).MeterValues; + for (let index = 0; index < meterValuesTemplate.length; index++) { + // Energy.Active.Import.Register measurand (default) + if (!meterValuesTemplate[index].measurand || meterValuesTemplate[index].measurand === OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER) { + const unitDivider = meterValuesTemplate[index]?.unit === MeterValueUnit.KILO_WATT_HOUR ? 1000 : 1; + meterValue.sampledValue.push(OCPP16ServiceUtils.buildSampledValue(meterValuesTemplate[index], + Utils.roundTo(meterBegin / unitDivider, 4), MeterValueContext.TRANSACTION_BEGIN)); + } + } + return meterValue; + } + + public static buildTransactionEndMeterValue(chargingStation: ChargingStation, connectorId: number, meterEnd: number): OCPP16MeterValue { + const meterValue: OCPP16MeterValue = { + timestamp: new Date().toISOString(), + sampledValue: [], + }; + const meterValuesTemplate: OCPP16SampledValue[] = chargingStation.getConnector(connectorId).MeterValues; + for (let index = 0; index < meterValuesTemplate.length; index++) { + // Energy.Active.Import.Register measurand (default) + if (!meterValuesTemplate[index].measurand || meterValuesTemplate[index].measurand === OCPP16MeterValueMeasurand.ENERGY_ACTIVE_IMPORT_REGISTER) { + const unitDivider = meterValuesTemplate[index]?.unit === MeterValueUnit.KILO_WATT_HOUR ? 1000 : 1; + meterValue.sampledValue.push(OCPP16ServiceUtils.buildSampledValue(meterValuesTemplate[index], Utils.roundTo(meterEnd / unitDivider, 4), MeterValueContext.TRANSACTION_END)); + } + } + return meterValue; + } + + public static buildTransactionDataMeterValues(transactionBeginMeterValue: OCPP16MeterValue, transactionEndMeterValue: OCPP16MeterValue): OCPP16MeterValue[] { + const meterValues: OCPP16MeterValue[] = []; + meterValues.push(transactionBeginMeterValue); + meterValues.push(transactionEndMeterValue); + return meterValues; + } } diff --git a/src/charging-station/ocpp/OCPPRequestService.ts b/src/charging-station/ocpp/OCPPRequestService.ts index 17acfbf9..459e9b72 100644 --- a/src/charging-station/ocpp/OCPPRequestService.ts +++ b/src/charging-station/ocpp/OCPPRequestService.ts @@ -8,6 +8,7 @@ import ChargingStation from '../ChargingStation'; import Constants from '../../utils/Constants'; import { ErrorType } from '../../types/ocpp/ErrorType'; import { MessageType } from '../../types/ocpp/MessageType'; +import { MeterValue } from '../../types/ocpp/MeterValues'; import OCPPError from '../OcppError'; import OCPPResponseService from './OCPPResponseService'; import logger from '../../utils/Logger'; @@ -114,7 +115,7 @@ export default abstract class OCPPRequestService { public abstract sendStartTransaction(connectorId: number, idTag?: string): Promise; public abstract sendStopTransaction(transactionId: number, meterStop: number, idTag?: string, reason?: StopTransactionReason): Promise; public abstract sendMeterValues(connectorId: number, transactionId: number, interval: number, self: OCPPRequestService): Promise; - public abstract sendTransactionBeginMeterValues(connectorId: number, transactionId: number, meterBegin: number): Promise; - public abstract sendTransactionEndMeterValues(connectorId: number, transactionId: number, meterEnd: number): Promise; + public abstract sendTransactionBeginMeterValues(connectorId: number, transactionId: number, beginMeterValue: MeterValue): Promise; + public abstract sendTransactionEndMeterValues(connectorId: number, transactionId: number, endMeterValue: MeterValue): Promise; public abstract sendError(messageId: string, error: OCPPError, commandName: RequestCommand | IncomingRequestCommand): Promise; } diff --git a/src/types/ChargingStationTemplate.ts b/src/types/ChargingStationTemplate.ts index 13d8e75b..dc7fc73e 100644 --- a/src/types/ChargingStationTemplate.ts +++ b/src/types/ChargingStationTemplate.ts @@ -16,7 +16,8 @@ export enum PowerUnits { export enum VoltageOut { VOLTAGE_110 = 110, VOLTAGE_230 = 230, - VOLTAGE_400 = 400 + VOLTAGE_400 = 400, + VOLTAGE_800 = 800 } export interface AutomaticTransactionGenerator { @@ -61,6 +62,7 @@ export default interface ChargingStationTemplate { beginEndMeterValues?: boolean; outOfOrderEndMeterValues?: boolean; meteringPerTransaction?: boolean; + transactionDataMeterValues?: boolean; Configuration?: ChargingStationConfiguration; AutomaticTransactionGenerator: AutomaticTransactionGenerator; Connectors: Connectors; diff --git a/src/types/Connectors.ts b/src/types/Connectors.ts index 14415180..85ff64c2 100644 --- a/src/types/Connectors.ts +++ b/src/types/Connectors.ts @@ -1,7 +1,8 @@ +import { MeterValue, SampledValue } from './ocpp/MeterValues'; + import { AvailabilityType } from './ocpp/Requests'; import { ChargePointStatus } from './ocpp/ChargePointStatus'; import { ChargingProfile } from './ocpp/ChargingProfile'; -import { SampledValue } from './ocpp/MeterValues'; export interface Connector { availability: AvailabilityType; @@ -14,7 +15,8 @@ export interface Connector { idTag?: string; energyActiveImportRegisterValue?: number; // In Wh transactionEnergyActiveImportRegisterValue?: number; // In Wh - chargingProfiles?: ChargingProfile[] + transactionBeginMeterValue?: MeterValue; + chargingProfiles?: ChargingProfile[]; } export default interface Connectors { diff --git a/src/types/ocpp/1.6/MeterValues.ts b/src/types/ocpp/1.6/MeterValues.ts index ac77b304..e93746a4 100644 --- a/src/types/ocpp/1.6/MeterValues.ts +++ b/src/types/ocpp/1.6/MeterValues.ts @@ -89,7 +89,7 @@ export interface OCPP16SampledValue { format?: MeterValueFormat; } -export interface MeterValue { +export interface OCPP16MeterValue { timestamp: string; sampledValue: OCPP16SampledValue[]; } @@ -97,7 +97,7 @@ export interface MeterValue { export interface MeterValuesRequest { connectorId: number; transactionId?: number; - meterValue: MeterValue | MeterValue[]; + meterValue: OCPP16MeterValue | OCPP16MeterValue[]; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/src/types/ocpp/1.6/Transaction.ts b/src/types/ocpp/1.6/Transaction.ts index 69aff0e0..030a2f25 100644 --- a/src/types/ocpp/1.6/Transaction.ts +++ b/src/types/ocpp/1.6/Transaction.ts @@ -1,4 +1,4 @@ -import { MeterValue } from './MeterValues'; +import { OCPP16MeterValue } from './MeterValues'; export enum OCPP16StopTransactionReason { NONE = '', @@ -56,7 +56,7 @@ export interface StopTransactionRequest { timestamp: string; transactionId: number; reason?: OCPP16StopTransactionReason; - transactionData?: MeterValue[]; + transactionData?: OCPP16MeterValue[]; } export interface OCPP16StopTransactionResponse { diff --git a/src/types/ocpp/MeterValues.ts b/src/types/ocpp/MeterValues.ts index b052ce69..1022c9fb 100644 --- a/src/types/ocpp/MeterValues.ts +++ b/src/types/ocpp/MeterValues.ts @@ -1,4 +1,4 @@ -import { OCPP16MeterValueMeasurand, OCPP16SampledValue } from './1.6/MeterValues'; +import { OCPP16MeterValue, OCPP16MeterValueMeasurand, OCPP16SampledValue } from './1.6/MeterValues'; export type MeterValueMeasurand = OCPP16MeterValueMeasurand; @@ -7,3 +7,5 @@ export const MeterValueMeasurand = { }; export type SampledValue = OCPP16SampledValue; + +export type MeterValue = OCPP16MeterValue; diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 98483898..ebc8a391 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -141,8 +141,8 @@ export default class Configuration { private static getConfigurationFileWatcher(): fs.FSWatcher { try { - // eslint-disable-next-line @typescript-eslint/no-misused-promises - return fs.watch(Configuration.configurationFilePath).on('change', async (e): Promise => { + // eslint-disable-next-line @typescript-eslint/no-misused-promises + return fs.watch(Configuration.configurationFilePath).on('change', async (): Promise => { // Nullify to force configuration file reading Configuration.configuration = null; if (!Configuration.isUndefined(Configuration.configurationChangeCallback)) {