iobroker.ebus 3.1.0 → 3.1.1
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/LICENSE +1 -1
- package/README.md +26 -10
- package/io-package.json +14 -92
- package/main.js +57 -6
- package/package.json +9 -9
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017-
|
|
3
|
+
Copyright (c) 2017-2023 rg-engineering info@rg-engineering.eu
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -55,7 +55,11 @@ Attention: command in datapoint ebus.0.cmd is deleted after executing of command
|
|
|
55
55
|
|
|
56
56
|
## Changelog
|
|
57
57
|
|
|
58
|
-
### 3.1.
|
|
58
|
+
### 3.1.1 (2023-01-31)
|
|
59
|
+
* (René) support ebusd 23.1
|
|
60
|
+
* (René) see issue #77: make sure that only one data request is running at the same time
|
|
61
|
+
|
|
62
|
+
### 3.1.0 (2022-12-01)
|
|
59
63
|
* (René) support ebusd 22.4
|
|
60
64
|
* (René) see issue #77: Update data point when read-cmd is used
|
|
61
65
|
* (René) see issue #78: remove CR, LF in answer from ebusd for DP ebus.0.cmdResult
|
|
@@ -203,15 +207,27 @@ Attention: command in datapoint ebus.0.cmd is deleted after executing of command
|
|
|
203
207
|
* (René) initial release
|
|
204
208
|
|
|
205
209
|
## License
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
210
|
+
MIT License
|
|
211
|
+
|
|
212
|
+
Copyright (c) 2017-2023 rg-engineering info@rg-engineering.eu
|
|
213
|
+
|
|
214
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
215
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
216
|
+
in the Software without restriction, including without limitation the rights
|
|
217
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
218
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
219
|
+
furnished to do so, subject to the following conditions:
|
|
220
|
+
|
|
221
|
+
The above copyright notice and this permission notice shall be included in all
|
|
222
|
+
copies or substantial portions of the Software.
|
|
223
|
+
|
|
224
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
225
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
226
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
227
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
228
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
229
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
230
|
+
SOFTWARE.
|
|
215
231
|
|
|
216
232
|
|
|
217
233
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "ebus",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.1",
|
|
5
5
|
"news": {
|
|
6
|
+
"3.1.1": {
|
|
7
|
+
"en": "wait for all commands before update of data",
|
|
8
|
+
"de": "Warten Sie auf alle Befehle, bevor Sie die Daten aktualisieren",
|
|
9
|
+
"ru": "дождаться всех команд перед обновлением данных",
|
|
10
|
+
"pt": "aguarde todos os comandos antes da atualização dos dados",
|
|
11
|
+
"nl": "wacht op alle commando's voordat de gegevens worden bijgewerkt",
|
|
12
|
+
"fr": "attendre toutes les commandes avant la mise à jour des données",
|
|
13
|
+
"it": "attendere tutti i comandi prima dell'aggiornamento dei dati",
|
|
14
|
+
"es": "esperar todos los comandos antes de actualizar los datos",
|
|
15
|
+
"pl": "poczekaj na wszystkie polecenia przed aktualizacją danych",
|
|
16
|
+
"uk": "дочекатися всіх команд перед оновленням даних",
|
|
17
|
+
"zh-cn": "在更新数据之前等待所有命令"
|
|
18
|
+
},
|
|
6
19
|
"3.1.0": {
|
|
7
20
|
"en": "optimize answer of ebus.0.cmd",
|
|
8
21
|
"de": "Antwort von ebus.0.cmd optimieren",
|
|
@@ -15,97 +28,6 @@
|
|
|
15
28
|
"pl": "zoptymalizować odpowiedź ebus.0.cmd",
|
|
16
29
|
"uk": "оптимізувати відповідь ebus.0.cmd",
|
|
17
30
|
"zh-cn": "优化 ebus.0.cmd 的答案"
|
|
18
|
-
},
|
|
19
|
-
"3.0.7": {
|
|
20
|
-
"en": "support of ebusd 22.3",
|
|
21
|
-
"de": "Unterstützung von ebusd 22.3",
|
|
22
|
-
"ru": "поддержка ebusd 22.3",
|
|
23
|
-
"pt": "suporte de ebusd 22.3",
|
|
24
|
-
"nl": "ondersteuning van ebusd 22.3",
|
|
25
|
-
"fr": "prise en charge d'ebusd 22.3",
|
|
26
|
-
"it": "supporto di ebusd 22.3",
|
|
27
|
-
"es": "soporte de ebusd 22.3",
|
|
28
|
-
"pl": "obsługa ebusd 22.3",
|
|
29
|
-
"zh-cn": "支持 ebusd 22.3",
|
|
30
|
-
"uk": "підтримка ebusd 22.3"
|
|
31
|
-
},
|
|
32
|
-
"3.0.6": {
|
|
33
|
-
"en": "widget with tooltip",
|
|
34
|
-
"de": "Widget mit Tooltip",
|
|
35
|
-
"ru": "виджет с подсказкой",
|
|
36
|
-
"pt": "widget com dica de ferramenta",
|
|
37
|
-
"nl": "widget met knopinfo",
|
|
38
|
-
"fr": "widget avec info-bulle",
|
|
39
|
-
"it": "widget con descrizione comando",
|
|
40
|
-
"es": "widget con información sobre herramientas",
|
|
41
|
-
"pl": "widżet z podpowiedź",
|
|
42
|
-
"zh-cn": "带有工具提示的小部件",
|
|
43
|
-
"uk": "віджет із підказкою"
|
|
44
|
-
},
|
|
45
|
-
"3.0.2": {
|
|
46
|
-
"en": "message installation hint added",
|
|
47
|
-
"de": "Nachricht Installationshinweis hinzugefügt",
|
|
48
|
-
"ru": "добавлена подсказка установки сообщения",
|
|
49
|
-
"pt": "dica de instalação de mensagem adicionada",
|
|
50
|
-
"nl": "bericht installatie hint toegevoegd",
|
|
51
|
-
"fr": "astuce d'installation de message ajoutée",
|
|
52
|
-
"it": "suggerimento per l'installazione del messaggio aggiunto",
|
|
53
|
-
"es": "sugerencia de instalación de mensajes agregada",
|
|
54
|
-
"pl": "dodano wskazówkę dotyczącą instalacji wiadomości",
|
|
55
|
-
"zh-cn": "添加了消息安装提示",
|
|
56
|
-
"uk": "додано підказку щодо встановлення повідомлення"
|
|
57
|
-
},
|
|
58
|
-
"3.0.1": {
|
|
59
|
-
"en": "read interval in admin added",
|
|
60
|
-
"de": "Leseintervall im Admin hinzugefügt",
|
|
61
|
-
"ru": "добавлен интервал чтения в админке",
|
|
62
|
-
"pt": "intervalo de leitura no admin adicionado",
|
|
63
|
-
"nl": "leesinterval in admin toegevoegd",
|
|
64
|
-
"fr": "intervalle de lecture ajouté dans l'administrateur",
|
|
65
|
-
"it": "intervallo di lettura in admin aggiunto",
|
|
66
|
-
"es": "Intervalo de lectura en el administrador agregado",
|
|
67
|
-
"pl": "dodano interwał odczytu w admin",
|
|
68
|
-
"zh-cn": "添加了管理员中的读取间隔",
|
|
69
|
-
"uk": "додано інтервал читання в адмінці"
|
|
70
|
-
},
|
|
71
|
-
"3.0.0": {
|
|
72
|
-
"en": "from 'scheduled' to 'daemon' adapter changed",
|
|
73
|
-
"de": "von 'geplant' zu 'daemon' Adapter geändert",
|
|
74
|
-
"ru": "изменен адаптер с «запланированного» на «демон»",
|
|
75
|
-
"pt": "adaptador 'agendado' para 'daemon' alterado",
|
|
76
|
-
"nl": "van 'scheduled' naar 'daemon' adapter gewijzigd",
|
|
77
|
-
"fr": "de l'adaptateur 'scheduled' à 'daemon' changé",
|
|
78
|
-
"it": "adattatore da \"programmato\" a \"demone\" modificato",
|
|
79
|
-
"es": "Se cambió el adaptador de 'programado' a 'daemon'",
|
|
80
|
-
"pl": "Zmieniono adapter z „zaplanowanego” na „demon”",
|
|
81
|
-
"zh-cn": "从 'scheduled' 到 'daemon' 适配器已更改",
|
|
82
|
-
"uk": "змінено адаптер із 'scheduled' на 'daemon'"
|
|
83
|
-
},
|
|
84
|
-
"2.6.0": {
|
|
85
|
-
"en": " 'bent' replaced by 'axios'",
|
|
86
|
-
"de": "'bent' ersetzt durch 'axios'",
|
|
87
|
-
"ru": "«согнутый» заменен на «аксиос»",
|
|
88
|
-
"pt": "'curvado' substituído por 'axios'",
|
|
89
|
-
"nl": "'gebogen' vervangen door 'axios'",
|
|
90
|
-
"fr": "'plié' remplacé par 'axios'",
|
|
91
|
-
"it": "'piegato' sostituito da 'assios'",
|
|
92
|
-
"es": "'doblado' reemplazado por 'axios'",
|
|
93
|
-
"pl": "„wygięty” zastąpiony przez „axios”",
|
|
94
|
-
"zh-cn": "'bent' 替换为 'axios'",
|
|
95
|
-
"uk": "\"bent\" замінено на \"axios\""
|
|
96
|
-
},
|
|
97
|
-
"2.5.1": {
|
|
98
|
-
"en": "maximum retries to send data in case of arbitration error",
|
|
99
|
-
"de": "maximale Wiederholungsversuche zum Senden von Daten im Falle eines Vermittlungsfehlers",
|
|
100
|
-
"ru": "максимальное количество попыток отправки данных в случае ошибки арбитража",
|
|
101
|
-
"pt": "máximo de tentativas para enviar dados em caso de erro de arbitragem",
|
|
102
|
-
"nl": "maximaal aantal pogingen om gegevens te verzenden in geval van arbitragefout",
|
|
103
|
-
"fr": "nombre maximum de tentatives d'envoi de données en cas d'erreur d'arbitrage",
|
|
104
|
-
"it": "numero massimo di tentativi di invio dei dati in caso di errore di arbitrato",
|
|
105
|
-
"es": "reintentos máximos para enviar datos en caso de error de arbitraje",
|
|
106
|
-
"pl": "maksymalna liczba prób wysłania danych w przypadku błędu arbitrażu",
|
|
107
|
-
"zh-cn": "仲裁错误时发送数据的最大重试次数",
|
|
108
|
-
"uk": "максимальна кількість повторних спроб надсилання даних у разі помилки арбітражу"
|
|
109
31
|
}
|
|
110
32
|
},
|
|
111
33
|
"titleLang": {
|
package/main.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
const utils = require("@iobroker/adapter-core");
|
|
18
|
-
const ebusdMinVersion = [
|
|
18
|
+
const ebusdMinVersion = [23, 1];
|
|
19
19
|
let ebusdVersion = [0, 0];
|
|
20
20
|
let ebusdUpdateVersion = [0, 0];
|
|
21
21
|
|
|
@@ -39,6 +39,13 @@ function startAdapter(options) {
|
|
|
39
39
|
// is called when adapter shuts down
|
|
40
40
|
unload: function (callback) {
|
|
41
41
|
try {
|
|
42
|
+
|
|
43
|
+
if (intervalID != null) {
|
|
44
|
+
clearInterval(intervalID);
|
|
45
|
+
}
|
|
46
|
+
if (updateTimerID != null) {
|
|
47
|
+
clearTimeout(updateTimerID);
|
|
48
|
+
}
|
|
42
49
|
adapter && adapter.log && adapter.log.info && adapter.log.info("cleaned everything up...");
|
|
43
50
|
//to do stop intervall
|
|
44
51
|
callback();
|
|
@@ -63,7 +70,8 @@ const axios = require('axios');
|
|
|
63
70
|
const net = require("net");
|
|
64
71
|
const { PromiseSocket } = require("promise-socket");
|
|
65
72
|
|
|
66
|
-
let intervalID;
|
|
73
|
+
let intervalID=null;
|
|
74
|
+
let updateTimerID=null;
|
|
67
75
|
|
|
68
76
|
async function main() {
|
|
69
77
|
|
|
@@ -83,18 +91,37 @@ async function main() {
|
|
|
83
91
|
adapter.log.debug("read every " + readInterval + " minutes");
|
|
84
92
|
intervalID = setInterval(Do, readInterval * 60 * 1000);
|
|
85
93
|
|
|
94
|
+
//read at adapterstart
|
|
95
|
+
await Do();
|
|
86
96
|
|
|
87
97
|
}
|
|
88
98
|
|
|
99
|
+
let requestRunning = false;
|
|
100
|
+
|
|
101
|
+
async function DoRequest() {
|
|
102
|
+
|
|
103
|
+
adapter.log.debug("DoRequest ");
|
|
104
|
+
|
|
105
|
+
if (!requestRunning) {
|
|
106
|
+
requestRunning = true;
|
|
107
|
+
await ebusd_ReadValues();
|
|
108
|
+
|
|
109
|
+
await ebusd_ReceiveData();
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
adapter.log.debug("DoRequest: do nothing already running ");
|
|
113
|
+
}
|
|
114
|
+
requestRunning = false;
|
|
115
|
+
}
|
|
116
|
+
|
|
89
117
|
async function Do() {
|
|
90
118
|
|
|
91
119
|
adapter.log.debug("starting ... " );
|
|
92
120
|
|
|
93
121
|
await ebusd_Command();
|
|
94
122
|
|
|
95
|
-
await
|
|
96
|
-
|
|
97
|
-
await ebusd_ReceiveData();
|
|
123
|
+
await DoRequest();
|
|
124
|
+
|
|
98
125
|
}
|
|
99
126
|
|
|
100
127
|
|
|
@@ -107,16 +134,40 @@ async function HandleStateChange(id, state) {
|
|
|
107
134
|
const ids = id.split(".");
|
|
108
135
|
|
|
109
136
|
if (ids[2] === "cmd") {
|
|
110
|
-
await
|
|
137
|
+
await ebusd_Command();
|
|
138
|
+
StartDataRequest();
|
|
139
|
+
//see issue #77: only one request possible
|
|
140
|
+
//await Do();
|
|
111
141
|
}
|
|
112
142
|
else {
|
|
113
143
|
adapter.log.warn("unhandled state change " + id);
|
|
114
144
|
}
|
|
115
145
|
}
|
|
146
|
+
}
|
|
147
|
+
|
|
116
148
|
|
|
149
|
+
function StartDataRequest() {
|
|
150
|
+
|
|
151
|
+
if (updateTimerID != null) {
|
|
152
|
+
//already running
|
|
153
|
+
clearTimeout(updateTimerID);
|
|
154
|
+
updateTimerID = null;
|
|
155
|
+
}
|
|
156
|
+
//start or restart
|
|
157
|
+
updateTimerID = setTimeout(DataRequest, 500);
|
|
158
|
+
adapter.log.debug("StartDataRequest");
|
|
117
159
|
}
|
|
118
160
|
|
|
119
161
|
|
|
162
|
+
async function DataRequest() {
|
|
163
|
+
adapter.log.debug("get data after command and timeout");
|
|
164
|
+
if (updateTimerID != null) {
|
|
165
|
+
clearTimeout(updateTimerID);
|
|
166
|
+
updateTimerID = null;
|
|
167
|
+
}
|
|
168
|
+
await DoRequest();
|
|
169
|
+
}
|
|
170
|
+
|
|
120
171
|
|
|
121
172
|
let oPolledVars = [];
|
|
122
173
|
function FillPolledVars() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.ebus",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "ioBroker ebus Adapter",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "René G.",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"flat": "5.0.2",
|
|
25
25
|
"net": "1.0.2",
|
|
26
26
|
"promise-socket": "7.0.0",
|
|
27
|
-
"cron": "2.
|
|
28
|
-
"axios": "
|
|
27
|
+
"cron": "2.2.0",
|
|
28
|
+
"axios": "0.27.2"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@iobroker/adapter-dev": "1.2.0",
|
|
@@ -33,20 +33,20 @@
|
|
|
33
33
|
"@types/chai": "4.3.4",
|
|
34
34
|
"@types/chai-as-promised": "7.1.5",
|
|
35
35
|
"@types/gulp": "4.0.10",
|
|
36
|
-
"@types/mocha": "10.0.
|
|
37
|
-
"@types/node": "18.11.
|
|
36
|
+
"@types/mocha": "10.0.1",
|
|
37
|
+
"@types/node": "18.11.18",
|
|
38
38
|
"@types/proxyquire": "1.3.28",
|
|
39
39
|
"@types/request-promise-native": "1.0.18",
|
|
40
40
|
"@types/sinon": "10.0.13",
|
|
41
41
|
"@types/sinon-chai": "3.2.9",
|
|
42
|
-
"axios": "
|
|
42
|
+
"axios": "0.27.2",
|
|
43
43
|
"chai": "4.3.7",
|
|
44
44
|
"chai-as-promised": "7.1.1",
|
|
45
|
-
"eslint": "8.
|
|
45
|
+
"eslint": "8.31.0",
|
|
46
46
|
"gulp": "4.0.2",
|
|
47
|
-
"mocha": "10.
|
|
47
|
+
"mocha": "10.2.0",
|
|
48
48
|
"proxyquire": "2.1.3",
|
|
49
|
-
"sinon": "15.0.
|
|
49
|
+
"sinon": "15.0.1",
|
|
50
50
|
"sinon-chai": "3.7.0"
|
|
51
51
|
},
|
|
52
52
|
"main": "main.js",
|