}
this.connectorsStatus.get(connectorId).lastRunDate = new Date();
}
- await this.stopTransaction(connectorId);
+ // await this.stopTransaction(connectorId);
this.connectorsStatus.get(connectorId).stoppedDate = new Date();
logger.info(
this.logPrefix(connectorId) +
this?.connectorsStatus.get(connectorId)?.rejectedStartTransactionRequests ?? 0;
this.connectorsStatus.get(connectorId).stopTransactionRequests =
this?.connectorsStatus.get(connectorId)?.stopTransactionRequests ?? 0;
+ this.connectorsStatus.get(connectorId).acceptedStopTransactionRequests =
+ this?.connectorsStatus.get(connectorId)?.acceptedStopTransactionRequests ?? 0;
+ this.connectorsStatus.get(connectorId).rejectedStopTransactionRequests =
+ this?.connectorsStatus.get(connectorId)?.rejectedStopTransactionRequests ?? 0;
this.connectorsStatus.get(connectorId).skippedConsecutiveTransactions = 0;
this.connectorsStatus.get(connectorId).skippedTransactions =
this?.connectorsStatus.get(connectorId)?.skippedTransactions ?? 0;
const measureId = 'StopTransaction with ATG';
const beginId = PerformanceStatistics.beginMeasure(measureId);
let stopResponse: StopTransactionResponse;
- if (this.chargingStation.getConnectorStatus(connectorId)?.transactionStarted) {
+ if (this.chargingStation.getConnectorStatus(connectorId)?.transactionStarted === true) {
stopResponse = await this.chargingStation.stopTransactionOnConnector(connectorId, reason);
this.connectorsStatus.get(connectorId).stopTransactionRequests++;
+ if (stopResponse.idTagInfo?.status === AuthorizationStatus.ACCEPTED) {
+ this.connectorsStatus.get(connectorId).acceptedStopTransactionRequests++;
+ } else {
+ this.connectorsStatus.get(connectorId).rejectedStopTransactionRequests++;
+ }
} else {
const transactionId = this.chargingStation.getConnectorStatus(connectorId).transactionId;
logger.warn(
return this.connectors.get(0) ? this.connectors.size - 1 : this.connectors.size;
}
- public getConnectorStatus(id: number): ConnectorStatus {
+ public getConnectorStatus(id: number): ConnectorStatus | undefined {
return this.connectors.get(id);
}
// Stop heartbeat
this.stopHeartbeat();
// Stop the ATG if needed
- if (this.automaticTransactionGenerator?.configuration?.stopOnConnectionFailure) {
+ if (this.automaticTransactionGenerator?.configuration?.stopOnConnectionFailure === true) {
this.stopAutomaticTransactionGenerator();
}
if (
);
this.wsConnectionRestarted = true;
} else if (this.getAutoReconnectMaxRetries() !== -1) {
+ await this.stopMessageSequence(StopTransactionReason.OTHER);
logger.error(
`${this.logPrefix()} WebSocket reconnect failure: maximum retries reached (${
this.autoReconnectRetryCount
responses: [responsePayload],
});
} else if (
- this.responses.get(uuid)?.responsesReceived + 1 <
- this.responses.get(uuid)?.responsesExpected
+ this.responses.get(uuid)?.responsesReceived <= this.responses.get(uuid)?.responsesExpected
) {
this.responses.get(uuid).responsesReceived++;
this.responses.get(uuid).responses.push(responsePayload);
- } else if (
- this.responses.get(uuid)?.responsesReceived + 1 ===
- this.responses.get(uuid)?.responsesExpected
+ }
+ if (
+ this.responses.get(uuid)?.responsesReceived === this.responses.get(uuid)?.responsesExpected
) {
- this.responses.get(uuid).responses.push(responsePayload);
this.uiService.sendResponse(uuid, this.buildResponsePayload(uuid));
this.responses.delete(uuid);
this.uiService.deleteBroadcastChannelRequest(uuid);
if (chargingStation.stationInfo.powerSharedByConnectors) {
chargingStation.powerDivider--;
}
+ chargingStation.resetConnectorStatus(transactionConnectorId);
logger.info(
chargingStation.logPrefix() +
' Transaction ' +
'#' +
transactionConnectorId.toString()
);
- chargingStation.resetConnectorStatus(transactionConnectorId);
} else {
logger.warn(
chargingStation.logPrefix() +
error
);
});
- if (!this.uiServices.has(version)) {
+ if (this.uiServices.has(version) === false) {
this.uiServices.set(version, UIServiceFactory.getUIServiceImplementation(version, this));
}
if (req.method === 'POST') {
);
ws.close(WebSocketCloseEventStatusCode.CLOSE_PROTOCOL_ERROR);
}
- if (!this.uiServices.has(version)) {
+ if (this.uiServices.has(version) === false) {
this.uiServices.set(version, UIServiceFactory.getUIServiceImplementation(version, this));
}
ws.on('message', (rawData) => {
acceptedStartTransactionRequests?: number;
rejectedStartTransactionRequests?: number;
stopTransactionRequests?: number;
+ acceptedStopTransactionRequests?: number;
+ rejectedStopTransactionRequests?: number;
skippedConsecutiveTransactions?: number;
skippedTransactions?: number;
};
acceptedStartTransactionRequests?: number;
rejectedStartTransactionRequests?: number;
stopTransactionRequests?: number;
+ acceptedStopTransactionRequests?: number;
+ rejectedStopTransactionRequests?: number;
skippedConsecutiveTransactions?: number;
skippedTransactions?: number;
};