Add template section to list OCPP commands supported (#129)
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCPP16ResponseService.ts
index 38a29976a115160c558bed39b03196cf16ddd5fe..47021ca6014f8f90c4488b72e9591f19b29afadf 100644 (file)
@@ -34,6 +34,7 @@ import logger from '../../../utils/Logger';
 import Utils from '../../../utils/Utils';
 import type ChargingStation from '../../ChargingStation';
 import { ChargingStationConfigurationUtils } from '../../ChargingStationConfigurationUtils';
+import { ChargingStationUtils } from '../../ChargingStationUtils';
 import OCPPResponseService from '../OCPPResponseService';
 import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
 
@@ -65,7 +66,10 @@ export default class OCPP16ResponseService extends OCPPResponseService {
     requestPayload: JsonType
   ): Promise<void> {
     if (chargingStation.isRegistered() || commandName === OCPP16RequestCommand.BOOT_NOTIFICATION) {
-      if (this.responseHandlers.has(commandName)) {
+      if (
+        this.responseHandlers.has(commandName) &&
+        ChargingStationUtils.isCommandSupported(commandName, chargingStation.stationInfo)
+      ) {
         try {
           await this.responseHandlers.get(commandName)(chargingStation, payload, requestPayload);
         } catch (error) {