From: Jérôme Benoit Date: Fri, 4 Mar 2022 12:19:58 +0000 (+0100) Subject: Align constants namespace X-Git-Tag: v1.1.50~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c69294f7af3296d240a123a3fdf856deda2320cc;p=e-mobility-charging-stations-simulator.git Align constants namespace Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts index 7ec4b019..c97ee4bf 100644 --- a/src/charging-station/ocpp/1.6/OCPP16RequestService.ts +++ b/src/charging-station/ocpp/1.6/OCPP16RequestService.ts @@ -68,7 +68,7 @@ export default class OCPP16RequestService extends OCPPRequestService { public async sendAuthorize(connectorId: number, idTag?: string): Promise { const payload: AuthorizeRequest = { - ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.TRANSACTION_DEFAULT_IDTAG }, + ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.DEFAULT_IDTAG }, }; this.chargingStation.getConnectorStatus(connectorId).authorizeIdTag = idTag; return await this.sendMessage(Utils.generateUUID(), payload, OCPP16RequestCommand.AUTHORIZE) as OCPP16AuthorizeResponse; @@ -77,7 +77,7 @@ export default class OCPP16RequestService extends OCPPRequestService { public async sendStartTransaction(connectorId: number, idTag?: string): Promise { const payload: StartTransactionRequest = { connectorId, - ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.TRANSACTION_DEFAULT_IDTAG }, + ...!Utils.isUndefined(idTag) ? { idTag } : { idTag: Constants.DEFAULT_IDTAG }, meterStart: this.chargingStation.getEnergyActiveImportRegisterByConnectorId(connectorId), timestamp: new Date().toISOString(), }; diff --git a/src/utils/Constants.ts b/src/utils/Constants.ts index b68317db..59a41997 100644 --- a/src/utils/Constants.ts +++ b/src/utils/Constants.ts @@ -33,7 +33,7 @@ export default class Constants { static readonly CHARGING_STATION_ATG_INITIALIZATION_TIME = 1000; // Ms static readonly CHARGING_STATION_ATG_DEFAULT_STOP_AFTER_HOURS = 0.25; // Hours - static readonly TRANSACTION_DEFAULT_IDTAG = '00000000'; + static readonly DEFAULT_IDTAG = '00000000'; static readonly ELEMENT_START_DELAY = 0; static readonly WORKER_START_DELAY = 500;