From 0ce9babe5c83eced0e773109d4393c1ab487039f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 18 Apr 2023 00:32:34 +0200 Subject: [PATCH] refactor(simulator): permit to check if connector status transition is allowed MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index 47c711af..52157e34 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -866,7 +866,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { chargingStation: ChargingStation, connectorId: number, status: OCPP16ChargePointStatus - ): void { + ): boolean { if ( connectorId === 0 && !OCPP16Constants.OCPP16ChargePointStatusChargingStationTransition.has([ @@ -879,6 +879,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { chargingStation.getConnectorStatus(connectorId).status } to ${status} is not allowed` ); + return false; } else if ( !OCPP16Constants.OCPP16ChargePointStatusConnectorTransition.has([ chargingStation.getConnectorStatus(connectorId).status as OCPP16ChargePointStatus, @@ -890,7 +891,9 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { chargingStation.getConnectorStatus(connectorId).status } to ${status} is not allowed` ); + return false; } + return true; } private static buildSampledValue( -- 2.34.1