iobroker.influxdb 3.1.5 → 3.1.6
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 +3 -0
- package/io-package.json +13 -13
- package/lib/aggregate.js +6 -1
- package/main.js +34 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -450,6 +450,9 @@ sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
|
|
|
450
450
|
-->
|
|
451
451
|
|
|
452
452
|
## Changelog
|
|
453
|
+
### 3.1.6 (2022-06-27)
|
|
454
|
+
* (Apollon77) When not count is provided for aggregate "none" or "onchange" then the limit (default 2000) is used as count to define the number of data to return.
|
|
455
|
+
|
|
453
456
|
### 3.1.5 (2022-06-12)
|
|
454
457
|
* (Apollon77) Make sure debug log is active according to the settings
|
|
455
458
|
|
package/io-package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"pl": "Logowanie stanów do InfluxDB",
|
|
14
14
|
"zh-cn": "将状态记录到InfluxDB中"
|
|
15
15
|
},
|
|
16
|
-
"version": "3.1.
|
|
16
|
+
"version": "3.1.6",
|
|
17
17
|
"title": "Logging data with InfluxDB",
|
|
18
18
|
"titleLang": {
|
|
19
19
|
"en": "Logging data with InfluxDB",
|
|
@@ -28,6 +28,18 @@
|
|
|
28
28
|
"zh-cn": "使用InfluxDB记录数据"
|
|
29
29
|
},
|
|
30
30
|
"news": {
|
|
31
|
+
"3.1.6": {
|
|
32
|
+
"en": "When not count is provided for aggregate \"none\" or \"onchange\" then the limit (default 2000) is used as count to define the number of data to return.",
|
|
33
|
+
"de": "Wenn für die Aggregate keine oder Onchange keine Zählung vorgesehen ist, wird die Grenze (Standard 2000) als Zählung verwendet, um die Anzahl der Daten zu definieren, um zurückzukehren.",
|
|
34
|
+
"ru": "Когда не считать предоставляется для агрегата ни один или онмен, то предел (по умолчанию 2000) используется как считать, чтобы определить количество данных для возврата.",
|
|
35
|
+
"pt": "Quando não a contagem é fornecida para agregar nenhum ou onchange, então o limite (padrão 2000) é usado como contagem para definir o número de dados para retornar.",
|
|
36
|
+
"nl": "Als de tel niet wordt toegewezen voor aggregate noch onchange, dan wordt de limiet 2000 gebruikt om het aantal data te definiëren om terug te keren.",
|
|
37
|
+
"fr": "Lorsqu'il n'y a pas de comptage pour l'agrégat ou le changement, la limite (par défaut 2000) est utilisée pour définir le nombre de données à retourner.",
|
|
38
|
+
"it": "Quando il conteggio non viene fornito per aggregato nessuno o cambio, il limite (default 2000) viene utilizzato come conteggio per definire il numero di dati da restituire.",
|
|
39
|
+
"es": "Cuando no se cuenta se proporciona para agregado ninguno o cambio entonces el límite (por defecto 2000) se utiliza como cuenta para definir el número de datos para regresar.",
|
|
40
|
+
"pl": "Jeśli nieliczanie jest dostarczane dla agregacji ani zmian, to limit (default 2000) jest używany jako określenie liczby danych do powrotu.",
|
|
41
|
+
"zh-cn": "当没有计算总额时,或当时的汇率(2000年)用来确定返回的数据数量。."
|
|
42
|
+
},
|
|
31
43
|
"3.1.5": {
|
|
32
44
|
"en": "Make sure debug log is active according to the settings",
|
|
33
45
|
"de": "Stellen Sie sicher, dass das Debug-Log gemäß den Einstellungen aktiv ist",
|
|
@@ -99,18 +111,6 @@
|
|
|
99
111
|
"es": "manejar una ruta vacía para InfluxDB 2.0 correctamente en todos los casos",
|
|
100
112
|
"pl": "we wszystkich przypadkach poprawnie obsłużyć pustą ścieżkę dla InfluxDB 2.0",
|
|
101
113
|
"zh-cn": "在所有情况下正确处理 InfluxDB 2.0 的空路径"
|
|
102
|
-
},
|
|
103
|
-
"3.0.1": {
|
|
104
|
-
"en": "BREAKING: Configuration is only working in the new Admin 5 UI!\nDid bigger adjustments to the recording logic and added a lot of new Features. Please refer to Changelog and Forum post for details.",
|
|
105
|
-
"de": "BREAKING: Die Konfiguration funktioniert nur in der neuen Admin 5-Benutzeroberfläche!\nGrößere Anpassungen an der Aufnahmelogik vorgenommen und viele neue Features hinzugefügt. Einzelheiten finden Sie im Änderungsprotokoll und im Forumsbeitrag.",
|
|
106
|
-
"ru": "НАРУШЕНИЕ: Конфигурация работает только в новом пользовательском интерфейсе Admin 5!\nВнесены большие коррективы в логику записи и добавлено много новых функций. Пожалуйста, обратитесь к журналу изменений и сообщению на форуме для получения подробной информации.",
|
|
107
|
-
"pt": "URGENTE: a configuração está funcionando apenas na nova interface do usuário do Admin 5!\nFez ajustes maiores na lógica de gravação e adicionou muitos novos recursos. Consulte o Changelog e a postagem do fórum para obter detalhes.",
|
|
108
|
-
"nl": "BREAKING: Configuratie werkt alleen in de nieuwe Admin 5 UI!\nHeeft grotere aanpassingen gedaan aan de opnamelogica en veel nieuwe functies toegevoegd. Raadpleeg de Changelog en Forumpost voor details.",
|
|
109
|
-
"fr": "RUPTURE : La configuration ne fonctionne que dans la nouvelle interface utilisateur d'Admin 5 !\nA apporté de plus grands ajustements à la logique d'enregistrement et ajouté de nombreuses nouvelles fonctionnalités. Veuillez vous référer au changelog et au post du forum pour plus de détails.",
|
|
110
|
-
"it": "ROTTURA: la configurazione funziona solo nella nuova interfaccia utente di Admin 5!\nHa apportato maggiori modifiche alla logica di registrazione e aggiunto molte nuove funzionalità. Si prega di fare riferimento a Changelog e post sul forum per i dettagli.",
|
|
111
|
-
"es": "ÚLTIMA HORA: ¡La configuración solo funciona en la nueva interfaz de usuario de Admin 5!\nHizo ajustes más grandes a la lógica de grabación y agregó muchas características nuevas. Consulte el registro de cambios y la publicación del foro para obtener más detalles.",
|
|
112
|
-
"pl": "ŁAMANIE: Konfiguracja działa tylko w nowym interfejsie użytkownika Admin 5!\nWprowadziłem większe poprawki w logice nagrywania i dodałem wiele nowych funkcji. Więcej informacji można znaleźć w dzienniku zmian i poście na forum.",
|
|
113
|
-
"zh-cn": "突破:配置仅在新的 Admin 5 UI 中有效!\n对录制逻辑进行了更大的调整,并添加了许多新功能。有关详细信息,请参阅变更日志和论坛帖子。"
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
"mode": "daemon",
|
package/lib/aggregate.js
CHANGED
|
@@ -48,7 +48,12 @@ function initAggregate(options) {
|
|
|
48
48
|
|
|
49
49
|
log(`${options.logId} Initialize: maxIndex = ${options.maxIndex}, step = ${options.step}, start = ${options.start}, end = ${options.end}`);
|
|
50
50
|
// pre-fill the result with timestamps (add one before start and one after end)
|
|
51
|
-
|
|
51
|
+
try {
|
|
52
|
+
options.result.length = options.maxIndex + 2;
|
|
53
|
+
} catch (err) {
|
|
54
|
+
err.message += `: ${options.maxIndex + 2}`;
|
|
55
|
+
throw err;
|
|
56
|
+
}
|
|
52
57
|
// We define the array length but do not prefill values, we do that on runtime when needed
|
|
53
58
|
options.result[0] = {
|
|
54
59
|
val: {ts: null, val: null},
|
package/main.js
CHANGED
|
@@ -1911,6 +1911,16 @@ function getHistory(adapter, msg) {
|
|
|
1911
1911
|
logId: (msg.message.id ? msg.message.id : 'all') + Date.now() + Math.random()
|
|
1912
1912
|
};
|
|
1913
1913
|
|
|
1914
|
+
adapter.log.debug(`${options.logId} getHistory message: ${JSON.stringify(msg.message)}`);
|
|
1915
|
+
|
|
1916
|
+
if (!options.count || isNaN(options.count)) {
|
|
1917
|
+
if (options.aggregate === 'none' || options.aggregate === 'onchange') {
|
|
1918
|
+
options.count = options.limit;
|
|
1919
|
+
} else {
|
|
1920
|
+
options.count = 500;
|
|
1921
|
+
}
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1914
1924
|
try {
|
|
1915
1925
|
if (options.start && typeof options.start !== 'number') {
|
|
1916
1926
|
options.start = new Date(options.start).getTime();
|
|
@@ -1949,8 +1959,6 @@ function getHistory(adapter, msg) {
|
|
|
1949
1959
|
adapter._influxDPs[options.id] = adapter._influxDPs[options.id] || {};
|
|
1950
1960
|
const debugLog = options.debugLog = !!(adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].enableDebugLogs);
|
|
1951
1961
|
|
|
1952
|
-
debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB1) call: ${JSON.stringify(options)}`);
|
|
1953
|
-
|
|
1954
1962
|
if (options.id && adapter._aliasMap[options.id]) {
|
|
1955
1963
|
options.id = adapter._aliasMap[options.id];
|
|
1956
1964
|
}
|
|
@@ -1980,6 +1988,8 @@ function getHistory(adapter, msg) {
|
|
|
1980
1988
|
options.start = options.end - 86400000; // - 1 day
|
|
1981
1989
|
}
|
|
1982
1990
|
|
|
1991
|
+
debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB1) call: ${JSON.stringify(options)}`);
|
|
1992
|
+
|
|
1983
1993
|
let resultsFromInfluxDB = options.aggregate !== 'onchange' && options.aggregate !== 'none' && options.aggregate !== 'minmax';
|
|
1984
1994
|
if (options.aggregate === 'integral' && options.integralInterpolation === 'linear') {
|
|
1985
1995
|
resultsFromInfluxDB = false;
|
|
@@ -2140,7 +2150,11 @@ function getHistory(adapter, msg) {
|
|
|
2140
2150
|
result = result.sort(sortByTs);
|
|
2141
2151
|
}
|
|
2142
2152
|
|
|
2143
|
-
|
|
2153
|
+
try {
|
|
2154
|
+
Aggregate.sendResponse(adapter, msg, options, (error ? error.toString() : null) || result, startTime);
|
|
2155
|
+
} catch (e) {
|
|
2156
|
+
Aggregate.sendResponse(adapter, msg, options, e.toString(), startTime);
|
|
2157
|
+
}
|
|
2144
2158
|
});
|
|
2145
2159
|
}, storedCount ? 50 : 0);
|
|
2146
2160
|
});
|
|
@@ -2175,6 +2189,16 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2175
2189
|
logId: (msg.message.id ? msg.message.id : 'all') + Date.now() + Math.random()
|
|
2176
2190
|
};
|
|
2177
2191
|
|
|
2192
|
+
adapter.log.debug(`${options.logId} getHistory message: ${JSON.stringify(msg.message)}`);
|
|
2193
|
+
|
|
2194
|
+
if (!options.count || isNaN(options.count)) {
|
|
2195
|
+
if (options.aggregate === 'none' || options.aggregate === 'onchange') {
|
|
2196
|
+
options.count = options.limit;
|
|
2197
|
+
} else {
|
|
2198
|
+
options.count = 500;
|
|
2199
|
+
}
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2178
2202
|
try {
|
|
2179
2203
|
if (options.start && typeof options.start !== 'number') {
|
|
2180
2204
|
options.start = new Date(options.start).getTime();
|
|
@@ -2213,8 +2237,6 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2213
2237
|
adapter._influxDPs[options.id] = adapter._influxDPs[options.id] || {};
|
|
2214
2238
|
const debugLog = options.debugLog = !!((adapter._influxDPs[options.id] && adapter._influxDPs[options.id][adapter.namespace] && adapter._influxDPs[options.id][adapter.namespace].enableDebugLogs) || adapter.config.enableDebugLogs);
|
|
2215
2239
|
|
|
2216
|
-
debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB2) call: ${JSON.stringify(options)}`);
|
|
2217
|
-
|
|
2218
2240
|
if (options.id && adapter._aliasMap[options.id]) {
|
|
2219
2241
|
options.id = adapter._aliasMap[options.id];
|
|
2220
2242
|
}
|
|
@@ -2244,6 +2266,8 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2244
2266
|
options.start = options.end - 86400000; // - 1 day
|
|
2245
2267
|
}
|
|
2246
2268
|
|
|
2269
|
+
debugLog && adapter.log.debug(`${options.logId} getHistory (InfluxDB2) options final: ${JSON.stringify(options)}`);
|
|
2270
|
+
|
|
2247
2271
|
const resultsFromInfluxDB = options.aggregate !== 'onchange' && options.aggregate !== 'none' && options.aggregate !== 'minmax';
|
|
2248
2272
|
|
|
2249
2273
|
// query one timegroup-value more than requested originally at start and end
|
|
@@ -2481,7 +2505,11 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
2481
2505
|
options.log = adapter.log.debug;
|
|
2482
2506
|
}
|
|
2483
2507
|
|
|
2484
|
-
|
|
2508
|
+
try {
|
|
2509
|
+
Aggregate.sendResponse(adapter, msg, options, (error ? error.toString() : null) || result, startTime);
|
|
2510
|
+
} catch (e) {
|
|
2511
|
+
Aggregate.sendResponse(adapter, msg, options, e.toString(), startTime);
|
|
2512
|
+
}
|
|
2485
2513
|
});
|
|
2486
2514
|
});
|
|
2487
2515
|
}, storedCount ? 50 : 0);
|