diff --git a/src/cp/index.ts b/src/cp/index.ts index 53ff46c..cea6cc6 100644 --- a/src/cp/index.ts +++ b/src/cp/index.ts @@ -58,10 +58,10 @@ export default class ChargePoint { private readonly csUrl: string ) { } - async connect(connectArgs: ConnectArgs): Promise>> { + async connect(connectArgs?: ConnectArgs): Promise>> { const url = `${this.csUrl}/${this.id}`; const socket = new WebSocket(url, SUPPORTED_PROTOCOLS, { - auth: `${this.id}:${connectArgs.auth}`, + auth: `${this.id}:${connectArgs?.auth}`, ...connectArgs, });