iobroker.metermaster 0.9.7 → 0.9.8
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/io-package.json +14 -1
- package/main.js +10 -4
- package/package.json +1 -1
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "metermaster",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.8",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.9.8": {
|
|
7
|
+
"en": "Log MeterMaster app connection tests from User-Agent at info level",
|
|
8
|
+
"de": "Verbindungstests der MeterMaster-App per User-Agent auf Info-Level loggen",
|
|
9
|
+
"ru": "Log app connection tests via User-Agent",
|
|
10
|
+
"pt": "Log app connection tests via User-Agent",
|
|
11
|
+
"nl": "Log app connection tests via User-Agent",
|
|
12
|
+
"fr": "Log app connection tests via User-Agent",
|
|
13
|
+
"it": "Log app connection tests via User-Agent",
|
|
14
|
+
"es": "Log app connection tests via User-Agent",
|
|
15
|
+
"pl": "Log app connection tests via User-Agent",
|
|
16
|
+
"uk": "Log app connection tests via User-Agent",
|
|
17
|
+
"zh-cn": "通过 User-Agent 记录应用连接测试"
|
|
18
|
+
},
|
|
6
19
|
"0.9.7": {
|
|
7
20
|
"en": "Print fix (Blob URL); ESP32 discover proxy (getStates/node-discover); node heartbeat/ack logs moved to debug",
|
|
8
21
|
"de": "Druck-Fix (Blob-URL); ESP32-Discover-Proxy (getStates/node-discover); Node-Heartbeat/Ack-Logs auf Debug-Level",
|
package/main.js
CHANGED
|
@@ -4,7 +4,7 @@ const utils = require('@iobroker/adapter-core');
|
|
|
4
4
|
const http = require('node:http');
|
|
5
5
|
const crypto = require('node:crypto');
|
|
6
6
|
const https = require('node:https');
|
|
7
|
-
const CURRENT_VERSION = '0.9.
|
|
7
|
+
const CURRENT_VERSION = '0.9.8';
|
|
8
8
|
const GITHUB_REPO = 'MPunktBPunkt/ioBroker.metermaster';
|
|
9
9
|
const GITHUB_URL = 'https://github.com/MPunktBPunkt/ioBroker.metermaster';
|
|
10
10
|
|
|
@@ -327,7 +327,7 @@ function startHttpServer() {
|
|
|
327
327
|
log(LVL.DEBUG, CAT.AUTH, `Auth OK`, `IP: ${clientIp} | User: "${reqUser}"`);
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
if (req.method === 'GET' && url === '/api/ping') { handlePing(res, clientIp); }
|
|
330
|
+
if (req.method === 'GET' && url === '/api/ping') { handlePing(req, res, clientIp); return; }
|
|
331
331
|
else if ((req.method === 'POST' || req.method === 'PUT') && url === '/api/reading') {
|
|
332
332
|
readBody(req, b => handleReading(b, res, clientIp));
|
|
333
333
|
}
|
|
@@ -362,8 +362,14 @@ function startHttpServer() {
|
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
// ─── Ping ─────────────────────────────────────────────────────────────────────
|
|
365
|
-
function handlePing(res, clientIp) {
|
|
366
|
-
|
|
365
|
+
function handlePing(req, res, clientIp) {
|
|
366
|
+
const ua = String(req.headers['user-agent'] || '');
|
|
367
|
+
const appMatch = ua.match(/MeterMaster\/([\d.]+)/i);
|
|
368
|
+
if (appMatch) {
|
|
369
|
+
log(LVL.INFO, CAT.CONNECT, `App connection test`, `MeterMaster ${appMatch[1]} | IP: ${clientIp}`);
|
|
370
|
+
} else {
|
|
371
|
+
log(LVL.DEBUG, CAT.CONNECT, `Ping`, `IP: ${clientIp}${ua ? ` | UA: ${ua.slice(0, 80)}` : ''}`);
|
|
372
|
+
}
|
|
367
373
|
sendJson(res, 200, { ok: true, adapter: 'metermaster', version: CURRENT_VERSION, received: readingsReceived });
|
|
368
374
|
}
|
|
369
375
|
|
package/package.json
CHANGED