Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
Add getter for supervisionUrlOcppKey value
Browse files Browse the repository at this point in the history
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
  • Loading branch information
Jérôme Benoit committed Mar 12, 2022
1 parent 6f6652d commit a59737e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/charging-station/ChargingStation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ export default class ChargingStation {
get wsConnectionUrl(): URL {
return this.getSupervisionUrlOcppConfiguration()
? new URL(
this.getConfigurationKey(
this.stationInfo.supervisionUrlOcppKey ?? VendorDefaultParametersKey.ConnectionUrl
).value +
this.getConfigurationKey(this.getSupervisionUrlOcppKey()).value +
'/' +
this.stationInfo.chargingStationId
)
Expand Down Expand Up @@ -720,6 +718,10 @@ export default class ChargingStation {
}
}

private getSupervisionUrlOcppKey(): string {
return this.stationInfo.supervisionUrlOcppKey ?? VendorDefaultParametersKey.ConnectionUrl;
}

private getSupervisionUrlOcppConfiguration(): boolean {
return this.stationInfo.supervisionUrlOcppConfiguration ?? false;
}
Expand Down Expand Up @@ -951,12 +953,10 @@ export default class ChargingStation {
private initOcppParameters(): void {
if (
this.getSupervisionUrlOcppConfiguration() &&
!this.getConfigurationKey(
this.stationInfo.supervisionUrlOcppKey ?? VendorDefaultParametersKey.ConnectionUrl
)
!this.getConfigurationKey(this.getSupervisionUrlOcppKey())
) {
this.addConfigurationKey(
this.stationInfo.supervisionUrlOcppKey ?? VendorDefaultParametersKey.ConnectionUrl,
this.getSupervisionUrlOcppKey(),
this.getConfiguredSupervisionUrl().href,
{ reboot: true }
);
Expand Down

0 comments on commit a59737e

Please sign in to comment.