Add template section to list OCPP commands supported (#129)
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCPP16IncomingRequestService.ts
index d431b9a8a4def3a68b64af4e7313ab8af1c38700..172aa8dd4a55ec95b1ccf845bcc668f848841b01 100644 (file)
@@ -157,7 +157,10 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
       chargingStation.isRegistered() ||
       (!chargingStation.getOcppStrictCompliance() && chargingStation.isInUnknownState())
     ) {
-      if (this.incomingRequestHandlers.has(commandName)) {
+      if (
+        this.incomingRequestHandlers.has(commandName) &&
+        ChargingStationUtils.isCommandSupported(commandName, chargingStation.stationInfo)
+      ) {
         try {
           // Call the method to build the response
           response = await this.incomingRequestHandlers.get(commandName)(