evcc-io/assets/js/utils/ocpp.ts
Michael Geers 117963dcb5
OCPP UI: improve setup flow (#24453)
Co-authored-by: andig <andi@evcc.io>
2025-12-14 11:02:43 +01:00

13 lines
397 B
TypeScript

import type { Ocpp } from "@/types/evcc";
export function getOcppUrl(ocpp: Ocpp): string {
// User specified url, e.g., for reverse proxy setups
if (ocpp.status.externalUrl) {
return ocpp.status.externalUrl;
}
return `ws://${window.location.hostname}:${ocpp.config.port}/`;
}
export function getOcppUrlWithStationId(ocpp: Ocpp): string {
return `${getOcppUrl(ocpp)}<stationId>`;
}