Add template section to list OCPP commands supported (#129)
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCPP16RequestService.ts
index 3656e70f0980b33f689e0047a21c48a4def37812..78ff888890826396efe75610dfa6e3f50a632e3f 100644 (file)
@@ -8,6 +8,7 @@ import { RequestParams } from '../../../types/ocpp/Requests';
 import Constants from '../../../utils/Constants';
 import Utils from '../../../utils/Utils';
 import type ChargingStation from '../../ChargingStation';
+import { ChargingStationUtils } from '../../ChargingStationUtils';
 import OCPPRequestService from '../OCPPRequestService';
 import type OCPPResponseService from '../OCPPResponseService';
 import { OCPP16ServiceUtils } from './OCPP16ServiceUtils';
@@ -28,7 +29,10 @@ export default class OCPP16RequestService extends OCPPRequestService {
     commandParams?: JsonType,
     params?: RequestParams
   ): Promise<Response> {
-    if (Object.values(OCPP16RequestCommand).includes(commandName)) {
+    if (
+      Object.values(OCPP16RequestCommand).includes(commandName) &&
+      ChargingStationUtils.isCommandSupported(commandName, chargingStation.stationInfo)
+    ) {
       return (await this.sendMessage(
         chargingStation,
         Utils.generateUUID(),