build(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 2.0 / OCPP20ResponseService.ts
index 77546cfa58fac5dd58b374454f85b8bb95653d3d..9851d3339371d8fe3e47cb7a5dcaa835d7bcace0 100644 (file)
@@ -142,7 +142,7 @@ export class OCPP20ResponseService extends OCPPResponseService {
         // Throw exception
         throw new OCPPError(
           ErrorType.NOT_IMPLEMENTED,
-          `'${commandName}' is not implemented to handle response PDU ${JSON.stringify(
+          `${commandName} is not implemented to handle response PDU ${JSON.stringify(
             payload,
             undefined,
             2
@@ -188,7 +188,6 @@ export class OCPP20ResponseService extends OCPPResponseService {
       if (chargingStation.isRegistered()) {
         chargingStation.emit(ChargingStationEvents.registered)
         if (chargingStation.inAcceptedState()) {
-          chargingStation.emit(ChargingStationEvents.accepted)
           addConfigurationKey(
             chargingStation,
             OCPP20OptionalVariableName.HeartbeatInterval,
@@ -196,6 +195,7 @@ export class OCPP20ResponseService extends OCPPResponseService {
             {},
             { overwrite: true, save: true }
           )
+          chargingStation.emit(ChargingStationEvents.accepted)
         }
       } else if (chargingStation.inRejectedState()) {
         chargingStation.emit(ChargingStationEvents.rejected)
@@ -207,6 +207,7 @@ export class OCPP20ResponseService extends OCPPResponseService {
         ? logger.warn(logMsg)
         : logger.info(logMsg)
     } else {
+      delete chargingStation.bootNotificationResponse
       logger.error(
         `${chargingStation.logPrefix()} Charging station boot notification response received: %j with undefined registration status`,
         payload