iobroker.bmw 2.6.0 → 2.6.2

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,10 +1,14 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "bmw",
4
- "version": "2.6.0",
4
+ "version": "2.6.2",
5
5
  "news": {
6
- "2.6.0": {
7
- "en": "Fix Status Updat. New status under bmw.0.VIN.state",
6
+ "2.6.2": {
7
+ "en": "Fix Charging response parsing",
8
+ "de": "Fix Charging Antwort Verarbeitung"
9
+ },
10
+ "2.6.1": {
11
+ "en": "Fix Status Update. New status under bmw.0.VIN.state",
8
12
  "de": "Status Update gefixt. Neuer Status unter bmw.0.VIN.state"
9
13
  },
10
14
  "2.5.7": {
package/main.js CHANGED
@@ -13,7 +13,6 @@ const { HttpsCookieAgent } = require("http-cookie-agent/http");
13
13
  const crypto = require("crypto");
14
14
  const qs = require("qs");
15
15
  const Json2iob = require("json2iob");
16
- const { extractKeys } = require("./lib/extractKeys");
17
16
  const tough = require("tough-cookie");
18
17
  class Bmw extends utils.Adapter {
19
18
  /**
@@ -33,7 +32,6 @@ class Bmw extends utils.Adapter {
33
32
  this.updateInterval;
34
33
  this.reLoginTimeout;
35
34
  this.refreshTokenInterval;
36
- this.extractKeys = extractKeys;
37
35
  this.vinArray = [];
38
36
  this.session = {};
39
37
  this.statusBlock = {};
@@ -283,7 +281,7 @@ class Bmw extends utils.Adapter {
283
281
  this.log.error(JSON.stringify(error.response.data));
284
282
  return;
285
283
  }
286
- if (error.response.status === 302) {
284
+ if (error.response && error.response.status === 302) {
287
285
  this.log.debug(JSON.stringify(error.response.headers.location));
288
286
  code = qs.parse(error.response.headers.location.split("?")[1]).code;
289
287
  this.log.debug(code);
@@ -369,7 +367,7 @@ class Bmw extends utils.Adapter {
369
367
  native: {},
370
368
  });
371
369
 
372
- this.extractKeys(this, vehicle.vin + ".general", vehicle);
370
+ this.json2iob.parse(vehicle.vin + ".general", vehicle);
373
371
  }
374
372
  })
375
373
  .catch((error) => {
@@ -450,7 +448,6 @@ class Bmw extends utils.Adapter {
450
448
  native: {},
451
449
  });
452
450
  });
453
- // this.extractKeys(this, vehicle.vin, vehicle, null, true);
454
451
  this.json2iob.parse(vehicle.vin, vehicle, {
455
452
  forceIndex: true,
456
453
  descriptions: this.description,
@@ -555,7 +552,7 @@ class Bmw extends utils.Adapter {
555
552
  },
556
553
  native: {},
557
554
  });
558
- await this.extractKeys(this, vin + element.path + dateFormatted, data);
555
+ await this.json2iob.parse(vin + element.path + dateFormatted, data);
559
556
 
560
557
  if (element.name === "chargingSessions" && data.sessions && data.sessions.length > 0) {
561
558
  try {
@@ -575,7 +572,7 @@ class Bmw extends utils.Adapter {
575
572
  },
576
573
  native: {},
577
574
  });
578
- await this.extractKeys(this, vin + element.path + "latest", datal);
575
+ await this.json2iob.parse(vin + element.path + "latest", datal);
579
576
  } catch (error) {
580
577
  this.log.debug(error);
581
578
  }
@@ -698,7 +695,7 @@ class Bmw extends utils.Adapter {
698
695
  let command = id.split(".")[4];
699
696
  if (command === "force-refresh") {
700
697
  this.log.info("force refresh");
701
- this.getVehiclesv2();
698
+ this.updateDevices();
702
699
  return;
703
700
  }
704
701
  const action = command.split("_")[1];
@@ -736,7 +733,7 @@ class Bmw extends utils.Adapter {
736
733
  });
737
734
  this.refreshTimeout = setTimeout(async () => {
738
735
  this.log.info("Refresh values");
739
- await this.getVehiclesv2();
736
+ await this.updateDevices();
740
737
  }, 10 * 1000);
741
738
  } else {
742
739
  // const resultDict = { chargingStatus: "CHARGE_NOW", doorLockState: "DOOR_LOCK" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.bmw",
3
- "version": "2.6.0",
3
+ "version": "2.6.2",
4
4
  "description": "Adapter for BMW",
5
5
  "author": {
6
6
  "name": "TA2k",
@@ -20,7 +20,7 @@
20
20
  "axios": "^1.4.0",
21
21
  "http-cookie-agent": "^5.0.4",
22
22
  "json-bigint": "^1.0.0",
23
- "json2iob": "^2.4.4",
23
+ "json2iob": "^2.4.5",
24
24
  "qs": "^6.11.2",
25
25
  "tough-cookie": "^4.1.3"
26
26
  },
@@ -29,13 +29,13 @@
29
29
  "@types/chai": "^4.3.5",
30
30
  "@types/chai-as-promised": "^7.1.5",
31
31
  "@types/mocha": "^10.0.1",
32
- "@types/node": "^18.16.18",
32
+ "@types/node": "^18.17.3",
33
33
  "@types/proxyquire": "^1.3.28",
34
- "@types/sinon": "^10.0.15",
34
+ "@types/sinon": "^10.0.16",
35
35
  "@types/sinon-chai": "^3.2.9",
36
36
  "chai": "^4.3.7",
37
37
  "chai-as-promised": "^7.1.1",
38
- "eslint": "^8.43.0",
38
+ "eslint": "^8.46.0",
39
39
  "mocha": "^10.2.0",
40
40
  "proxyquire": "^2.1.3",
41
41
  "sinon": "^15.2.0",