build(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCPP16ResponseService.ts
index 409f382ea9e8cfd0351b142eb4100d659e58f620..df8374214f8e8865fea5453e9ae4075ea5ee2ece 100644 (file)
@@ -469,7 +469,7 @@ export class OCPP16ResponseService 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
@@ -515,7 +515,6 @@ export class OCPP16ResponseService extends OCPPResponseService {
       if (chargingStation.isRegistered()) {
         chargingStation.emit(ChargingStationEvents.registered)
         if (chargingStation.inAcceptedState()) {
-          chargingStation.emit(ChargingStationEvents.accepted)
           addConfigurationKey(
             chargingStation,
             OCPP16StandardParametersKey.HeartbeatInterval,
@@ -530,6 +529,7 @@ export class OCPP16ResponseService extends OCPPResponseService {
             { visible: false },
             { overwrite: true, save: true }
           )
+          chargingStation.emit(ChargingStationEvents.accepted)
         }
       } else if (chargingStation.inRejectedState()) {
         chargingStation.emit(ChargingStationEvents.rejected)
@@ -541,6 +541,7 @@ export class OCPP16ResponseService 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
@@ -649,6 +650,7 @@ export class OCPP16ResponseService extends OCPPResponseService {
     }
     if (
       connectorStatus?.idTagAuthorized === true &&
+      connectorStatus.authorizeIdTag != null &&
       connectorStatus.authorizeIdTag !== requestPayload.idTag
     ) {
       logger.error(
@@ -663,6 +665,7 @@ export class OCPP16ResponseService extends OCPPResponseService {
     }
     if (
       connectorStatus?.idTagLocalAuthorized === true &&
+      connectorStatus.localAuthorizeIdTag != null &&
       connectorStatus.localAuthorizeIdTag !== requestPayload.idTag
     ) {
       logger.error(