-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #112 from Hacksore/develop
- Loading branch information
Showing
24 changed files
with
1,317 additions
and
623 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# bluelinky | ||
|
||
An unoffcial nodejs API wrapper for Hyundai BlueLink | ||
An unofficial nodejs API wrapper for Hyundai BlueLink | ||
|
||
[![CI](https://img.shields.io/github/workflow/status/Hacksore/bluelinky/npm)](https://github.com/Hacksore/bluelinky/actions?query=workflow%3Anpm) | ||
[![npm](https://img.shields.io/npm/v/bluelinky.svg)](https://www.npmjs.com/package/bluelinky) | ||
|
@@ -18,6 +18,7 @@ const BlueLinky = require('bluelinky'); | |
const client = new BlueLinky({ | ||
username: '[email protected]', | ||
password: 'hunter1', | ||
brand: 'hyundai', | ||
region: 'US', | ||
pin: '1234' | ||
}); | ||
|
@@ -45,7 +46,8 @@ Ensure you have a `config.json` that matches the structure of the following, wit | |
{ | ||
"username": "email", | ||
"password": "password", | ||
"pin": "ping", | ||
"pin": "pin", | ||
"brand": "kia" or "hyundai", | ||
"vin": "vin" | ||
} | ||
``` | ||
|
@@ -56,12 +58,23 @@ Now you can invoke the debug.ts script with `npm run debug` | |
## Documentation | ||
Checkout out the [bluelinky-docs](https://hacksore.github.io/bluelinky-docs/) for more info. | ||
|
||
Important information for login problems: | ||
- If you experience login problems, please logout from the app on your phone and login again. You might need to ' upgrade ' your account to a generic Kia/Hyundai account, or create a new password or PIN. | ||
- After you migrated your Bluelink account to a generic Hyundai account, or your UVO account to a generic Kia account, make sure that both accounts have the same credentials (userid and password) to avoid confusion in logging in. | ||
|
||
## Supported Features | ||
- Lock | ||
- Unlock | ||
- Start (with climate control) | ||
- Stop | ||
- Status | ||
- Status (full, parsed, cached) | ||
- odometer | ||
- location | ||
- startCharge | ||
- monthlyReport | ||
- tripInfo | ||
- EV: getChargeTargets | ||
- EV: setChargeLimits | ||
|
||
## Supported Regions | ||
| [Regions](https://github.com/Hacksore/bluelinky/wiki/Regions) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,7 @@ describe('BlueLinky', () => { | |
username: '[email protected]', | ||
password: '123', | ||
pin: '1234', | ||
brand: 'hyundai', | ||
region: 'US', | ||
}); | ||
|
||
|
@@ -79,6 +80,7 @@ describe('BlueLinky', () => { | |
username: '[email protected]', | ||
password: 'hunter1', | ||
pin: '1234', | ||
brand: 'hyundai', | ||
region: 'US', | ||
}); | ||
|
||
|
@@ -96,6 +98,7 @@ describe('BlueLinky', () => { | |
username: '[email protected]', | ||
password: 'hunter1', | ||
pin: '1234', | ||
brand: 'hyundai', | ||
region: 'KR', | ||
}); | ||
}).toThrowError('Your region is not supported yet.'); | ||
|
@@ -106,6 +109,7 @@ describe('BlueLinky', () => { | |
username: '[email protected]', | ||
password: 'hunter1', | ||
pin: '1234', | ||
brand: 'hyundai', | ||
region: 'US', | ||
}); | ||
|
||
|
@@ -119,6 +123,7 @@ describe('BlueLinky', () => { | |
username: '[email protected]', | ||
password: 'hunter1', | ||
pin: '1234', | ||
brand: 'hyundai', | ||
region: 'US', | ||
}); | ||
|
||
|
@@ -133,6 +138,7 @@ describe('BlueLinky', () => { | |
username: '[email protected]', | ||
password: 'hunter1', | ||
pin: '1234', | ||
brand: 'hyundai', | ||
region: 'US', | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ const getController = region => { | |
username: '[email protected]', | ||
password: 'test', | ||
region: 'US', | ||
brand: 'hyundai', | ||
autoLogin: true, | ||
pin: '1234', | ||
vin: '4444444444444', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,30 @@ | ||
//TODO: Someone needs to figure out the Kia endpoints | ||
// we can then make a fork easier to maintain | ||
import { Brand } from '../interfaces/common.interfaces'; | ||
|
||
export const API_HOST = 'api.telematics.hyundaiusa.com'; | ||
export interface AmericaBrandEnvironment { | ||
brand: Brand; | ||
host: string; | ||
baseUrl: string; | ||
clientId: string; | ||
clientSecret: string; | ||
} | ||
|
||
export const BASE_URL = `https://${API_HOST}`; | ||
export const CLIENT_ID = '815c046afaa4471aa578827ad546cc76'; | ||
export const CLIENT_SECRET = 'GXZveJJAVTehh/OtakM3EQ=='; | ||
const getHyundaiEnvironment = (): AmericaBrandEnvironment => { | ||
const host = 'api.telematics.hyundaiusa.com'; | ||
const baseUrl = `https://${host}`; | ||
return { | ||
brand: 'hyundai', | ||
host, | ||
baseUrl, | ||
clientId: '815c046afaa4471aa578827ad546cc76', | ||
clientSecret: 'GXZveJJAVTehh/OtakM3EQ==', | ||
}; | ||
}; | ||
|
||
export const getBrandEnvironment = (brand: Brand): AmericaBrandEnvironment => { | ||
switch (brand) { | ||
case 'hyundai': | ||
return Object.freeze(getHyundaiEnvironment()); | ||
default: | ||
throw new Error(`Constructor ${brand} is not managed.`); | ||
} | ||
}; |
Oops, something went wrong.