iobroker.bmw 2.8.1 → 2.8.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/README.md CHANGED
@@ -25,6 +25,10 @@ bmw.0.VIN.properties
25
25
  bmw.0.VIN.remotev2
26
26
 
27
27
  ## Changelog
28
+ ### 2.8.2 (2024-10-05)
29
+
30
+ - fix error getvehicles v2 failed
31
+
28
32
  ### 2.8.1 (2024-09-30)
29
33
 
30
34
  - fix remote commands
@@ -1,101 +1,108 @@
1
1
  <html>
2
- <head>
3
- <!-- Load ioBroker scripts and styles-->
4
- <link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
5
- <link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css" />
2
+ <head>
3
+ <!-- Load ioBroker scripts and styles-->
4
+ <link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
5
+ <link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css" />
6
6
 
7
- <script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
8
- <script type="text/javascript" src="../../socket.io/socket.io.js"></script>
7
+ <script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
8
+ <script type="text/javascript" src="../../socket.io/socket.io.js"></script>
9
9
 
10
- <script type="text/javascript" src="../../js/translate.js"></script>
11
- <script type="text/javascript" src="../../lib/js/materialize.js"></script>
12
- <script type="text/javascript" src="../../js/adapter-settings.js"></script>
10
+ <script type="text/javascript" src="../../js/translate.js"></script>
11
+ <script type="text/javascript" src="../../lib/js/materialize.js"></script>
12
+ <script type="text/javascript" src="../../js/adapter-settings.js"></script>
13
13
 
14
- <!-- Load our own files -->
15
- <link rel="stylesheet" type="text/css" href="style.css" />
16
- <script type="text/javascript" src="words.js"></script>
14
+ <!-- Load our own files -->
15
+ <link rel="stylesheet" type="text/css" href="style.css" />
16
+ <script type="text/javascript" src="words.js"></script>
17
17
 
18
- <script type="text/javascript">
19
- // This will be called by the admin adapter when the settings page loads
20
- function load(settings, onChange) {
21
- // example: select elements with id=key and class=value and insert value
22
- if (!settings) return;
23
- $(".value").each(function () {
24
- var $key = $(this);
25
- var id = $key.attr("id");
26
- if ($key.attr("type") === "checkbox") {
27
- // do not call onChange direct, because onChange could expect some arguments
28
- $key.prop("checked", settings[id]).on("change", () => onChange());
29
- } else {
30
- // do not call onChange direct, because onChange could expect some arguments
31
- $key.val(settings[id])
32
- .on("change", () => onChange())
33
- .on("keyup", () => onChange());
34
- }
35
- });
36
- onChange(false);
37
- // reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
38
- if (M) M.updateTextFields();
39
- }
18
+ <script type="text/javascript">
19
+ // This will be called by the admin adapter when the settings page loads
20
+ function load(settings, onChange) {
21
+ // example: select elements with id=key and class=value and insert value
22
+ if (!settings) return;
23
+ $('.value').each(function () {
24
+ var $key = $(this);
25
+ var id = $key.attr('id');
26
+ if ($key.attr('type') === 'checkbox') {
27
+ // do not call onChange direct, because onChange could expect some arguments
28
+ $key.prop('checked', settings[id]).on('change', () => onChange());
29
+ } else {
30
+ // do not call onChange direct, because onChange could expect some arguments
31
+ $key
32
+ .val(settings[id])
33
+ .on('change', () => onChange())
34
+ .on('keyup', () => onChange());
35
+ }
36
+ });
37
+ onChange(false);
38
+ // reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
39
+ if (M) M.updateTextFields();
40
+ }
40
41
 
41
- // This will be called by the admin adapter when the user presses the save button
42
- function save(callback) {
43
- // example: select elements with class=value and build settings object
44
- var obj = {};
45
- $(".value").each(function () {
46
- var $this = $(this);
47
- if ($this.attr("type") === "checkbox") {
48
- obj[$this.attr("id")] = $this.prop("checked");
49
- } else if ($this.attr("type") === "number") {
50
- obj[$this.attr("id")] = parseFloat($this.val());
51
- } else {
52
- obj[$this.attr("id")] = $this.val();
53
- }
54
- });
55
- callback(obj);
56
- }
57
- </script>
58
- </head>
42
+ // This will be called by the admin adapter when the user presses the save button
43
+ function save(callback) {
44
+ // example: select elements with class=value and build settings object
45
+ var obj = {};
46
+ $('.value').each(function () {
47
+ var $this = $(this);
48
+ if ($this.attr('type') === 'checkbox') {
49
+ obj[$this.attr('id')] = $this.prop('checked');
50
+ } else if ($this.attr('type') === 'number') {
51
+ obj[$this.attr('id')] = parseFloat($this.val());
52
+ } else {
53
+ obj[$this.attr('id')] = $this.val();
54
+ }
55
+ });
56
+ callback(obj);
57
+ }
58
+ </script>
59
+ </head>
59
60
 
60
- <body>
61
- <div class="m adapter-container">
62
- <div class="row">
63
- <div class="col s12 m4 l2">
64
- <img src="bmw.png" class="logo" />
65
- </div>
66
- </div>
61
+ <body>
62
+ <div class="m adapter-container">
63
+ <div class="row">
64
+ <div class="col s12 m4 l2">
65
+ <img src="bmw.png" class="logo" />
66
+ </div>
67
+ </div>
67
68
 
68
- <!-- Put your content here -->
69
+ <!-- Put your content here -->
69
70
 
