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 +4 -0
- package/admin/index_m.html +96 -89
- package/io-package.json +28 -10
- package/main.js +8 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/admin/index_m.html
CHANGED
|
@@ -1,101 +1,108 @@
|
|
|
1
1
|
<html>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
-
|
|
8
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
69
|
+
<!-- Put your content here -->
|
|
69
70
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
-
|
|
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.
|
|
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": [
|
|
71
|
-
|
|
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": [
|
|
103
|
-
|
|
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',
|