iobroker.bmw 2.5.3 → 2.5.4

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/io-package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "bmw",
4
- "version": "2.5.3",
4
+ "version": "2.5.4",
5
5
  "news": {
6
+ "2.5.4": {
7
+ "en": "Fix login"
8
+ },
6
9
  "2.5.3": {
7
10
  "en": "Fix login"
8
11
  },
package/main.js CHANGED
@@ -26,6 +26,9 @@ class Bmw extends utils.Adapter {
26
26
  this.on("ready", this.onReady.bind(this));
27
27
  this.on("stateChange", this.onStateChange.bind(this));
28
28
  this.on("unload", this.onUnload.bind(this));
29
+ this.userAgent = "My%20BMW/8932 CFNetwork/978.0.7 Darwin/18.7.0";
30
+ this.userAgentDart = "Dart/2.14 (dart:io)";
31
+ this.xuserAgent = "android(SP1A.210812.016.C1);brand;2.5.2(14945);row";
29
32
  }
30
33
 
31
34
  /**
@@ -171,7 +174,7 @@ class Bmw extends utils.Adapter {
171
174
  withCredentials: true,
172
175
  headers: {
173
176
  "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
174
- "User-Agent": "My%20BMW/8932 CFNetwork/978.0.7 Darwin/18.7.0",
177
+ "User-Agent": this.userAgent,
175
178
  Accept: "*/*",
176
179
  "Accept-Language": "de-de",
177
180
  Authorization: "Basic MzFjMzU3YTAtN2ExZC00NTkwLWFhOTktMzNiOTcyNDRkMDQ4OmMwZTMzOTNkLTcwYTItNGY2Zi05ZDNjLTg1MzBhZjY0ZDU1Mg==",
@@ -254,8 +257,8 @@ class Bmw extends utils.Adapter {
254
257
  const brands = ["bmw", "mini"];
255
258
  for (const brand of brands) {
256
259
  const headers = {
257
- "user-agent": "Dart/2.10 (dart:io)",
258
- "x-user-agent": "android(v1.07_20200330);" + brand + ";1.5.2(8932)",
260
+ "user-agent": this.userAgentDart,
261
+ "x-user-agent": this.xuserAgent.replace(";brand;", `;${brand};`),
259
262
  authorization: "Bearer " + this.session.access_token,
260
263
  "accept-language": "de-DE",
261
264
  host: "cocoapi.bmwgroup.com",
@@ -324,6 +327,7 @@ class Bmw extends utils.Adapter {
324
327
  .catch((error) => {
325
328
  this.log.error("getvehicles v2 failed");
326
329
  this.log.error(error);
330
+ error.response && this.log.error(JSON.stringify(error.response.data));
327
331
  });
328
332
  }
329
333
  }
@@ -332,8 +336,8 @@ class Bmw extends utils.Adapter {
332
336
  return;
333
337
  }
334
338
  const headers = {
335
- "user-agent": "Dart/2.10 (dart:io)",
336
- "x-user-agent": "android(v1.07_20200330);bmw;1.5.2(8932)",
339
+ "user-agent": this.userAgentDart,
340
+ "x-user-agent": this.xuserAgent.replace(";brand;", `;bmw;`),
337
341
  authorization: "Bearer " + this.session.access_token,
338
342
  "accept-language": "de-DE",
339
343
  "24-hour-format": "true",
@@ -501,8 +505,8 @@ class Bmw extends utils.Adapter {
501
505
  command = command.split("_")[0];
502
506
 
503
507
  const headers = {
504
- "user-agent": "Dart/2.10 (dart:io)",
505
- "x-user-agent": "android(v1.07_20200330);bmw;1.5.2(8932)",
508
+ "user-agent": this.userAgentDart,
509
+ "x-user-agent": this.xuserAgent.replace(";brand;", `;bmw;`),
506
510
  authorization: "Bearer " + this.session.access_token,
507
511
  "accept-language": "de-DE",
508
512
  host: "cocoapi.bmwgroup.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.bmw",
3
- "version": "2.5.3",
3
+ "version": "2.5.4",
4
4
  "description": "Adapter for BMW",
5
5
  "author": {
6
6
  "name": "TA2k",
@@ -24,9 +24,7 @@
24
24
  "tough-cookie": "^4.0.0"
25
25
  },
26
26
  "devDependencies": {
27
- "@alcalzone/release-script": "^2.2.2",
28
- "@iobroker/adapter-dev": "^1.0.0",
29
- "@iobroker/testing": "^2.5.4",
27
+ "@iobroker/testing": "^2.5.6",
30
28
  "@types/chai": "^4.3.0",
31
29
  "@types/chai-as-promised": "^7.1.5",
32
30
  "@types/mocha": "^9.1.0",
@@ -36,12 +34,12 @@
36
34
  "@types/sinon-chai": "^3.2.8",
37
35
  "chai": "^4.3.6",
38
36
  "chai-as-promised": "^7.1.1",
39
- "eslint": "^8.10.0",
40
- "mocha": "^9.2.1",
37
+ "eslint": "^8.13.0",
38
+ "mocha": "^9.2.2",
41
39
  "proxyquire": "^2.1.3",
42
40
  "sinon": "^13.0.1",
43
41
  "sinon-chai": "^3.7.0",
44
- "typescript": "~4.5.5"
42
+ "typescript": "^4.6.3"
45
43
  },
46
44
  "main": "main.js",
47
45
  "scripts": {
@@ -57,4 +55,4 @@
57
55
  "url": "https://github.com/TA2k/ioBroker.bmw/issues"
58
56
  },
59
57
  "readmeFilename": "README.md"
60
- }
58
+ }