refactor: remove unneeded binding
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 20 Jan 2024 19:30:20 +0000 (20:30 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 20 Jan 2024 19:30:20 +0000 (20:30 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16ResponseService.ts
src/charging-station/ocpp/2.0/OCPP20ResponseService.ts

index b8fce37c98d0dab197adfb868e52c3064478eeea..5ceeb38a6bc01d2747bfd0308bb5cfd8d4d7aa4b 100644 (file)
@@ -75,7 +75,7 @@ export class OCPP16ResponseService extends OCPPResponseService {
         OCPP16RequestCommand.BOOT_NOTIFICATION,
         this.handleResponseBootNotification.bind(this) as ResponseHandler
       ],
-      [OCPP16RequestCommand.HEARTBEAT, this.emptyResponseHandler.bind(this) as ResponseHandler],
+      [OCPP16RequestCommand.HEARTBEAT, this.emptyResponseHandler],
       [OCPP16RequestCommand.AUTHORIZE, this.handleResponseAuthorize.bind(this) as ResponseHandler],
       [
         OCPP16RequestCommand.START_TRANSACTION,
@@ -89,16 +89,13 @@ export class OCPP16ResponseService extends OCPPResponseService {
         OCPP16RequestCommand.STATUS_NOTIFICATION,
         this.emptyResponseHandler.bind(this) as ResponseHandler
       ],
-      [OCPP16RequestCommand.METER_VALUES, this.emptyResponseHandler.bind(this) as ResponseHandler],
+      [OCPP16RequestCommand.METER_VALUES, this.emptyResponseHandler],
       [
         OCPP16RequestCommand.DIAGNOSTICS_STATUS_NOTIFICATION,
         this.emptyResponseHandler.bind(this) as ResponseHandler
       ],
-      [OCPP16RequestCommand.DATA_TRANSFER, this.emptyResponseHandler.bind(this) as ResponseHandler],
-      [
-        OCPP16RequestCommand.FIRMWARE_STATUS_NOTIFICATION,
-        this.emptyResponseHandler.bind(this) as ResponseHandler
-      ]
+      [OCPP16RequestCommand.DATA_TRANSFER, this.emptyResponseHandler],
+      [OCPP16RequestCommand.FIRMWARE_STATUS_NOTIFICATION, this.emptyResponseHandler]
     ])
     this.jsonSchemas = new Map<OCPP16RequestCommand, JSONSchemaType<JsonType>>([
       [
index 28c612655040a9df66540d0d313c582f43d76bf3..ee4b201f20789b8a7f151a8381e4be74ae581d56 100644 (file)
@@ -43,11 +43,8 @@ export class OCPP20ResponseService extends OCPPResponseService {
         OCPP20RequestCommand.BOOT_NOTIFICATION,
         this.handleResponseBootNotification.bind(this) as ResponseHandler
       ],
-      [OCPP20RequestCommand.HEARTBEAT, this.emptyResponseHandler.bind(this) as ResponseHandler],
-      [
-        OCPP20RequestCommand.STATUS_NOTIFICATION,
-        this.emptyResponseHandler.bind(this) as ResponseHandler
-      ]
+      [OCPP20RequestCommand.HEARTBEAT, this.emptyResponseHandler],
+      [OCPP20RequestCommand.STATUS_NOTIFICATION, this.emptyResponseHandler]
     ])
     this.jsonSchemas = new Map<OCPP20RequestCommand, JSONSchemaType<JsonType>>([
       [