From: Jérôme Benoit Date: Fri, 6 Jan 2023 21:43:40 +0000 (+0100) Subject: Fixes to OCPP 1.6 payload type definitions X-Git-Tag: v1.1.89~21 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=c38f0ced134bb1e7daf750500788e9c194e7b74c;p=e-mobility-charging-stations-simulator.git Fixes to OCPP 1.6 payload type definitions Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index 089ecc76..15b914c3 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -58,7 +58,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { debug = false ): OCPP16MeterValue { const meterValue: OCPP16MeterValue = { - timestamp: new Date().toISOString(), + timestamp: new Date(), sampledValue: [], }; const connector = chargingStation.getConnectorStatus(connectorId); @@ -686,7 +686,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { meterStart: number ): OCPP16MeterValue { const meterValue: OCPP16MeterValue = { - timestamp: new Date().toISOString(), + timestamp: new Date(), sampledValue: [], }; // Energy.Active.Import.Register measurand (default) @@ -711,7 +711,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { meterStop: number ): OCPP16MeterValue { const meterValue: OCPP16MeterValue = { - timestamp: new Date().toISOString(), + timestamp: new Date(), sampledValue: [], }; // Energy.Active.Import.Register measurand (default) diff --git a/src/types/ocpp/1.6/MeterValues.ts b/src/types/ocpp/1.6/MeterValues.ts index 79bad362..0cfca50e 100644 --- a/src/types/ocpp/1.6/MeterValues.ts +++ b/src/types/ocpp/1.6/MeterValues.ts @@ -93,7 +93,7 @@ export interface OCPP16SampledValue extends JsonObject { } export interface OCPP16MeterValue extends JsonObject { - timestamp: string; + timestamp: Date; sampledValue: OCPP16SampledValue[]; } diff --git a/src/types/ocpp/1.6/Requests.ts b/src/types/ocpp/1.6/Requests.ts index 78fe4105..678eacc9 100644 --- a/src/types/ocpp/1.6/Requests.ts +++ b/src/types/ocpp/1.6/Requests.ts @@ -55,7 +55,7 @@ export interface OCPP16StatusNotificationRequest extends JsonObject { errorCode: OCPP16ChargePointErrorCode; status: OCPP16ChargePointStatus; info?: string; - timestamp?: string; + timestamp?: Date; vendorId?: string; vendorErrorCode?: string; } diff --git a/src/types/ocpp/1.6/Transaction.ts b/src/types/ocpp/1.6/Transaction.ts index 14f9223c..a11de78d 100644 --- a/src/types/ocpp/1.6/Transaction.ts +++ b/src/types/ocpp/1.6/Transaction.ts @@ -42,7 +42,7 @@ export interface OCPP16StartTransactionRequest extends JsonObject { connectorId: number; idTag: string; meterStart: number; - timestamp: string; + timestamp: Date; reservationId?: number; } @@ -54,7 +54,7 @@ export interface OCPP16StartTransactionResponse extends JsonObject { export interface OCPP16StopTransactionRequest extends JsonObject { idTag?: string; meterStop: number; - timestamp: string; + timestamp: Date; transactionId: number; reason?: OCPP16StopTransactionReason; transactionData?: OCPP16MeterValue[];