From fbef114e61463f10530f0a6a437dd967c55326ed Mon Sep 17 00:00:00 2001 From: chakal Date: Fri, 23 Sep 2022 21:39:35 -0400 Subject: [PATCH] Added a definition for the API URL for users outside the US, specifically Canada --- README.md | 4 ++++ src/index.js | 1 + 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 265bc17..19f4f3f 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,10 @@ ONSTAR_PASSWORD= ONSTAR_PIN= MQTT_USERNAME= MQTT_PASSWORD= + +#For Canadian users, specify the canadian end-point as well: +ONSTAR_URL=https://api.gm.ca + ``` ### Node.js It's a typical node.js application, define the same environment values as described in the docker sections and run with: diff --git a/src/index.js b/src/index.js index 0fd66d1..b6bee33 100644 --- a/src/index.js +++ b/src/index.js @@ -15,6 +15,7 @@ const onstarConfig = { username: process.env.ONSTAR_USERNAME, password: process.env.ONSTAR_PASSWORD, onStarPin: process.env.ONSTAR_PIN, + serviceUrl: process.env.ONSTAR_URL || "https://api.gm.com", checkRequestStatus: process.env.ONSTAR_SYNC === "true" || true, refreshInterval: parseInt(process.env.ONSTAR_REFRESH) || (30 * 60 * 1000), // 30 min allowCommands: _.toLower(_.get(process, 'env.ONSTAR_ALLOW_COMMANDS', 'true')) === 'true'