repositories
/
e-mobility-charging-stations-simulator.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
docs: fix README.md formatting
[e-mobility-charging-stations-simulator.git]
/
src
/
charging-station
/
ChargingStation.ts
diff --git
a/src/charging-station/ChargingStation.ts
b/src/charging-station/ChargingStation.ts
index aa68abdf346cdc251f99cc856708e173a7cc0cb4..36cd0958fffe778f3cb68c0402be8b3285f58f4f 100644
(file)
--- a/
src/charging-station/ChargingStation.ts
+++ b/
src/charging-station/ChargingStation.ts
@@
-711,7
+711,10
@@
export class ChargingStation extends EventEmitter {
}
}
}
}
- public async stop (reason?: StopTransactionReason, stopTransactions?: boolean): Promise<void> {
+ public async stop (
+ reason?: StopTransactionReason,
+ stopTransactions = this.stationInfo?.stopTransactionsOnStopped
+ ): Promise<void> {
if (this.started) {
if (!this.stopping) {
this.stopping = true
if (this.started) {
if (!this.stopping) {
this.stopping = true
@@
-1169,7
+1172,7
@@
export class ChargingStation extends EventEmitter {
stationInfo.resetTime =
stationTemplate.resetTime != null
? secondsToMilliseconds(stationTemplate.resetTime)
stationInfo.resetTime =
stationTemplate.resetTime != null
? secondsToMilliseconds(stationTemplate.resetTime)
- : Constants.
CHARGING_STATION_DEFAULT
_RESET_TIME
+ : Constants.
DEFAULT_CHARGING_STATION
_RESET_TIME
return stationInfo
}
return stationInfo
}
@@
-1865,7
+1868,10
@@
export class ChargingStation extends EventEmitter {
this.emit(ChargingStationEvents.updated)
}
this.emit(ChargingStationEvents.updated)
}
- private getCachedRequest (messageType: MessageType, messageId: string): CachedRequest | undefined {
+ private getCachedRequest (
+ messageType: MessageType | undefined,
+ messageId: string
+ ): CachedRequest | undefined {
const cachedRequest = this.requests.get(messageId)
if (Array.isArray(cachedRequest)) {
return cachedRequest
const cachedRequest = this.requests.get(messageId)
if (Array.isArray(cachedRequest)) {
return cachedRequest
@@
-2028,8
+2034,8
@@
export class ChargingStation extends EventEmitter {
commandName ?? requestCommandName ?? Constants.UNKNOWN_COMMAND
// eslint-disable-next-line @typescript-eslint/no-base-to-string
}' message '${data.toString()}'${
commandName ?? requestCommandName ?? Constants.UNKNOWN_COMMAND
// eslint-disable-next-line @typescript-eslint/no-base-to-string
}' message '${data.toString()}'${
- messageType !== MessageType.CALL_MESSAGE
- ? ` matching cached request '${JSON.stringify(this.
requests.get(
messageId))}'`
+ this.requests.has(messageId)
+ ? ` matching cached request '${JSON.stringify(this.
getCachedRequest(messageType,
messageId))}'`
: ''
} processing error:`,
error
: ''
} processing error:`,
error
@@
-2222,7
+2228,7
@@
export class ChargingStation extends EventEmitter {
private async stopMessageSequence (
reason?: StopTransactionReason,
private async stopMessageSequence (
reason?: StopTransactionReason,
- stopTransactions
= this.stationInfo?.stopTransactionsOnStopped
+ stopTransactions
?: boolean
): Promise<void> {
this.internalStopMessageSequence()
// Stop ongoing transactions
): Promise<void> {
this.internalStopMessageSequence()
// Stop ongoing transactions