deleteConfigurationKey,
getConfigurationKey,
setConfigurationKeyValue,
-} from './ChargingStationConfigurationUtils';
+} from './ChargingStationConfigurationKeyUtils';
import {
buildConnectorsMap,
checkConnectorsConfiguration,
getIdTagsFile,
getMaxNumberOfEvses,
getPhaseRotationValue,
+ hasFeatureProfile,
initializeConnectorsMapStatus,
propagateSerialNumber,
stationTemplateToStationInfo,
if (this.getEnableStatistics() === true) {
this.performanceStatistics?.start();
}
- if (this.hasFeatureProfile(SupportedFeatureProfiles.Reservation)) {
+ if (hasFeatureProfile(this, SupportedFeatureProfiles.Reservation)) {
this.startReservationExpirationSetInterval();
}
this.openWSConnection();
if (this.getEnableStatistics() === true) {
this.performanceStatistics?.stop();
}
+ if (hasFeatureProfile(this, SupportedFeatureProfiles.Reservation)) {
+ this.stopReservationExpirationSetInterval();
+ }
this.sharedLRUCache.deleteChargingStationConfiguration(this.configurationFileHash);
this.templateFileWatcher?.close();
this.sharedLRUCache.deleteChargingStationTemplate(this.templateFileHash);
}
}
- public hasFeatureProfile(featureProfile: SupportedFeatureProfiles): boolean | undefined {
- return getConfigurationKey(
- this,
- StandardParametersKey.SupportedFeatureProfiles,
- )?.value?.includes(featureProfile);
- }
-
public bufferMessage(message: string): void {
this.messageBuffer.add(message);
}
const connector = this.getConnectorStatus(reservation.connectorId)!;
switch (reason) {
case ReservationTerminationReason.CONNECTOR_STATE_CHANGED:
- delete connector.reservation;
- break;
case ReservationTerminationReason.TRANSACTION_STARTED:
delete connector.reservation;
break;
): [boolean, Reservation | undefined] {
const foundReservation = this.getReservationBy(
ReservationFilterKey.RESERVATION_ID,
- reservation.id!,
+ reservation.reservationId!,
);
return isUndefined(foundReservation) ? [false, undefined] : [true, foundReservation];
}
private getNumberOfReservationsOnConnectorZero(): number {
let numberOfReservations = 0;
- if (this.hasEvses && this.evses.get(0)?.connectors.get(0)?.reservation) {
- ++numberOfReservations;
- } else if (this.connectors.get(0)?.reservation) {
+ if (
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
+ (this.hasEvses && this.evses.get(0)?.connectors.get(0)?.reservation) ||
+ (!this.hasEvses && this.connectors.get(0)?.reservation)
+ ) {
++numberOfReservations;
}
return numberOfReservations;