diff --git a/interface/package.json b/interface/package.json index 1a5ff4c9f..176eb165f 100644 --- a/interface/package.json +++ b/interface/package.json @@ -21,13 +21,13 @@ "lint": "eslint . --fix" }, "dependencies": { - "@alova/adapter-xhr": "2.0.9", + "@alova/adapter-xhr": "2.0.10", "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", "@mui/icons-material": "^6.1.6", "@mui/material": "^6.1.6", "@table-library/react-table-library": "4.1.7", - "alova": "3.1.1", + "alova": "3.2.1", "async-validator": "^4.2.5", "jwt-decode": "^4.0.0", "mime-types": "^2.1.35", @@ -42,17 +42,17 @@ }, "devDependencies": { "@babel/core": "^7.26.0", - "@eslint/js": "^9.13.0", + "@eslint/js": "^9.14.0", "@preact/compat": "^18.3.1", "@preact/preset-vite": "^2.9.1", "@trivago/prettier-plugin-sort-imports": "^4.3.0", "@types/formidable": "^3", - "@types/node": "^22.8.6", + "@types/node": "^22.8.7", "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@types/react-router-dom": "^5.3.3", "concurrently": "^9.0.1", - "eslint": "^9.13.0", + "eslint": "^9.14.0", "eslint-config-prettier": "^9.1.0", "formidable": "^3.5.2", "prettier": "^3.3.3", diff --git a/interface/yarn.lock b/interface/yarn.lock index 6d6290e4b..3051c8f3a 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -5,21 +5,21 @@ __metadata: version: 8 cacheKey: 10c0 -"@alova/adapter-xhr@npm:2.0.9": - version: 2.0.9 - resolution: "@alova/adapter-xhr@npm:2.0.9" +"@alova/adapter-xhr@npm:2.0.10": + version: 2.0.10 + resolution: "@alova/adapter-xhr@npm:2.0.10" dependencies: - "@alova/shared": "npm:^1.0.7" + "@alova/shared": "npm:1.1.0" peerDependencies: alova: ^3.0.20 - checksum: 10c0/7c2460fdfed308b099fb08d3020877b4d4175f56fd7c38d1008325a3e1a32cab21bcb4a54f808f88b416ef267310ef65beb9826a8b2b0c035f974e18a75dcfe3 + checksum: 10c0/d277ab0cc5b6468585529a4e121610260cefbda37f80570578f35a3615f85432f9ba9b97859b7557d9640d340bfa7841a449806576f8334470df5b471aa391fa languageName: node linkType: hard -"@alova/shared@npm:^1.0.7": - version: 1.0.7 - resolution: "@alova/shared@npm:1.0.7" - checksum: 10c0/1ca9a897000492f394ec63fccf2bfbf3a291b9306999e41c52fbfc84962bd9d1e4632943e13428c1bd11eee7cf62b49a7fc151060b3ccf874fecc37cdb0dd02c +"@alova/shared@npm:1.1.0": + version: 1.1.0 + resolution: "@alova/shared@npm:1.1.0" + checksum: 10c0/ec7c3eae893644354fea737a63abe14c4334bd7f6337b102c8ed8049459eeb12e52a98b5f846adaf314d31230ef631a994dc4c9c6e15ef569fa7a6c6ee7b9568 languageName: node linkType: hard @@ -664,13 +664,20 @@ __metadata: languageName: node linkType: hard -"@eslint-community/regexpp@npm:^4.10.0, @eslint-community/regexpp@npm:^4.11.0": +"@eslint-community/regexpp@npm:^4.10.0": version: 4.11.2 resolution: "@eslint-community/regexpp@npm:4.11.2" checksum: 10c0/c6ab16307c64bc72ea05b9c1740734dfe4a3eea8f7cc395266eb7f04a0ab8f84fe58d41888e906c18bc56262b685eb3074443a0375fb8c44fb4ff20fdb11e250 languageName: node linkType: hard +"@eslint-community/regexpp@npm:^4.12.1": + version: 4.12.1 + resolution: "@eslint-community/regexpp@npm:4.12.1" + checksum: 10c0/a03d98c246bcb9109aec2c08e4d10c8d010256538dcb3f56610191607214523d4fb1b00aa81df830b6dffb74c5fa0be03642513a289c567949d3e550ca11cdf6 + languageName: node + linkType: hard + "@eslint/config-array@npm:^0.18.0": version: 0.18.0 resolution: "@eslint/config-array@npm:0.18.0" @@ -706,10 +713,10 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:9.13.0, @eslint/js@npm:^9.13.0": - version: 9.13.0 - resolution: "@eslint/js@npm:9.13.0" - checksum: 10c0/672257bffe17777b8a98bd80438702904cc7a0b98b9c2e426a8a10929198b3553edf8a3fc20feed4133c02e7c8f7331a0ef1b23e5dab8e4469f7f1791beff1e0 +"@eslint/js@npm:9.14.0, @eslint/js@npm:^9.14.0": + version: 9.14.0 + resolution: "@eslint/js@npm:9.14.0" + checksum: 10c0/a423dd435e10aa3b461599aa02f6cbadd4b5128cb122467ee4e2c798e7ca4f9bb1fce4dcea003b29b983090238cf120899c1af657cf86300b399e4f996b83ddc languageName: node linkType: hard @@ -729,20 +736,20 @@ __metadata: languageName: node linkType: hard -"@humanfs/core@npm:^0.19.0": - version: 0.19.0 - resolution: "@humanfs/core@npm:0.19.0" - checksum: 10c0/f87952d5caba6ae427a620eff783c5d0b6cef0cfc256dec359cdaa636c5f161edb8d8dad576742b3de7f0b2f222b34aad6870248e4b7d2177f013426cbcda232 +"@humanfs/core@npm:^0.19.1": + version: 0.19.1 + resolution: "@humanfs/core@npm:0.19.1" + checksum: 10c0/aa4e0152171c07879b458d0e8a704b8c3a89a8c0541726c6b65b81e84fd8b7564b5d6c633feadc6598307d34564bd53294b533491424e8e313d7ab6c7bc5dc67 languageName: node linkType: hard -"@humanfs/node@npm:^0.16.5": - version: 0.16.5 - resolution: "@humanfs/node@npm:0.16.5" +"@humanfs/node@npm:^0.16.6": + version: 0.16.6 + resolution: "@humanfs/node@npm:0.16.6" dependencies: - "@humanfs/core": "npm:^0.19.0" + "@humanfs/core": "npm:^0.19.1" "@humanwhocodes/retry": "npm:^0.3.0" - checksum: 10c0/41c365ab09e7c9eaeed373d09243195aef616d6745608a36fc3e44506148c28843872f85e69e2bf5f1e992e194286155a1c1cecfcece6a2f43875e37cd243935 + checksum: 10c0/8356359c9f60108ec204cbd249ecd0356667359b2524886b357617c4a7c3b6aace0fd5a369f63747b926a762a88f8a25bc066fa1778508d110195ce7686243e1 languageName: node linkType: hard @@ -753,13 +760,20 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/retry@npm:^0.3.0, @humanwhocodes/retry@npm:^0.3.1": +"@humanwhocodes/retry@npm:^0.3.0": version: 0.3.1 resolution: "@humanwhocodes/retry@npm:0.3.1" checksum: 10c0/f0da1282dfb45e8120480b9e2e275e2ac9bbe1cf016d046fdad8e27cc1285c45bb9e711681237944445157b430093412b4446c1ab3fc4bb037861b5904101d3b languageName: node linkType: hard +"@humanwhocodes/retry@npm:^0.4.0": + version: 0.4.0 + resolution: "@humanwhocodes/retry@npm:0.4.0" + checksum: 10c0/28dcf1ed70b28ae8bc07b268c457a02f6b53fe4591b73e31f6735e7673dfd9e662f24a69e065aada1a64311bf5692d93d4ef35aba849314e8a87a870ba3b47aa + languageName: node + linkType: hard + "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -1435,12 +1449,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^22.8.6": - version: 22.8.6 - resolution: "@types/node@npm:22.8.6" +"@types/node@npm:^22.8.7": + version: 22.8.7 + resolution: "@types/node@npm:22.8.7" dependencies: undici-types: "npm:~6.19.8" - checksum: 10c0/d3a11f2549234a91a4c5d0ff35ab4bdcb7ba34db4d3f1d189be39b8bd41c19aac98d117150a95a9c5a9d45b1014135477ea240b2b8317c86ae3d3cf1c3b3f8f4 + checksum: 10c0/14372885db80059ed6e92c320b2bcd8f7dc271698adce11f51aa0f424a3f82aa1749a4f66321b87043791b894346b2458d514cbb65ce70167c2fd8a78a124947 languageName: node linkType: hard @@ -1645,11 +1659,11 @@ __metadata: version: 0.0.0-use.local resolution: "EMS-ESP@workspace:." dependencies: - "@alova/adapter-xhr": "npm:2.0.9" + "@alova/adapter-xhr": "npm:2.0.10" "@babel/core": "npm:^7.26.0" "@emotion/react": "npm:^11.13.3" "@emotion/styled": "npm:^11.13.0" - "@eslint/js": "npm:^9.13.0" + "@eslint/js": "npm:^9.14.0" "@mui/icons-material": "npm:^6.1.6" "@mui/material": "npm:^6.1.6" "@preact/compat": "npm:^18.3.1" @@ -1657,14 +1671,14 @@ __metadata: "@table-library/react-table-library": "npm:4.1.7" "@trivago/prettier-plugin-sort-imports": "npm:^4.3.0" "@types/formidable": "npm:^3" - "@types/node": "npm:^22.8.6" + "@types/node": "npm:^22.8.7" "@types/react": "npm:^18.3.12" "@types/react-dom": "npm:^18.3.1" "@types/react-router-dom": "npm:^5.3.3" - alova: "npm:3.1.1" + alova: "npm:3.2.1" async-validator: "npm:^4.2.5" concurrently: "npm:^9.0.1" - eslint: "npm:^9.13.0" + eslint: "npm:^9.14.0" eslint-config-prettier: "npm:^9.1.0" formidable: "npm:^3.5.2" jwt-decode: "npm:^4.0.0" @@ -1712,6 +1726,15 @@ __metadata: languageName: node linkType: hard +"acorn@npm:^8.14.0": + version: 8.14.0 + resolution: "acorn@npm:8.14.0" + bin: + acorn: bin/acorn + checksum: 10c0/6d4ee461a7734b2f48836ee0fbb752903606e576cc100eb49340295129ca0b452f3ba91ddd4424a1d4406a98adfb2ebb6bd0ff4c49d7a0930c10e462719bbfd7 + languageName: node + linkType: hard + "agent-base@npm:^7.0.2, agent-base@npm:^7.1.0, agent-base@npm:^7.1.1": version: 7.1.1 resolution: "agent-base@npm:7.1.1" @@ -1743,13 +1766,13 @@ __metadata: languageName: node linkType: hard -"alova@npm:3.1.1": - version: 3.1.1 - resolution: "alova@npm:3.1.1" +"alova@npm:3.2.1": + version: 3.2.1 + resolution: "alova@npm:3.2.1" dependencies: - "@alova/shared": "npm:^1.0.7" + "@alova/shared": "npm:1.1.0" rate-limiter-flexible: "npm:^5.0.3" - checksum: 10c0/e9efe2193a730ccf48f73fb06c6bda278f9307aed2d77054d5337a631d48567d016251c5d6a9308818b08d66c2e9ba48f5f8f5f219a6199eaa67014bef353ac7 + checksum: 10c0/9b15b1894a505bd15bf8fa67352addd72ebddf0b0134b5f96ba6c806e25afdfb565e53931d4ac12900559b9b4778557277350ddc37b8ff87e72030d9d84feddc languageName: node linkType: hard @@ -3091,13 +3114,13 @@ __metadata: languageName: node linkType: hard -"eslint-scope@npm:^8.1.0": - version: 8.1.0 - resolution: "eslint-scope@npm:8.1.0" +"eslint-scope@npm:^8.2.0": + version: 8.2.0 + resolution: "eslint-scope@npm:8.2.0" dependencies: esrecurse: "npm:^4.3.0" estraverse: "npm:^5.2.0" - checksum: 10c0/ae1df7accae9ea90465c2ded70f7064d6d1f2962ef4cc87398855c4f0b3a5ab01063e0258d954bb94b184f6759febe04c3118195cab5c51978a7229948ba2875 + checksum: 10c0/8d2d58e2136d548ac7e0099b1a90d9fab56f990d86eb518de1247a7066d38c908be2f3df477a79cf60d70b30ba18735d6c6e70e9914dca2ee515a729975d70d6 languageName: node linkType: hard @@ -3115,20 +3138,27 @@ __metadata: languageName: node linkType: hard -"eslint@npm:^9.13.0": - version: 9.13.0 - resolution: "eslint@npm:9.13.0" +"eslint-visitor-keys@npm:^4.2.0": + version: 4.2.0 + resolution: "eslint-visitor-keys@npm:4.2.0" + checksum: 10c0/2ed81c663b147ca6f578312919483eb040295bbab759e5a371953456c636c5b49a559883e2677112453728d66293c0a4c90ab11cab3428cf02a0236d2e738269 + languageName: node + linkType: hard + +"eslint@npm:^9.14.0": + version: 9.14.0 + resolution: "eslint@npm:9.14.0" dependencies: "@eslint-community/eslint-utils": "npm:^4.2.0" - "@eslint-community/regexpp": "npm:^4.11.0" + "@eslint-community/regexpp": "npm:^4.12.1" "@eslint/config-array": "npm:^0.18.0" "@eslint/core": "npm:^0.7.0" "@eslint/eslintrc": "npm:^3.1.0" - "@eslint/js": "npm:9.13.0" + "@eslint/js": "npm:9.14.0" "@eslint/plugin-kit": "npm:^0.2.0" - "@humanfs/node": "npm:^0.16.5" + "@humanfs/node": "npm:^0.16.6" "@humanwhocodes/module-importer": "npm:^1.0.1" - "@humanwhocodes/retry": "npm:^0.3.1" + "@humanwhocodes/retry": "npm:^0.4.0" "@types/estree": "npm:^1.0.6" "@types/json-schema": "npm:^7.0.15" ajv: "npm:^6.12.4" @@ -3136,9 +3166,9 @@ __metadata: cross-spawn: "npm:^7.0.2" debug: "npm:^4.3.2" escape-string-regexp: "npm:^4.0.0" - eslint-scope: "npm:^8.1.0" - eslint-visitor-keys: "npm:^4.1.0" - espree: "npm:^10.2.0" + eslint-scope: "npm:^8.2.0" + eslint-visitor-keys: "npm:^4.2.0" + espree: "npm:^10.3.0" esquery: "npm:^1.5.0" esutils: "npm:^2.0.2" fast-deep-equal: "npm:^3.1.3" @@ -3161,11 +3191,11 @@ __metadata: optional: true bin: eslint: bin/eslint.js - checksum: 10c0/d3577444152182a9d8ea8c6a6acb073d3a2773ad73a6b646f432746583ec4bfcd6a44fcc2e37d05d276984e583c46c2d289b3b981ca8f8b4052756a152341d19 + checksum: 10c0/e1cbf571b75519ad0b24c27e66a6575e57cab2671ef5296e7b345d9ac3adc1a549118dcc74a05b651a7a13a5e61ebb680be6a3e04a80e1f22eba1931921b5187 languageName: node linkType: hard -"espree@npm:^10.0.1, espree@npm:^10.2.0": +"espree@npm:^10.0.1": version: 10.2.0 resolution: "espree@npm:10.2.0" dependencies: @@ -3176,6 +3206,17 @@ __metadata: languageName: node linkType: hard +"espree@npm:^10.3.0": + version: 10.3.0 + resolution: "espree@npm:10.3.0" + dependencies: + acorn: "npm:^8.14.0" + acorn-jsx: "npm:^5.3.2" + eslint-visitor-keys: "npm:^4.2.0" + checksum: 10c0/272beeaca70d0a1a047d61baff64db04664a33d7cfb5d144f84bc8a5c6194c6c8ebe9cc594093ca53add88baa23e59b01e69e8a0160ab32eac570482e165c462 + languageName: node + linkType: hard + "esquery@npm:^1.5.0": version: 1.6.0 resolution: "esquery@npm:1.6.0" diff --git a/lib/ESPAsyncWebServer/src/AsyncJson.h b/lib/ESPAsyncWebServer/src/AsyncJson.h index 4c12df572..0cb74acf3 100644 --- a/lib/ESPAsyncWebServer/src/AsyncJson.h +++ b/lib/ESPAsyncWebServer/src/AsyncJson.h @@ -7,7 +7,8 @@ #include <ESPAsyncWebServer.h> #include <Print.h> -constexpr const char * JSON_MIMETYPE = "application/json"; +constexpr const char * JSON_MIMETYPE = "application/json"; +constexpr const char * MSGPACK_MIMETYPE = "application/msgpack"; class ChunkPrint : public Print { private: @@ -54,7 +55,7 @@ class AsyncJsonResponse : public AsyncAbstractResponse { : _isValid{false} , _isMsgPack{isMsgPack} { _code = 200; - _contentType = JSON_MIMETYPE; + _contentType = (isMsgPack) ? MSGPACK_MIMETYPE : JSON_MIMETYPE; if (isArray) _root = _jsonBuffer.add<JsonArray>(); else diff --git a/src/analogsensor.cpp b/src/analogsensor.cpp index ac23b33ca..b791fef3c 100644 --- a/src/analogsensor.cpp +++ b/src/analogsensor.cpp @@ -533,7 +533,7 @@ void AnalogSensor::publish_values(const bool force) { char val_obj[50]; char val_cond[95]; if (Mqtt::is_nested()) { - snprintf(val_obj, sizeof(val_obj), "value_json['%02d'].value", sensor.gpio()); + snprintf(val_obj, sizeof(val_obj), "value_json['%02d'].value", sensor.gpio()); // TODO change for Domoticz snprintf(val_cond, sizeof(val_cond), "value_json['%02d'] is defined and %s is defined", sensor.gpio(), val_obj); } else { snprintf(val_obj, sizeof(val_obj), "value_json['%s']", sensor.name().c_str()); diff --git a/src/telegram.h b/src/telegram.h index 1fcf3d639..c8a0d472c 100644 --- a/src/telegram.h +++ b/src/telegram.h @@ -133,7 +133,7 @@ class Telegram { auto msg_size = (index - this->offset + num_bytes - 1); if ((index < this->offset) || (msg_size >= this->message_length) || (msg_size > EMS_MAX_TELEGRAM_MESSAGE_LENGTH)) { - return false; // TODO we should set value to a default value here + return false; } Value val = value; diff --git a/src/temperaturesensor.cpp b/src/temperaturesensor.cpp index 5d1a65ee8..658f55443 100644 --- a/src/temperaturesensor.cpp +++ b/src/temperaturesensor.cpp @@ -482,7 +482,7 @@ void TemperatureSensor::publish_values(const bool force) { char val_obj[70]; char val_cond[170]; if (Mqtt::is_nested()) { - snprintf(val_obj, sizeof(val_obj), "value_json['%s'].temp", sensor.id().c_str()); + snprintf(val_obj, sizeof(val_obj), "value_json['%s'].temp", sensor.id().c_str()); // TODO change for Domoticz snprintf(val_cond, sizeof(val_cond), "value_json['%s'] is defined and %s is defined", sensor.id().c_str(), val_obj); } else { snprintf(val_obj, sizeof(val_obj), "value_json['%s']", sensor.name().c_str());