70
- <!-- For example columns with settings: -->
71
- <div class="row">
72
- <div class="col s6 input-field">
73
- <input type="text" class="value" id="username" />
74
- <label for="username" class="translate">App Email</label>
75
- </div>
76
- </div>
77
- <div class="row">
78
- <div class="col s6 input-field">
79
- <input type="password" class="value" id="password" />
80
- <label for="password" class="translate">App Password</label>
81
- </div>
82
- </div>
83
- <div class="row">
84
- <div class="col s2 input-field">
85
- <select id="brand" class="value">
86
- <option value="bmw">BMW</option>
87
- <option value="mini">Mini</option>
88
- </select>
89
- <label for="brand" class="translate">Brand</label>
90
- </div>
91
- </div>
71
+ <!-- For example columns with settings: -->
72
+ <div class="row">
73
+ <div class="col s6 input-field">
74
+ <input type="text" class="value" id="username" />
75
+ <label for="username" class="translate">App Email</label>
76
+ </div>
77
+ </div>
78
+ <div class="row">
79
+ <div class="col s6 input-field">
80
+ <input type="password" class="value" id="password" />
81
+ <label for="password" class="translate">App Password</label>
82
+ </div>
83
+ </div>
84
+ <div class="row">
85
+ <div class="col s2 input-field">
86
+ <select id="brand" class="value">
87
+ <option value="bmw">BMW</option>
88
+ <option value="mini">Mini</option>
89
+ </select>
90
+ <label for="brand" class="translate">Brand</label>
91
+ </div>
92
+ </div>
92
93
 
93
- <div class="row">
94
- <div class="col s2 input-field">
95
- <input type="number" class="value" id="interval" />
96
- <label for="interval" class="translate">Update interval (in minutes)"</label>
97
- </div>
98
- </div>
94
+ <div class="row">
95
+ <div class="col s2 input-field">
96
+ <input type="number" class="value" id="interval" />
97
+ <label for="interval" class="translate">Update interval (in minutes)"</label>
98
+ </div>
99
+ </div>
100
+ <div class="row">
101
+ <div class="col s6 input-field">
102
+ <input type="text" class="value" id="ignorelist" />
103
+ <label for="ignorelist" class="translate">VIN Ignore List</label>
99
104
  </div>
100
- </body>
105
+ </div>
106
+ </div>
107
+ </body>
101
108
  </html>
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "bmw",
4
- "version": "2.8.1",
4
+ "version": "2.8.2",
5
5
  "news": {
6
+ "2.8.2": {
7
+ "en": "fix error getvehicles v2 failed",
8
+ "de": "fehlerbehebung v2 versagt",
9
+ "ru": "ошибка фиксации",
10
+ "pt": "corrigir erro getvehicles v2 falhou",
11
+ "nl": "fix error get vehicles v2 is mislukt",
12
+ "fr": "erreur de correction getvéhicules v2 échoué",
13
+ "it": "errore di correzione getvehicles v2 guasto",
14
+ "es": "error de corrección getvehicles v2 fallado",
15
+ "pl": "naprawić błąd getvehicles v2 nie powiodło się",
16
+ "uk": "виправлення помилок getvehicles v2 не вдалося",
17
+ "zh-cn": "修补错误获得车辆 v2 失败"
18
+ },
6
19
  "2.8.1": {
7
20
  "en": "fix for remote commands",
8
21
  "de": "Fix für Remote Commands",
@@ -35,10 +48,6 @@
35
48
  "2.6.2": {
36
49
  "en": "Fix Charging response parsing",
37
50
  "de": "Fix Charging Antwort Verarbeitung"
38
- },
39
- "2.6.1": {
40
- "en": "Fix Status Update. New status under bmw.0.VIN.state",
41
- "de": "Status Update gefixt. Neuer Status unter bmw.0.VIN.state"
42
51
  }
43
52
  },
44
53
  "titleLang": {
@@ -67,8 +76,12 @@
67
76
  "uk": "Adapter for BMW",
68
77
  "zh-cn": "宝马适配器"
69
78
  },
70
- "authors": ["TA2k <tombox2020@gmail.com>"],
71
- "keywords": ["BMW"],
79
+ "authors": [
80
+ "TA2k <tombox2020@gmail.com>"
81
+ ],
82
+ "keywords": [
83
+ "BMW"
84
+ ],
72
85
  "license": "MIT",
73
86
  "platform": "Javascript/Node.js",
74
87
  "main": "main.js",
@@ -99,13 +112,18 @@
99
112
  }
100
113
  ]
101
114
  },
102
- "encryptedNative": ["password"],
103
- "protectedNative": ["password"],
115
+ "encryptedNative": [
116
+ "password"
117
+ ],
118
+ "protectedNative": [
119
+ "password"
120
+ ],
104
121
  "native": {
105
122
  "username": "",
106
123
  "password": "",
107
124
  "interval": 5,
108
- "brand": "bmw"
125
+ "brand": "bmw",
126
+ "ignorelist": ""
109
127
  },
110
128
  "objects": [],
111
129
  "instanceObjects": [
package/main.js CHANGED
@@ -378,6 +378,14 @@ class Bmw extends utils.Adapter {
378
378
  return;
379
379
  }
380
380
  for (const vehicle of res.data) {
381
+ if (this.config.ignorelist) {
382
+ this.log.info('Ignorelist found');
383
+ const ignoreListArray = this.config.ignorelist.replace(/\s/g, '').split(',');
384
+ if (ignoreListArray.includes(vehicle.vin)) {
385
+ this.log.info('Ignore ' + vehicle.vin);
386
+ continue;
387
+ }
388
+ }
381
389
  this.vinArray.push(vehicle.vin);
382
390
  await this.extendObjectAsync(vehicle.vin, {
383
391
  type: 'device',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.bmw",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "description": "Adapter for BMW",
5
5
  "author": {
6
6
  "name": "TA2k",