Add status notification support to trigger message OCPP command
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / OCPPResponseService.ts
index 2fa0112c70c6d42fc29958da64007576824b6285..e838bd9fb1d4ae2280ca08d2e9516917ffac37fc 100644 (file)
@@ -7,6 +7,7 @@ export default abstract class OCPPResponseService {
     string,
     OCPPResponseService
   >();
+
   protected readonly chargingStation: ChargingStation;
 
   protected constructor(chargingStation: ChargingStation) {
@@ -17,15 +18,15 @@ export default abstract class OCPPResponseService {
     this: new (chargingStation: ChargingStation) => T,
     chargingStation: ChargingStation
   ): T {
-    if (!OCPPResponseService.instances.has(chargingStation.id)) {
-      OCPPResponseService.instances.set(chargingStation.id, new this(chargingStation));
+    if (!OCPPResponseService.instances.has(chargingStation.hashId)) {
+      OCPPResponseService.instances.set(chargingStation.hashId, new this(chargingStation));
     }
-    return OCPPResponseService.instances.get(chargingStation.id) as T;
+    return OCPPResponseService.instances.get(chargingStation.hashId) as T;
   }
 
-  public abstract handleResponse(
+  public abstract responseHandler(
     commandName: RequestCommand,
-    payload: JsonType | string,
+    payload: JsonType,
     requestPayload: JsonType
   ): Promise<void>;
 }