From: Jérôme Benoit Date: Mon, 17 Apr 2023 22:32:34 +0000 (+0200) Subject: refactor(simulator): permit to check if connector status transition is X-Git-Tag: v1.2.10~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0ce9babe5c83eced0e773109d4393c1ab487039f;p=e-mobility-charging-stations-simulator.git refactor(simulator): permit to check if connector status transition is allowed 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 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(