}
public get stationInfo(): ChargingStationInfo {
- return {
+ const stationInfo = {
...{
enableStatistics: false,
remoteAuthorization: true,
},
...this.internalStationInfo,
};
+ Object.defineProperty(stationInfo, 'supervisionUrls', {
+ set: (supervisionUrls: string | string[]) => {
+ this.internalStationInfo.supervisionUrls = supervisionUrls;
+ },
+ get: () => {
+ return this.internalStationInfo.supervisionUrls;
+ },
+ });
+ Object.defineProperty(stationInfo, 'firmwareVersion', {
+ set: (firmwareVersion: string) => {
+ this.internalStationInfo.firmwareVersion = firmwareVersion;
+ },
+ get: () => {
+ return this.internalStationInfo.firmwareVersion;
+ },
+ });
+ Object.defineProperty(stationInfo, 'firmwareStatus', {
+ set: (firmwareStatus: FirmwareStatus) => {
+ this.internalStationInfo.firmwareStatus = firmwareStatus;
+ },
+ get: () => {
+ return this.internalStationInfo.firmwareStatus;
+ },
+ });
+ return stationInfo;
}
private get wsConnectionUrl(): URL {
return stationInfo;
}
- private getStationInfo(): ChargingStationInfo {
+ private getInternalStationInfo(): ChargingStationInfo {
const stationInfoFromTemplate: ChargingStationInfo = this.getStationInfoFromTemplate();
const stationInfoFromFile: ChargingStationInfo | undefined = this.getStationInfoFromFile();
// Priority:
} else {
this.initializeConnectorsOrEvsesFromTemplate(stationTemplate);
}
- this.internalStationInfo = this.getStationInfo();
+ this.internalStationInfo = this.getInternalStationInfo();
if (
this.stationInfo.firmwareStatus === FirmwareStatus.Installing &&
isNotEmptyString(this.stationInfo.firmwareVersion) &&
private getOcppConfigurationFromFile(): ChargingStationOcppConfiguration | undefined {
const configurationKey = this.getConfigurationFromFile()?.configurationKey;
- if (this.stationInfo?.ocppPersistentConfiguration === true && configurationKey) {
+ if (this.stationInfo?.ocppPersistentConfiguration === true && Array.isArray(configurationKey)) {
return { configurationKey };
}
return undefined;
}
}
}
- if (this.stationInfo?.firmwareStatus === FirmwareStatus.Installing) {
+ if (this.stationInfo.firmwareStatus === FirmwareStatus.Installing) {
await this.ocppRequestService.requestHandler<
FirmwareStatusNotificationRequest,
FirmwareStatusNotificationResponse