chargingStation: ChargingStation,
commandPayload: ResetRequest
): DefaultResponse {
- // eslint-disable-next-line @typescript-eslint/no-misused-promises
- setImmediate(async (): Promise<void> => {
- await chargingStation.reset((commandPayload.type + 'Reset') as OCPP16StopTransactionReason);
- });
+ this.asyncResource.runInAsyncScope(
+ chargingStation.reset.bind(chargingStation) as (
+ this: ChargingStation,
+ ...args: any[]
+ ) => void,
+ chargingStation,
+ (commandPayload.type + 'Reset') as OCPP16StopTransactionReason
+ );
logger.info(
`${chargingStation.logPrefix()} ${
commandPayload.type
return Constants.OCPP_RESPONSE_ACCEPTED;
}
- private handleRequestClearCache(): DefaultResponse {
+ private handleRequestClearCache(chargingStation: ChargingStation): DefaultResponse {
+ chargingStation.authorizedTagsCache.deleteAuthorizedTags(
+ ChargingStationUtils.getAuthorizationFile(chargingStation.stationInfo)
+ );
return Constants.OCPP_RESPONSE_ACCEPTED;
}
commandPayload: ClearChargingProfileRequest
): ClearChargingProfileResponse {
if (
- !OCPP16ServiceUtils.checkFeatureProfile(
+ OCPP16ServiceUtils.checkFeatureProfile(
chargingStation,
OCPP16SupportedFeatureProfiles.SmartCharging,
OCPP16IncomingRequestCommand.CLEAR_CHARGING_PROFILE
- )
+ ) === false
) {
return Constants.OCPP_CLEAR_CHARGING_PROFILE_RESPONSE_UNKNOWN;
}