refactor: use keyof to build the reservation filter key
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCPP16ServiceUtils.ts
index d0afb3678dcdacf99b1682ed3397079027d38031..7f065d30bed7dd29c684edaa358c82c0866cbe9e 100644 (file)
@@ -2,7 +2,7 @@
 
 import type { JSONSchemaType } from 'ajv';
 
-import { type ChargingStation, getIdTagsFile } from '../../../charging-station';
+import { type ChargingStation, getIdTagsFile, hasFeatureProfile } from '../../../charging-station';
 import { OCPPError } from '../../../exception';
 import {
   type ClearChargingProfileRequest,
@@ -55,7 +55,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils {
     featureProfile: OCPP16SupportedFeatureProfiles,
     command: OCPP16RequestCommand | OCPP16IncomingRequestCommand,
   ): boolean {
-    if (!chargingStation.hasFeatureProfile(featureProfile)) {
+    if (!hasFeatureProfile(chargingStation, featureProfile)) {
       logger.warn(
         `${chargingStation.logPrefix()} Trying to '${command}' without '${featureProfile}' feature enabled in ${
           OCPP16StandardParametersKey.SupportedFeatureProfiles