commandPayload: ResetRequest,
): GenericResponse {
const { type } = commandPayload;
- this.runInAsyncScope(
- chargingStation.reset.bind(chargingStation) as (
- this: ChargingStation,
- ...args: unknown[]
- ) => Promise<void>,
- chargingStation,
- `${type}Reset` as OCPP16StopTransactionReason,
- ).catch(Constants.EMPTY_FUNCTION);
+ chargingStation
+ .reset(`${type}Reset` as OCPP16StopTransactionReason)
+ .catch(Constants.EMPTY_FUNCTION);
logger.info(
`${chargingStation.logPrefix()} ${type} reset command received, simulating it. The station will be back online in ${formatDurationMilliSeconds(
chargingStation.stationInfo.resetTime!,
retrieveDate = convertToDate(retrieveDate)!;
const now = Date.now();
if (retrieveDate?.getTime() <= now) {
- this.runInAsyncScope(
- this.updateFirmwareSimulation.bind(this) as (
- this: OCPP16IncomingRequestService,
- ...args: unknown[]
- ) => Promise<void>,
- this,
- chargingStation,
- ).catch(Constants.EMPTY_FUNCTION);
+ this.updateFirmwareSimulation(chargingStation).catch(Constants.EMPTY_FUNCTION);
} else {
setTimeout(
() => {
- this.runInAsyncScope(
- this.updateFirmwareSimulation.bind(this) as (
- this: OCPP16IncomingRequestService,
- ...args: unknown[]
- ) => Promise<void>,
- this,
- chargingStation,
- ).catch(Constants.EMPTY_FUNCTION);
+ this.updateFirmwareSimulation(chargingStation).catch(Constants.EMPTY_FUNCTION);
},
retrieveDate?.getTime() - now,
);