@eiannone/tesla-api 1.18.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/TeslaApi.js +6 -2
- package/examples/get-vehicle.js +7 -0
- package/package.json +5 -2
package/TeslaApi.js
CHANGED
|
@@ -62,7 +62,9 @@ class TeslaApi {
|
|
|
62
62
|
const req = request(BASE_URL + "/api/1/vehicles/" + path, {
|
|
63
63
|
headers: headers,
|
|
64
64
|
timeout: this.timeout,
|
|
65
|
-
method: method
|
|
65
|
+
method: method,
|
|
66
|
+
minVersion: 'TLSv1.3',
|
|
67
|
+
maxVersion: 'TLSv1.3'
|
|
66
68
|
}, res => {
|
|
67
69
|
if (res.statusCode > 199 && res.statusCode < 300) {
|
|
68
70
|
res.setEncoding('utf8');
|
|
@@ -146,7 +148,9 @@ class TeslaApi {
|
|
|
146
148
|
'Content-Length': postData.length
|
|
147
149
|
},
|
|
148
150
|
timeout: 30000,
|
|
149
|
-
method: 'POST'
|
|
151
|
+
method: 'POST',
|
|
152
|
+
minVersion: 'TLSv1.3',
|
|
153
|
+
maxVersion: 'TLSv1.3'
|
|
150
154
|
}, res => {
|
|
151
155
|
if (res.statusCode > 199 && res.statusCode < 300) {
|
|
152
156
|
res.setEncoding('utf8');
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import {TeslaApi} from '../TeslaApi.js';
|
|
2
|
+
|
|
3
|
+
const ACCESS_TOKEN = '123456789abcdef'; // Replace with your actual access token
|
|
4
|
+
const VEHICLE_ID = '1234567890'; // Replace with your actual vehicle ID
|
|
5
|
+
|
|
6
|
+
const api = new TeslaApi(ACCESS_TOKEN, VEHICLE_ID);
|
|
7
|
+
api.getVehicle().then(console.log);
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eiannone/tesla-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
4
4
|
"description": "Nodejs Tesla API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"author": "Emanuele Iannone",
|
|
8
8
|
"license": "MIT",
|
|
9
|
-
"repository":
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/eiannone/tesla-api.git"
|
|
12
|
+
},
|
|
10
13
|
"dependencies": {
|
|
11
14
|
"ws": "^8.2.3"
|
|
12
15
|
}
|