iobroker.amtronwallbox 0.2.14 → 0.2.16
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 +8 -0
- package/admin/i18n/de/translations.json +10 -0
- package/admin/i18n/en/translations.json +10 -0
- package/admin/i18n/es/translations.json +10 -0
- package/admin/i18n/fr/translations.json +10 -0
- package/admin/i18n/it/translations.json +10 -0
- package/admin/i18n/nl/translations.json +10 -0
- package/admin/i18n/pl/translations.json +10 -0
- package/admin/i18n/pt/translations.json +10 -0
- package/admin/i18n/ru/translations.json +10 -0
- package/admin/i18n/uk/translations.json +10 -0
- package/admin/i18n/zh-cn/translations.json +10 -0
- package/io-package.json +33 -30
- package/lib/support_tools.js +367 -0
- package/main.js +7 -1
- package/package.json +31 -28
- package/.releaseconfig.json +0 -3
package/README.md
CHANGED
|
@@ -54,6 +54,14 @@ Note: Since the boxes have different interfaces, it may be that not all interfac
|
|
|
54
54
|
Placeholder for the next version (at the beginning of the line):
|
|
55
55
|
### **WORK IN PROGRESS**
|
|
56
56
|
-->
|
|
57
|
+
### 0.2.16 (2024-08-24)
|
|
58
|
+
* (René) update dependencies
|
|
59
|
+
* (René) bug fixes based on adapter checker recommendation
|
|
60
|
+
|
|
61
|
+
### 0.2.15 (2024-05-28)
|
|
62
|
+
* (René) change of dependencies
|
|
63
|
+
* (René) show cron job in log after creation
|
|
64
|
+
|
|
57
65
|
### 0.2.14 (2024-01-12)
|
|
58
66
|
* (René) dependencies updated
|
|
59
67
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "amtronwallbox",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.16",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.2.16": {
|
|
7
|
+
"en": "update dependencies\nbug fixes based on adapter checker recommendation",
|
|
8
|
+
"de": "aktualisierung der abhängigkeiten\nfehlerbehebungen basierend auf adapter-checker empfehlung",
|
|
9
|
+
"ru": "обновление зависимостей\nисправления ошибок на основе рекомендации адаптера",
|
|
10
|
+
"pt": "dependências\ncorreções de bugs com base na recomendação do verificador do adaptador",
|
|
11
|
+
"nl": "afhankelijkheden bijwerken\nbug fixes op basis van adaptercontrole aanbeveling",
|
|
12
|
+
"fr": "mettre à jour les dépendances\ncorrection des bugs en fonction de la recommandation du vérificateur d'adaptateur",
|
|
13
|
+
"it": "aggiornamento dipendenze\ncorrezioni di bug in base alla raccomandazione dell'adattatore checker",
|
|
14
|
+
"es": "dependencias de actualización\ncorrecciones de errores basado en la recomendación de control de adaptador",
|
|
15
|
+
"pl": "aktualizacji zależności\npoprawki błędów oparte na rekomendacji sprawdzania adaptera",
|
|
16
|
+
"uk": "оновлення залежності\nвиправлення помилок на основі рекомендації адаптера",
|
|
17
|
+
"zh-cn": "更新依赖关系\n根据适配器检查器建议修正错误"
|
|
18
|
+
},
|
|
19
|
+
"0.2.15": {
|
|
20
|
+
"en": "(René) change of dependencies\n(René) show cron job in log after creation",
|
|
21
|
+
"de": "(René) Veränderung der Abhängigkeiten\n(René) cron job in log nach der Erstellung anzeigen",
|
|
22
|
+
"ru": "(René) изменение зависимостей\n(René) показать работу корона в журнале после создания",
|
|
23
|
+
"pt": "(René) mudança de dependências\n(René) mostrar trabalho cron em log após a criação",
|
|
24
|
+
"nl": "(René) verandering van afhankelijkheden\n(René) cron job tonen in log na aanmaak",
|
|
25
|
+
"fr": "(René) changement de dépendances\n(René) montrer cron emploi dans log après la création",
|
|
26
|
+
"it": "(René) cambiamento delle dipendenze\n(René) mostrare il lavoro di cron nel registro dopo la creazione",
|
|
27
|
+
"es": "(René) cambio de dependencia\n(René) show cron job in log after creation",
|
|
28
|
+
"pl": "(René) zmiana zależności\n(René) show cron job in log after creation",
|
|
29
|
+
"uk": "(Рене) зміна залежностей\n(René) покажуть на роботу в журналі після створення",
|
|
30
|
+
"zh-cn": "(René) 属地变化\n(René) 创建后在日志中显示 cron 工作"
|
|
31
|
+
},
|
|
6
32
|
"0.2.14": {
|
|
7
33
|
"en": "(René) dependencies updated",
|
|
8
34
|
"de": "(René)",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "(René) rodzaj adaptatora zmieniał się z powrotem do energii",
|
|
68
94
|
"uk": "(René) тип адаптера змінився назад до енергії",
|
|
69
95
|
"zh-cn": "(René) 适应者类型改为能源"
|
|
70
|
-
},
|
|
71
|
-
"0.2.9": {
|
|
72
|
-
"en": "dependencies updated",
|
|
73
|
-
"de": "Abhängigkeiten aktualisiert",
|
|
74
|
-
"ru": "зависимости обновлены",
|
|
75
|
-
"pt": "dependências atualizadas",
|
|
76
|
-
"nl": "afhankelijkheden bijgewerkt",
|
|
77
|
-
"fr": "dépendances mises à jour",
|
|
78
|
-
"it": "dipendenze aggiornate",
|
|
79
|
-
"es": "dependencias actualizadas",
|
|
80
|
-
"pl": "zależności zostały zaktualizowane",
|
|
81
|
-
"uk": "залежності оновлено",
|
|
82
|
-
"zh-cn": "依赖项已更新"
|
|
83
|
-
},
|
|
84
|
-
"0.2.8": {
|
|
85
|
-
"en": "role of states overworked",
|
|
86
|
-
"de": "Rolle der Zustände überarbeitet",
|
|
87
|
-
"ru": "роль государств перегружена работой",
|
|
88
|
-
"pt": "papel dos estados sobrecarregados",
|
|
89
|
-
"nl": "rol van staten overbelast",
|
|
90
|
-
"fr": "rôle des Etats surmenés",
|
|
91
|
-
"it": "ruolo degli stati oberati di lavoro",
|
|
92
|
-
"es": "papel de los estados sobrecargado",
|
|
93
|
-
"pl": "rola państw jest przepracowana",
|
|
94
|
-
"uk": "роль держ",
|
|
95
|
-
"zh-cn": "国家角色过度劳累"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
|
@@ -136,11 +136,14 @@
|
|
|
136
136
|
"loglevel": "info",
|
|
137
137
|
"stopBeforeUpdate": true,
|
|
138
138
|
"type": "energy",
|
|
139
|
-
"
|
|
140
|
-
"
|
|
139
|
+
"tier": 3,
|
|
140
|
+
"licenseInformation": {
|
|
141
|
+
"license": "MIT",
|
|
142
|
+
"type": "free"
|
|
143
|
+
},
|
|
141
144
|
"dependencies": [
|
|
142
145
|
{
|
|
143
|
-
"js-controller": ">=
|
|
146
|
+
"js-controller": ">=5.0.19"
|
|
144
147
|
}
|
|
145
148
|
],
|
|
146
149
|
"plugins": {
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @param {string} timeVal
|
|
6
|
+
* @param {string} timeLimit
|
|
7
|
+
*/
|
|
8
|
+
function IsLater(adapter, timeVal, timeLimit) {
|
|
9
|
+
|
|
10
|
+
let ret = false;
|
|
11
|
+
try {
|
|
12
|
+
adapter.log.debug("check IsLater : " + timeVal + " " + timeLimit);
|
|
13
|
+
|
|
14
|
+
if (typeof timeVal === "string" && typeof timeLimit === "string") {
|
|
15
|
+
const valIn = timeVal.split(":");
|
|
16
|
+
const valLimits = timeLimit.split(":");
|
|
17
|
+
|
|
18
|
+
if (valIn.length > 1 && valLimits.length > 1) {
|
|
19
|
+
|
|
20
|
+
if (parseInt(valIn[0]) > parseInt(valLimits[0])
|
|
21
|
+
|| (parseInt(valIn[0]) == parseInt(valLimits[0]) && parseInt(valIn[1]) > parseInt(valLimits[1]))) {
|
|
22
|
+
ret = true;
|
|
23
|
+
adapter.log.debug("yes, IsLater : " + timeVal + " " + timeLimit);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
adapter.log.error("string does not contain : " + timeVal + " " + timeLimit);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
adapter.log.error("not a string " + typeof timeVal + " " + typeof timeLimit);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
adapter.log.error("exception in IsLater [" + e + "]");
|
|
36
|
+
}
|
|
37
|
+
return ret;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @param {string } timeVal
|
|
42
|
+
* @param {string } [timeLimit]
|
|
43
|
+
*/
|
|
44
|
+
function IsEarlier(adapter, timeVal, timeLimit) {
|
|
45
|
+
|
|
46
|
+
let ret = false;
|
|
47
|
+
try {
|
|
48
|
+
adapter.log.debug("check IsEarlier : " + timeVal + " " + timeLimit);
|
|
49
|
+
|
|
50
|
+
if (typeof timeVal === "string" && typeof timeLimit === "string") {
|
|
51
|
+
const valIn = timeVal.split(":");
|
|
52
|
+
const valLimits = timeLimit.split(":");
|
|
53
|
+
|
|
54
|
+
if (valIn.length > 1 && valLimits.length > 1) {
|
|
55
|
+
|
|
56
|
+
if (parseInt(valIn[0]) < parseInt(valLimits[0])
|
|
57
|
+
|| (parseInt(valIn[0]) == parseInt(valLimits[0]) && parseInt(valIn[1]) < parseInt(valLimits[1]))) {
|
|
58
|
+
ret = true;
|
|
59
|
+
adapter.log.debug("yes, IsEarlier : " + timeVal + " " + timeLimit);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
adapter.log.error("string does not contain : " + timeVal + " " + timeLimit);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
adapter.log.error("not a string " + typeof timeVal + " " + typeof timeLimit);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
adapter.log.error("exception in IsEarlier [" + e + "]");
|
|
72
|
+
}
|
|
73
|
+
return ret;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @param {string} timeVal
|
|
78
|
+
* @param {string} timeLimit
|
|
79
|
+
*/
|
|
80
|
+
function IsEqual(adapter, timeVal, timeLimit) {
|
|
81
|
+
|
|
82
|
+
let ret = false;
|
|
83
|
+
try {
|
|
84
|
+
adapter.log.debug("check IsEqual : " + timeVal + " " + timeLimit);
|
|
85
|
+
|
|
86
|
+
if (typeof timeVal === "string" && typeof timeLimit === "string") {
|
|
87
|
+
const valIn = timeVal.split(":");
|
|
88
|
+
const valLimits = timeLimit.split(":");
|
|
89
|
+
|
|
90
|
+
if (valIn.length > 1 && valLimits.length > 1) {
|
|
91
|
+
|
|
92
|
+
if (parseInt(valIn[0]) === parseInt(valLimits[0]) && parseInt(valIn[1]) === parseInt(valLimits[1])) {
|
|
93
|
+
ret = true;
|
|
94
|
+
adapter.log.debug("yes, IsEqual : " + timeVal + " " + timeLimit);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
adapter.log.error("string does not contain : " + timeVal + " " + timeLimit);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
adapter.log.error("not a string " + typeof timeVal + " " + typeof timeLimit);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch (e) {
|
|
106
|
+
adapter.log.error("exception in IsEqual [" + e + "]");
|
|
107
|
+
}
|
|
108
|
+
return ret;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
//*******************************************************************
|
|
112
|
+
//
|
|
113
|
+
// find a object in array by key and value
|
|
114
|
+
// returns the object
|
|
115
|
+
function findObjectByKey(array, key, value) {
|
|
116
|
+
if (array !== null && array !== undefined) {
|
|
117
|
+
for (let i = 0; i < array.length; i++) {
|
|
118
|
+
if (array[i][key] === value) {
|
|
119
|
+
return array[i];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
//*******************************************************************
|
|
127
|
+
//
|
|
128
|
+
// find a object in array by key and value
|
|
129
|
+
// returns the object
|
|
130
|
+
function findObjectsByKey(array, key, value) {
|
|
131
|
+
|
|
132
|
+
const ret = [];
|
|
133
|
+
|
|
134
|
+
if (array !== null && array !== undefined) {
|
|
135
|
+
for (let i = 0; i < array.length; i++) {
|
|
136
|
+
if (array[i][key] === value) {
|
|
137
|
+
ret.push(array[i]);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return ret;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
//*******************************************************************
|
|
146
|
+
//
|
|
147
|
+
// find a object in array by key and value
|
|
148
|
+
// returns index number
|
|
149
|
+
function findObjectIdByKey(array, key, value) {
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
//array.filter(d => d.key == value);
|
|
153
|
+
|
|
154
|
+
if (array !== null && array !== undefined) {
|
|
155
|
+
|
|
156
|
+
for (let i = 0; i < array.length; i++) {
|
|
157
|
+
if (array[i][key] === value) {
|
|
158
|
+
return i;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return -1;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
//*******************************************************************
|
|
167
|
+
//
|
|
168
|
+
// find all objects in array by key and value
|
|
169
|
+
// returns index number array
|
|
170
|
+
function findObjectsIdByKey(array, key, value) {
|
|
171
|
+
|
|
172
|
+
const ret = [];
|
|
173
|
+
|
|
174
|
+
if (array !== null && array !== undefined) {
|
|
175
|
+
|
|
176
|
+
for (let i = 0; i < array.length; i++) {
|
|
177
|
+
if (array[i][key] === value) {
|
|
178
|
+
ret.push(i);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return ret;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
function timeConverter(SystemLanguage,time, timeonly = false) {
|
|
187
|
+
|
|
188
|
+
let a;
|
|
189
|
+
|
|
190
|
+
if (time != null) {
|
|
191
|
+
a = new Date(time);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
a = new Date();
|
|
195
|
+
}
|
|
196
|
+
let months;
|
|
197
|
+
|
|
198
|
+
if (SystemLanguage === "de") {
|
|
199
|
+
months = ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"];
|
|
200
|
+
}
|
|
201
|
+
else if (SystemLanguage === "en") {
|
|
202
|
+
months = ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"];
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const year = a.getFullYear();
|
|
209
|
+
const month = months[a.getMonth()];
|
|
210
|
+
const date = a.getDate();
|
|
211
|
+
const sdate = date < 10 ? " " + date.toString() : date.toString();
|
|
212
|
+
const hour = a.getHours();
|
|
213
|
+
const shour = hour < 10 ? "0" + hour.toString() : hour.toString();
|
|
214
|
+
const min = a.getMinutes();
|
|
215
|
+
const smin = min < 10 ? "0" + min.toString() : min.toString();
|
|
216
|
+
const sec = a.getSeconds();
|
|
217
|
+
const ssec = sec < 10 ? "0" + sec.toString() : sec.toString();
|
|
218
|
+
|
|
219
|
+
let sRet = "";
|
|
220
|
+
if (timeonly) {
|
|
221
|
+
sRet = shour + ":" + smin + ":" + ssec;
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
sRet = sdate + " " + month + " " + year.toString() + " " + shour + ":" + smin + ":" + ssec;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return sRet;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function CheckValidTime(adapter, id, time) {
|
|
231
|
+
|
|
232
|
+
let sRet = "00:00";
|
|
233
|
+
try {
|
|
234
|
+
if (time === "null" || time === undefined) {
|
|
235
|
+
adapter.log.error("time value not found for " + id);
|
|
236
|
+
|
|
237
|
+
}
|
|
238
|
+
else if (typeof time !== "string") {
|
|
239
|
+
adapter.log.error("time should be a string but is " + typeof time.val + " for " + id);
|
|
240
|
+
|
|
241
|
+
}
|
|
242
|
+
else if (time.length < 3) {
|
|
243
|
+
adapter.log.error("time not long enough for " + id);
|
|
244
|
+
|
|
245
|
+
}
|
|
246
|
+
else if (!time.includes(":")) {
|
|
247
|
+
adapter.log.error("time ':' missing for " + id);
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
const times = time.split(":");
|
|
251
|
+
sRet = "0" + times[0].slice(-2) + ":" + "0" + times[1].slice(-2);
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
}
|
|
255
|
+
catch (e) {
|
|
256
|
+
adapter.log.error("exception in CheckValidTime [" + e + "] for " + id + " " + JSON.stringify(time));
|
|
257
|
+
|
|
258
|
+
}
|
|
259
|
+
return sRet;
|
|
260
|
+
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
function Check4ValidTemperature(adapter, temperature) {
|
|
265
|
+
|
|
266
|
+
try {
|
|
267
|
+
|
|
268
|
+
if (temperature == null) {
|
|
269
|
+
adapter.log.warn("target temperature is 'null' ");
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if (typeof temperature == "object") {
|
|
273
|
+
adapter.log.warn("target temperature is an object, value: " + JSON.stringify(temperature));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (isNaN(temperature) || typeof temperature === "string") {
|
|
277
|
+
|
|
278
|
+
adapter.log.debug("try to convert " + temperature + " to a number");
|
|
279
|
+
return Number(temperature);
|
|
280
|
+
}
|
|
281
|
+
else {
|
|
282
|
+
return temperature;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
}
|
|
286
|
+
catch (e) {
|
|
287
|
+
adapter.log.error("exception in Check4ValidTemperature [" + e + "]");
|
|
288
|
+
return 0;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
function IsSummerTime(adapter, sStartDate, sEndDate) {
|
|
295
|
+
|
|
296
|
+
let ret = false;
|
|
297
|
+
try {
|
|
298
|
+
|
|
299
|
+
adapter.log.debug("check in time " + sStartDate + " " + sEndDate);
|
|
300
|
+
|
|
301
|
+
if (sStartDate.length > 0 && sEndDate.length > 0) {
|
|
302
|
+
const StartPeriod = sStartDate.split(/[.,/ -]/);
|
|
303
|
+
const EndPeriod = sEndDate.split(/[.,/ -]/);
|
|
304
|
+
|
|
305
|
+
if (StartPeriod.length >= 2 && EndPeriod.length >= 2) {
|
|
306
|
+
|
|
307
|
+
const StartDate = new Date();
|
|
308
|
+
StartDate.setDate(parseInt(StartPeriod[0]));
|
|
309
|
+
StartDate.setMonth(parseInt(StartPeriod[1]) - 1);
|
|
310
|
+
adapter.log.debug("Start " + StartDate.toDateString());
|
|
311
|
+
|
|
312
|
+
const EndDate = new Date();
|
|
313
|
+
EndDate.setDate(parseInt(EndPeriod[0]));
|
|
314
|
+
EndDate.setMonth(parseInt(EndPeriod[1]) - 1);
|
|
315
|
+
adapter.log.debug("End " + EndDate.toDateString());
|
|
316
|
+
|
|
317
|
+
const now = new Date();
|
|
318
|
+
|
|
319
|
+
//bei Jahreswechsel
|
|
320
|
+
if (EndDate < StartDate) {
|
|
321
|
+
if (now > EndDate) {
|
|
322
|
+
//end already past, increase end year
|
|
323
|
+
EndDate.setFullYear(EndDate.getFullYear() + 1);
|
|
324
|
+
adapter.log.debug("corrected End " + EndDate.toDateString());
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
//else decrease Start year
|
|
328
|
+
StartDate.setFullYear(StartDate.getFullYear() - 1);
|
|
329
|
+
adapter.log.debug("corrected Start " + StartDate.toDateString());
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (now >= StartDate && now <= EndDate) {
|
|
334
|
+
adapter.log.debug("we are in period");
|
|
335
|
+
ret = true;
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
adapter.log.debug("we are not in period, after start " + StartDate.toDateString() + " and before end " + EndDate.toDateString());
|
|
339
|
+
ret = false;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
catch (e) {
|
|
345
|
+
adapter.log.error("exception catch in IsSummerTime [" + e + "] ");
|
|
346
|
+
}
|
|
347
|
+
return ret;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
module.exports = {
|
|
356
|
+
IsLater,
|
|
357
|
+
IsEarlier,
|
|
358
|
+
IsEqual,
|
|
359
|
+
findObjectsIdByKey,
|
|
360
|
+
findObjectIdByKey,
|
|
361
|
+
findObjectsByKey,
|
|
362
|
+
findObjectByKey,
|
|
363
|
+
timeConverter,
|
|
364
|
+
CheckValidTime,
|
|
365
|
+
Check4ValidTemperature,
|
|
366
|
+
IsSummerTime
|
|
367
|
+
};
|
package/main.js
CHANGED
|
@@ -12,6 +12,8 @@ const axios = require("axios");
|
|
|
12
12
|
|
|
13
13
|
const CronJob = require("cron").CronJob;
|
|
14
14
|
|
|
15
|
+
const timeConverter = require("./lib/support_tools.js").timeConverter;
|
|
16
|
+
|
|
15
17
|
let cronJobs = [];
|
|
16
18
|
|
|
17
19
|
/*
|
|
@@ -95,6 +97,8 @@ async function main() {
|
|
|
95
97
|
|
|
96
98
|
CronCreate(readInterval, Do);
|
|
97
99
|
|
|
100
|
+
CronStatus();
|
|
101
|
+
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
async function Do() {
|
|
@@ -2538,6 +2542,7 @@ function CronStop() {
|
|
|
2538
2542
|
}
|
|
2539
2543
|
}
|
|
2540
2544
|
|
|
2545
|
+
/*
|
|
2541
2546
|
function deleteCronJob(id) {
|
|
2542
2547
|
|
|
2543
2548
|
cronJobs[id].stop();
|
|
@@ -2552,6 +2557,7 @@ function deleteCronJob(id) {
|
|
|
2552
2557
|
|
|
2553
2558
|
|
|
2554
2559
|
}
|
|
2560
|
+
*/
|
|
2555
2561
|
|
|
2556
2562
|
function CronCreate(Minute, callback) {
|
|
2557
2563
|
|
|
@@ -2600,7 +2606,7 @@ function CronStatus() {
|
|
|
2600
2606
|
//adapter.log.debug("cron jobs");
|
|
2601
2607
|
for (n = 0; n < length; n++) {
|
|
2602
2608
|
if ( cronJobs[n] !== undefined && cronJobs[n] != null) {
|
|
2603
|
-
adapter.log.debug("cron status = " + cronJobs[n].running + " next event: " + timeConverter("DE", cronJobs[n].
|
|
2609
|
+
adapter.log.debug("cron status = " + cronJobs[n].running + " next event: " + timeConverter("DE", cronJobs[n].nextDate()));
|
|
2604
2610
|
}
|
|
2605
2611
|
}
|
|
2606
2612
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.amtronwallbox",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"description": "ioBroker Adapter for AMTRON wallboxes",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "René G.",
|
|
@@ -21,42 +21,45 @@
|
|
|
21
21
|
"url": "https://github.com/rg-engineering/ioBroker.amtronwallbox"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|
|
24
|
-
"node": ">=
|
|
24
|
+
"node": ">= 18"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@iobroker/adapter-core": "3.
|
|
28
|
-
"axios": "1.
|
|
29
|
-
"cron": "3.1.
|
|
27
|
+
"@iobroker/adapter-core": "^3.1.6",
|
|
28
|
+
"axios": "^1.7.5",
|
|
29
|
+
"cron": "^3.1.7"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@alcalzone/release-script": "3.
|
|
33
|
-
"@alcalzone/release-script-plugin-iobroker": "3.7.
|
|
34
|
-
"@alcalzone/release-script-plugin-license": "3.7.0",
|
|
35
|
-
"@
|
|
36
|
-
"@iobroker/
|
|
37
|
-
"@
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"@types/mocha": "10.0.6",
|
|
41
|
-
"@types/node": "20.11.0",
|
|
42
|
-
"@types/proxyquire": "1.3.31",
|
|
43
|
-
"@types/request-promise-native": "1.0.21",
|
|
44
|
-
"@types/sinon": "17.0.3",
|
|
45
|
-
"@types/sinon-chai": "3.2.12",
|
|
46
|
-
"axios": "1.6.5",
|
|
47
|
-
"chai": "4.4.1",
|
|
48
|
-
"chai-as-promised": "7.1.1",
|
|
49
|
-
"eslint": "8.56.0",
|
|
50
|
-
"gulp": "4.0.2",
|
|
51
|
-
"mocha": "10.2.0",
|
|
52
|
-
"proxyquire": "2.1.3",
|
|
53
|
-
"sinon": "17.0.1",
|
|
54
|
-
"sinon-chai": "3.7.0"
|
|
32
|
+
"@alcalzone/release-script": "^3.8.0",
|
|
33
|
+
"@alcalzone/release-script-plugin-iobroker": "^3.7.2",
|
|
34
|
+
"@alcalzone/release-script-plugin-license": "^3.7.0",
|
|
35
|
+
"@alcalzone/release-script-plugin-manual-review": "^3.7.0",
|
|
36
|
+
"@iobroker/adapter-dev": "^1.3.0",
|
|
37
|
+
"@iobroker/testing": "^4.1.3",
|
|
38
|
+
"chai": "^5.1.1",
|
|
39
|
+
"mocha": "^10.7.3"
|
|
55
40
|
},
|
|
56
41
|
"main": "main.js",
|
|
57
42
|
"bugs": {
|
|
58
43
|
"url": "https://github.com/rg-engineering/ioBroker.amtronwallbox"
|
|
59
44
|
},
|
|
45
|
+
"files": [
|
|
46
|
+
"admin/",
|
|
47
|
+
"admin{,/!(i18n)/**}/flat.txt",
|
|
48
|
+
"lib/",
|
|
49
|
+
"!.vscode",
|
|
50
|
+
"!.github",
|
|
51
|
+
"!.git",
|
|
52
|
+
"!.gitignore",
|
|
53
|
+
"!.gitattributes",
|
|
54
|
+
"!node_modules",
|
|
55
|
+
"!tasks",
|
|
56
|
+
"!.idea",
|
|
57
|
+
"!test",
|
|
58
|
+
"!typings",
|
|
59
|
+
"io-package.json",
|
|
60
|
+
"LICENSE",
|
|
61
|
+
"main.js"
|
|
62
|
+
],
|
|
60
63
|
"readmeFilename": "README.md",
|
|
61
64
|
"scripts": {
|
|
62
65
|
"test": "npm run test:package",
|
package/.releaseconfig.json
DELETED