iobroker.amtronwallbox 0.2.7 → 0.2.9
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/.releaseconfig.json +3 -0
- package/LICENSE +20 -20
- package/README.md +94 -79
- package/admin/index_m.html +148 -148
- package/admin/words.js +17 -17
- package/io-package.json +169 -169
- package/lib/tools.js +99 -99
- package/main.js +2536 -2536
- package/package.json +4 -2
- package/amtronwallbox.njsproj +0 -121
- package/amtronwallbox.njsproj.user +0 -6
- package/readme.txt +0 -121
- package/todo.txt +0 -11
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022-2023 rg-engineering info@rg-engineering.eu
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-2023 rg-engineering info@rg-engineering.eu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,101 +1,116 @@
|
|
|
1
|
-

|
|
2
|
-
# ioBroker.amtronwallbox
|
|
3
|
-
|
|
4
|
-
 
|
|
5
|
-
[](https://www.npmjs.com/package/iobroker.amtronwallbox)
|
|
6
|
-
[](https://www.npmjs.com/package/iobroker.amtronwallbox)
|
|
7
|
-
|
|
8
|
-
[](https://snyk.io/test/github/rg-engineering/ioBroker.amtronwallbox)
|
|
9
|
-

|
|
10
|
-
|
|
11
|
-
[](https://nodei.co/npm/iobroker.amtronwallbox/)
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
1
|
+

|
|
2
|
+
# ioBroker.amtronwallbox
|
|
3
|
+
|
|
4
|
+
 
|
|
5
|
+
[](https://www.npmjs.com/package/iobroker.amtronwallbox)
|
|
6
|
+
[](https://www.npmjs.com/package/iobroker.amtronwallbox)
|
|
7
|
+
|
|
8
|
+
[](https://snyk.io/test/github/rg-engineering/ioBroker.amtronwallbox)
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
[](https://nodei.co/npm/iobroker.amtronwallbox/)
|
|
12
|
+
|
|
13
|
+

|
|
14
|
+

|
|
15
|
+
|
|
16
|
+

|
|
17
|
+

|
|
18
|
+

|
|
19
|
+

|
|
20
|
+

|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
**This adapter uses Sentry libraries to automatically report exceptions and code errors to the developers.**
|
|
24
|
+
For more details and for information how to disable the error reporting see [Sentry-Plugin Documentation](https://github.com/ioBroker/plugin-sentry#plugin-sentry)! Sentry reporting is used starting with js-controller 3.0.
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
**If you like it, please consider a donation:**
|
|
28
|
+
|
|
29
|
+
[](https://www.paypal.com/donate/?hosted_button_id=34ESBMJ932QZC)
|
|
30
|
+
|
|
31
|
+
The adapter serves as an interface to various [Amtron wallboxes](https://www.mennekes.de/emobility/produkte/amtron-wallboxen/). The data provided by the box is read out and made available as a data point in the adapter.
|
|
32
|
+
The data is only processed locally, a cloud connection is not necessary. For wallboxes that also support write access, the adapter can write data (e.g. charging current).
|
|
33
|
+
The following Amtron wallboxes are supported:
|
|
34
|
+
* Amtron Xtra
|
|
35
|
+
* Amtron ChargeControl
|
|
36
|
+
* Amtron Compact
|
|
37
|
+
|
|
38
|
+
The adapter can manage multiple boxes.
|
|
39
|
+
|
|
40
|
+
## Configuration
|
|
41
|
+
Only the type of box, its IP address and, if necessary, an API key need to be configured.
|
|
42
|
+
|
|
43
|
+

|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
Note: Since the boxes have different interfaces, it may be that not all interfaces work directly. In this case please contact the developer.
|
|
47
|
+
|
|
48
|
+
## known issues
|
|
49
|
+
* please create issues at [github](https://github.com/rg-engineering/ioBroker.amtronwallbox/issues) if you find bugs or whish new features.
|
|
50
|
+
|
|
51
|
+
## Changelog
|
|
52
|
+
|
|
53
|
+
<!--
|
|
54
|
+
Placeholder for the next version (at the beginning of the line):
|
|
55
|
+
### **WORK IN PROGRESS**
|
|
47
56
|
-->
|
|
48
|
-
### 0.2.
|
|
57
|
+
### 0.2.9 (2023-12-16)
|
|
58
|
+
* (René) dependencies updated
|
|
59
|
+
|
|
60
|
+
### 0.2.8 (2023-11-26)
|
|
61
|
+
* (René) role of states overworked
|
|
62
|
+
|
|
63
|
+
### 0.2.7 (2023-11-19)
|
|
49
64
|
* (René) dependencies updated
|
|
50
65
|
|
|
51
|
-
### 0.2.6 (2023-09-23)
|
|
66
|
+
### 0.2.6 (2023-09-23)
|
|
52
67
|
* (René) bug fix for reported exceptions by sentry
|
|
53
68
|
|
|
54
|
-
### 0.2.5 (2023-08-27)
|
|
69
|
+
### 0.2.5 (2023-08-27)
|
|
55
70
|
* (René) smaller bug fixes, see issue #59
|
|
56
71
|
|
|
57
|
-
### 0.2.4 (2023-07-30)
|
|
72
|
+
### 0.2.4 (2023-07-30)
|
|
58
73
|
* (René) dependencies updated
|
|
59
74
|
|
|
60
|
-
### 0.2.3 (2023-06-01)
|
|
75
|
+
### 0.2.3 (2023-06-01)
|
|
61
76
|
* (René) some changes to fullfill requirements to bring the adapter to latest
|
|
62
77
|
|
|
63
|
-
### 0.2.2 (2023-04-07)
|
|
78
|
+
### 0.2.2 (2023-04-07)
|
|
64
79
|
* (René) dependencies updated
|
|
65
80
|
|
|
66
|
-
### 0.2.0 (2023-01-31)
|
|
81
|
+
### 0.2.0 (2023-01-31)
|
|
67
82
|
* (René) see issue #1: write data to XTRA wallbox (experimentel)
|
|
68
83
|
|
|
69
|
-
### 0.1.0 (2022-12-18)
|
|
84
|
+
### 0.1.0 (2022-12-18)
|
|
70
85
|
* (René) see issue #1: support of XTRA
|
|
71
86
|
|
|
72
|
-
### 0.0.3 (2022-08-18)
|
|
73
|
-
* (René) some bug fixes
|
|
74
|
-
* (René) change to cron
|
|
87
|
+
### 0.0.3 (2022-08-18)
|
|
88
|
+
* (René) some bug fixes
|
|
89
|
+
* (René) change to cron
|
|
75
90
|
* (René) update of dependencies
|
|
76
91
|
|
|
77
|
-
### 0.0.1 (2022-05-19)
|
|
92
|
+
### 0.0.1 (2022-05-19)
|
|
78
93
|
* (René) initial release
|
|
79
94
|
|
|
80
|
-
## License
|
|
81
|
-
MIT License
|
|
82
|
-
|
|
83
|
-
Copyright (c) 2022-2023 rg-engineering info@rg-engineering.eu
|
|
84
|
-
|
|
85
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
86
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
87
|
-
in the Software without restriction, including without limitation the rights
|
|
88
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
89
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
90
|
-
furnished to do so, subject to the following conditions:
|
|
91
|
-
|
|
92
|
-
The above copyright notice and this permission notice shall be included in all
|
|
93
|
-
copies or substantial portions of the Software.
|
|
94
|
-
|
|
95
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
96
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
97
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
98
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
99
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
100
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
95
|
+
## License
|
|
96
|
+
MIT License
|
|
97
|
+
|
|
98
|
+
Copyright (c) 2022-2023 rg-engineering info@rg-engineering.eu
|
|
99
|
+
|
|
100
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
101
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
102
|
+
in the Software without restriction, including without limitation the rights
|
|
103
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
104
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
105
|
+
furnished to do so, subject to the following conditions:
|
|
106
|
+
|
|
107
|
+
The above copyright notice and this permission notice shall be included in all
|
|
108
|
+
copies or substantial portions of the Software.
|
|
109
|
+
|
|
110
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
111
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
112
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
113
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
114
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
115
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
101
116
|
SOFTWARE.
|
package/admin/index_m.html
CHANGED
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
<html>
|
|
2
|
-
|
|
3
|
-
<head>
|
|
4
|
-
<!-- Load ioBroker scripts and styles-->
|
|
5
|
-
<link rel="stylesheet" type="text/css" href="../../lib/css/fancytree/ui.fancytree.min.css" />
|
|
6
|
-
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
|
|
7
|
-
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
|
|
8
|
-
|
|
9
|
-
<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
|
|
10
|
-
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
|
11
|
-
|
|
12
|
-
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
|
|
13
|
-
<script type="text/javascript" src="../../lib/js/jquery-ui.min.js"></script>
|
|
14
|
-
<script type="text/javascript" src="../../lib/js/jquery.fancytree-all.min.js"></script>
|
|
15
|
-
|
|
16
|
-
<script type="text/javascript" src="../../js/translate.js"></script>
|
|
17
|
-
|
|
18
|
-
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
|
|
19
|
-
|
|
20
|
-
<!-- my own styles -->
|
|
21
|
-
<link rel="stylesheet" type="text/css" href="style.css" />
|
|
22
|
-
<script type="text/javascript" src="words.js"></script>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
<!-- you have to define 2 functions in the global scope: -->
|
|
26
|
-
<script type="text/javascript">
|
|
27
|
-
|
|
28
|
-
// the function loadSettings has to exist ...
|
|
29
|
-
function load(settings, onChange) {
|
|
30
|
-
|
|
31
|
-
if (!settings) return;
|
|
32
|
-
|
|
33
|
-
// example: select elements with id=key and class=value and insert value
|
|
34
|
-
for (var key in settings) {
|
|
35
|
-
// example: select elements with id=key and class=value and insert value
|
|
36
|
-
if ($('#' + key + '.value').attr('type') == 'checkbox') {
|
|
37
|
-
$('#' + key + '.value').prop('checked', settings[key]).change(function () {
|
|
38
|
-
onChange();
|
|
39
|
-
});
|
|
40
|
-
} else {
|
|
41
|
-
$('#' + key + '.value').val(settings[key]).change(function () {
|
|
42
|
-
onChange();
|
|
43
|
-
}).keyup(function () {
|
|
44
|
-
$(this).trigger('change');
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
myOnChange = onChange;
|
|
50
|
-
// Signal to admin, that no changes yet
|
|
51
|
-
onChange(false);
|
|
52
|
-
|
|
53
|
-
M.updateTextFields();
|
|
54
|
-
|
|
55
|
-
values2table('systems', settings.WallboxSystems, onChange, tableSystemsOnReady);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function tableSystemsOnReady() {
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// ... and the function save has to exist.
|
|
66
|
-
// you have to make sure the callback is called with the settings object as first param!
|
|
67
|
-
function save(callback) {
|
|
68
|
-
// example: select elements with class=value and build settings object
|
|
69
|
-
var obj = {};
|
|
70
|
-
$('.value').each(function () {
|
|
71
|
-
var $this = $(this);
|
|
72
|
-
|
|
73
|
-
var id = $this.attr('id');
|
|
74
|
-
|
|
75
|
-
if ($this.attr('type') === 'checkbox') {
|
|
76
|
-
obj[$this.attr('id')] = $this.prop('checked');
|
|
77
|
-
} else {
|
|
78
|
-
obj[$this.attr('id')] = $this.val();
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
obj.WallboxSystems = table2values('systems');
|
|
83
|
-
|
|
84
|
-
callback(obj);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
</script>
|
|
90
|
-
</head>
|
|
91
|
-
<body>
|
|
92
|
-
<!-- you have to put your config page in a div with id adapter-container -->
|
|
93
|
-
<div class="m adapter-container">
|
|
94
|
-
<div class="row">
|
|
95
|
-
|
|
96
|
-
<div class="col s12">
|
|
97
|
-
<ul class="tabs">
|
|
98
|
-
<li class="tab col s2"><a href="#tab-main" class="translate active">Main settings</a></li>
|
|
99
|
-
<li class="tab col s2 le-settings"><a href="#tab-systems" class="translate">systems</a></li>
|
|
100
|
-
</ul>
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
<!-- main - settings -->
|
|
104
|
-
<div id="tab-main" class="col s12 page">
|
|
105
|
-
<div class="row">
|
|
106
|
-
<div class="col s6 m4 l2">
|
|
107
|
-
<img src="amtronwallbox.png" class="logo">
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
<div class="row">
|
|
113
|
-
<div class="input-field col s12 m4 l3">
|
|
114
|
-
<input class="value number" id="readInterval" size="3" maxlength="3" type="number" />
|
|
115
|
-
<label for="readInterval" class="translate">readInterval</label>
|
|
116
|
-
</div>
|
|
117
|
-
</div>
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
</div>
|
|
121
|
-
|
|
122
|
-
<!-- settings for systems -->
|
|
123
|
-
<div id="tab-systems" class="col s12 page">
|
|
124
|
-
<div class="col s12" id="systems">
|
|
125
|
-
|
|
126
|
-
<a class="btn-floating waves-effect waves-light blue table-button-add"><i class="material-icons">add</i></a>
|
|
127
|
-
|
|
128
|
-
<div class="table-values-div">
|
|
129
|
-
<table id="table_systems" class="table-values" style="width: 100%;">
|
|
130
|
-
<thead>
|
|
131
|
-
<tr>
|
|
132
|
-
<th id="tableSystems_col5" data-name="IsActive" data-type="checkbox" style="background: #64b5f6 " class="translate">IsActive</th>
|
|
133
|
-
<th id="tableSystems_col1" data-name="Name" style="width: 20%; background: #64b5f6 " class="translate">name</th>
|
|
134
|
-
<th id="tableSystems_col2" data-name="IPAddress" style=" background: #64b5f6 " class="translate">IPAddress</th>
|
|
135
|
-
<th id="tableSystems_col3" data-name="ApiKey" style=" background: #64b5f6 " class="translate">ApiKey</th>
|
|
136
|
-
<th id="tableSystems_col4" data-name="Type" data-options="Compact;ChargeControl;Xtra" data-type="select" style="background: #64b5f6 " class="translate">Type</th>
|
|
137
|
-
<th data-buttons="up down delete" style="width: 100px; background: #64b5f6"></th>
|
|
138
|
-
</tr>
|
|
139
|
-
</thead>
|
|
140
|
-
</table>
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
143
|
-
</div>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
</body>
|
|
147
|
-
</html>
|
|
148
|
-
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<head>
|
|
4
|
+
<!-- Load ioBroker scripts and styles-->
|
|
5
|
+
<link rel="stylesheet" type="text/css" href="../../lib/css/fancytree/ui.fancytree.min.css" />
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
|
|
7
|
+
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
|
|
10
|
+
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
|
11
|
+
|
|
12
|
+
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
|
|
13
|
+
<script type="text/javascript" src="../../lib/js/jquery-ui.min.js"></script>
|
|
14
|
+
<script type="text/javascript" src="../../lib/js/jquery.fancytree-all.min.js"></script>
|
|
15
|
+
|
|
16
|
+
<script type="text/javascript" src="../../js/translate.js"></script>
|
|
17
|
+
|
|
18
|
+
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
|
|
19
|
+
|
|
20
|
+
<!-- my own styles -->
|
|
21
|
+
<link rel="stylesheet" type="text/css" href="style.css" />
|
|
22
|
+
<script type="text/javascript" src="words.js"></script>
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
<!-- you have to define 2 functions in the global scope: -->
|
|
26
|
+
<script type="text/javascript">
|
|
27
|
+
|
|
28
|
+
// the function loadSettings has to exist ...
|
|
29
|
+
function load(settings, onChange) {
|
|
30
|
+
|
|
31
|
+
if (!settings) return;
|
|
32
|
+
|
|
33
|
+
// example: select elements with id=key and class=value and insert value
|
|
34
|
+
for (var key in settings) {
|
|
35
|
+
// example: select elements with id=key and class=value and insert value
|
|
36
|
+
if ($('#' + key + '.value').attr('type') == 'checkbox') {
|
|
37
|
+
$('#' + key + '.value').prop('checked', settings[key]).change(function () {
|
|
38
|
+
onChange();
|
|
39
|
+
});
|
|
40
|
+
} else {
|
|
41
|
+
$('#' + key + '.value').val(settings[key]).change(function () {
|
|
42
|
+
onChange();
|
|
43
|
+
}).keyup(function () {
|
|
44
|
+
$(this).trigger('change');
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
myOnChange = onChange;
|
|
50
|
+
// Signal to admin, that no changes yet
|
|
51
|
+
onChange(false);
|
|
52
|
+
|
|
53
|
+
M.updateTextFields();
|
|
54
|
+
|
|
55
|
+
values2table('systems', settings.WallboxSystems, onChange, tableSystemsOnReady);
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function tableSystemsOnReady() {
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// ... and the function save has to exist.
|
|
66
|
+
// you have to make sure the callback is called with the settings object as first param!
|
|
67
|
+
function save(callback) {
|
|
68
|
+
// example: select elements with class=value and build settings object
|
|
69
|
+
var obj = {};
|
|
70
|
+
$('.value').each(function () {
|
|
71
|
+
var $this = $(this);
|
|
72
|
+
|
|
73
|
+
var id = $this.attr('id');
|
|
74
|
+
|
|
75
|
+
if ($this.attr('type') === 'checkbox') {
|
|
76
|
+
obj[$this.attr('id')] = $this.prop('checked');
|
|
77
|
+
} else {
|
|
78
|
+
obj[$this.attr('id')] = $this.val();
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
obj.WallboxSystems = table2values('systems');
|
|
83
|
+
|
|
84
|
+
callback(obj);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
</script>
|
|
90
|
+
</head>
|
|
91
|
+
<body>
|
|
92
|
+
<!-- you have to put your config page in a div with id adapter-container -->
|
|
93
|
+
<div class="m adapter-container">
|
|
94
|
+
<div class="row">
|
|
95
|
+
|
|
96
|
+
<div class="col s12">
|
|
97
|
+
<ul class="tabs">
|
|
98
|
+
<li class="tab col s2"><a href="#tab-main" class="translate active">Main settings</a></li>
|
|
99
|
+
<li class="tab col s2 le-settings"><a href="#tab-systems" class="translate">systems</a></li>
|
|
100
|
+
</ul>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<!-- main - settings -->
|
|
104
|
+
<div id="tab-main" class="col s12 page">
|
|
105
|
+
<div class="row">
|
|
106
|
+
<div class="col s6 m4 l2">
|
|
107
|
+
<img src="amtronwallbox.png" class="logo">
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<div class="row">
|
|
113
|
+
<div class="input-field col s12 m4 l3">
|
|
114
|
+
<input class="value number" id="readInterval" size="3" maxlength="3" type="number" />
|
|
115
|
+
<label for="readInterval" class="translate">readInterval</label>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<!-- settings for systems -->
|
|
123
|
+
<div id="tab-systems" class="col s12 page">
|
|
124
|
+
<div class="col s12" id="systems">
|
|
125
|
+
|
|
126
|
+
<a class="btn-floating waves-effect waves-light blue table-button-add"><i class="material-icons">add</i></a>
|
|
127
|
+
|
|
128
|
+
<div class="table-values-div">
|
|
129
|
+
<table id="table_systems" class="table-values" style="width: 100%;">
|
|
130
|
+
<thead>
|
|
131
|
+
<tr>
|
|
132
|
+
<th id="tableSystems_col5" data-name="IsActive" data-type="checkbox" style="background: #64b5f6 " class="translate">IsActive</th>
|
|
133
|
+
<th id="tableSystems_col1" data-name="Name" style="width: 20%; background: #64b5f6 " class="translate">name</th>
|
|
134
|
+
<th id="tableSystems_col2" data-name="IPAddress" style=" background: #64b5f6 " class="translate">IPAddress</th>
|
|
135
|
+
<th id="tableSystems_col3" data-name="ApiKey" style=" background: #64b5f6 " class="translate">ApiKey</th>
|
|
136
|
+
<th id="tableSystems_col4" data-name="Type" data-options="Compact;ChargeControl;Xtra" data-type="select" style="background: #64b5f6 " class="translate">Type</th>
|
|
137
|
+
<th data-buttons="up down delete" style="width: 100px; background: #64b5f6"></th>
|
|
138
|
+
</tr>
|
|
139
|
+
</thead>
|
|
140
|
+
</table>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
</body>
|
|
147
|
+
</html>
|
|
148
|
+
|
package/admin/words.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/*global systemDictionary:true */
|
|
2
|
-
/*
|
|
3
|
-
+===================== DO NOT MODIFY ======================+
|
|
4
|
-
| This file was generated by translate-adapter, please use |
|
|
5
|
-
| `translate-adapter adminLanguages2words` to update it. |
|
|
6
|
-
+===================== DO NOT MODIFY ======================+
|
|
7
|
-
*/
|
|
1
|
+
/*global systemDictionary:true */
|
|
2
|
+
/*
|
|
3
|
+
+===================== DO NOT MODIFY ======================+
|
|
4
|
+
| This file was generated by translate-adapter, please use |
|
|
5
|
+
| `translate-adapter adminLanguages2words` to update it. |
|
|
6
|
+
+===================== DO NOT MODIFY ======================+
|
|
7
|
+
*/
|
|
8
8
|
'use strict';
|
|
9
|
-
|
|
10
|
-
systemDictionary = {
|
|
11
|
-
"ApiKey": { "en": "Api Key", "de": "API-Schlüssel", "ru": "API-ключ", "pt": "Chave API", "nl": "API sleutel", "fr": "Clé API", "it": "Chiave API", "es": "Clave API", "pl": "Klucz API", "uk": "Ключ API", "zh-cn": "API 密钥"},
|
|
12
|
-
"IPAddress": { "en": "IP-Address", "de": "IP Adresse", "ru": "Айпи адрес", "pt": "Endereço de IP", "nl": "IP adres", "fr": "Adresse IP", "it": "Indirizzo IP", "es": "Dirección IP", "pl": "Adres IP", "uk": "IP-адреса", "zh-cn": "IP地址"},
|
|
13
|
-
"IsActive": { "en": "active", "de": "aktiv", "ru": "активный", "pt": "ativo", "nl": "actief", "fr": "actif", "it": "attivo", "es": "activo", "pl": "aktywny", "uk": "активний", "zh-cn": "积极的"},
|
|
14
|
-
"Main settings": { "en": "Main settings", "de": "Haupteinstellungen", "ru": "Основные параметры", "pt": "Configurações principais", "nl": "Belangrijkste instellingen", "fr": "Réglages principaux", "it": "Impostazioni principali", "es": "Ajustes principales", "pl": "Ustawienia główne", "uk": "Основні налаштування", "zh-cn": "主要设置"},
|
|
15
|
-
"Type": { "en": "type", "de": "Typ", "ru": "тип", "pt": "modelo", "nl": "type", "fr": "taper", "it": "genere", "es": "escribe", "pl": "rodzaj", "uk": "типу", "zh-cn": "类型"},
|
|
16
|
-
"name": { "en": "name", "de": "Name", "ru": "имя", "pt": "nome", "nl": "naam", "fr": "Nom", "it": "nome", "es": "nombre", "pl": "Nazwa", "uk": "назва", "zh-cn": "姓名"},
|
|
17
|
-
"readInterval": { "en": "read intervall [min]", "de": "Leseintervall [min]", "ru": "интервал чтения [мин]", "pt": "intervalo de leitura [min]", "nl": "lees interval [min]", "fr": "intervalle de lecture [min]", "it": "intervallo di lettura [min]", "es": "intervalo de lectura [min]", "pl": "interwał odczytu [min]", "uk": "інтервал читання [хв]", "zh-cn": "读取间隔 [分钟]"},
|
|
18
|
-
"systems": { "en": "systems", "de": "Systeme", "ru": "системы", "pt": "sistemas", "nl": "systemen", "fr": "systèmes", "it": "sistemi", "es": "sistemas", "pl": "systemy", "uk": "системи", "zh-cn": "系统"},
|
|
9
|
+
|
|
10
|
+
systemDictionary = {
|
|
11
|
+
"ApiKey": { "en": "Api Key", "de": "API-Schlüssel", "ru": "API-ключ", "pt": "Chave API", "nl": "API sleutel", "fr": "Clé API", "it": "Chiave API", "es": "Clave API", "pl": "Klucz API", "uk": "Ключ API", "zh-cn": "API 密钥"},
|
|
12
|
+
"IPAddress": { "en": "IP-Address", "de": "IP Adresse", "ru": "Айпи адрес", "pt": "Endereço de IP", "nl": "IP adres", "fr": "Adresse IP", "it": "Indirizzo IP", "es": "Dirección IP", "pl": "Adres IP", "uk": "IP-адреса", "zh-cn": "IP地址"},
|
|
13
|
+
"IsActive": { "en": "active", "de": "aktiv", "ru": "активный", "pt": "ativo", "nl": "actief", "fr": "actif", "it": "attivo", "es": "activo", "pl": "aktywny", "uk": "активний", "zh-cn": "积极的"},
|
|
14
|
+
"Main settings": { "en": "Main settings", "de": "Haupteinstellungen", "ru": "Основные параметры", "pt": "Configurações principais", "nl": "Belangrijkste instellingen", "fr": "Réglages principaux", "it": "Impostazioni principali", "es": "Ajustes principales", "pl": "Ustawienia główne", "uk": "Основні налаштування", "zh-cn": "主要设置"},
|
|
15
|
+
"Type": { "en": "type", "de": "Typ", "ru": "тип", "pt": "modelo", "nl": "type", "fr": "taper", "it": "genere", "es": "escribe", "pl": "rodzaj", "uk": "типу", "zh-cn": "类型"},
|
|
16
|
+
"name": { "en": "name", "de": "Name", "ru": "имя", "pt": "nome", "nl": "naam", "fr": "Nom", "it": "nome", "es": "nombre", "pl": "Nazwa", "uk": "назва", "zh-cn": "姓名"},
|
|
17
|
+
"readInterval": { "en": "read intervall [min]", "de": "Leseintervall [min]", "ru": "интервал чтения [мин]", "pt": "intervalo de leitura [min]", "nl": "lees interval [min]", "fr": "intervalle de lecture [min]", "it": "intervallo di lettura [min]", "es": "intervalo de lectura [min]", "pl": "interwał odczytu [min]", "uk": "інтервал читання [хв]", "zh-cn": "读取间隔 [分钟]"},
|
|
18
|
+
"systems": { "en": "systems", "de": "Systeme", "ru": "системы", "pt": "sistemas", "nl": "systemen", "fr": "systèmes", "it": "sistemi", "es": "sistemas", "pl": "systemy", "uk": "системи", "zh-cn": "系统"},
|
|
19
19
|
};
|