diff --git a/interface/package-lock.json b/interface/package-lock.json index cb864df9a..3cbebdf9d 100644 --- a/interface/package-lock.json +++ b/interface/package-lock.json @@ -2874,30 +2874,30 @@ } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.6.tgz", - "integrity": "sha512-R7xHtBSNm+9SyvpJkdQl+qrM3Hm2fea3Ef197M3mUug+v+yR+Rhfbs7PBtcBUVnIWJ4JcAdjvij+c8hXS9p5aw==", + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.0.tgz", - "integrity": "sha512-SfJxIxNVYLTsKwzB3MoOQ1yxf4w/E6MdkvTgrgAt1bfxjSrLUoHMKrDOykwN14q65waezZIdqDneUIPh4/sKxg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz", + "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.12", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.12.tgz", - "integrity": "sha512-az/NhpIwP3K33ILr0T2bso+k2E/SLf8Yidd8mHl0n6sCQ4YdyC8qDhZA6kOPDNDBA56ZnIjngVl0U3jREA0BUA==" + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==" }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.10.tgz", + "integrity": "sha512-Q0YbBd6OTsXm8Y21+YUSDXupHnodNC2M4O18jtd3iwJ3+vMZNdKGols0a9G6JOK0dcJ3IdUUHoh908ZI6qhk8Q==", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -4728,12 +4728,9 @@ "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=" }, "node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dependencies": { - "lodash": "^4.17.14" - } + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" }, "node_modules/async-validator": { "version": "4.1.1", @@ -5536,9 +5533,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001335", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001335.tgz", - "integrity": "sha512-ddP1Tgm7z2iIxu6QTtbZUv6HJxSaV/PZeSrWFZtbY4JZ69tOeNhBCl3HyRQgeNZKE5AOn1kpV7fhljigy0Ty3w==", + "version": "1.0.30001338", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001338.tgz", + "integrity": "sha512-1gLHWyfVoRDsHieO+CaeYe7jSo/MT7D7lhaXUiwwbuR5BwQxORs0f1tAwUSQr3YbxRXJvxHM/PA5FfPQRnsPeQ==", "funding": [ { "type": "opencollective", @@ -6830,9 +6827,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.132", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.132.tgz", - "integrity": "sha512-JYdZUw/1068NWN+SwXQ7w6Ue0bWYGihvSUNNQwurvcDV/SM7vSiGZ3NuFvFgoEiCs4kB8xs3cX2an3wB7d4TBw==" + "version": "1.4.136", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.136.tgz", + "integrity": "sha512-GnITX8rHnUrIVnTxU9UlsTnSemHUA2iF+6QrRqxFbp/mf0vfuSc/goEyyQhUX3TUUCE3mv/4BNuXOtaJ4ur0eA==" }, "node_modules/emittery": { "version": "0.8.1", @@ -6912,16 +6909,18 @@ } }, "node_modules/es-abstract": { - "version": "1.19.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.5.tgz", - "integrity": "sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.0.tgz", + "integrity": "sha512-URbD8tgRthKD3YcC39vbvSDrX23upXnPcnGAjQfgxXF5ID75YcENawc9ZX/9iTP9ptUyfCLIxTTuMYoRfiOVKA==", "dependencies": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", @@ -6933,9 +6932,10 @@ "object-inspect": "^1.12.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "regexp.prototype.flags": "^1.4.1", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" }, "engines": { "node": ">= 0.4" @@ -8436,6 +8436,23 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -9658,11 +9675,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jake/node_modules/async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" - }, "node_modules/jake/node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -11171,15 +11183,15 @@ } }, "node_modules/jest-watch-typeahead/node_modules/@jest/console": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-28.0.2.tgz", - "integrity": "sha512-tiRpnMeeyQuuzgL5UNSeiqMwF8UOWPbAE5rzcu/1zyq4oPG2Ox6xm4YCOruwbp10F8odWc+XwVxTyGzMSLMqxA==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-28.1.0.tgz", + "integrity": "sha512-tscn3dlJFGay47kb4qVruQg/XWlmvU0xp3EJOjzzY+sBaI+YgwKcvAmTcyYU7xEiLLIY5HCdWRooAL8dqkFlDA==", "dependencies": { - "@jest/types": "^28.0.2", + "@jest/types": "^28.1.0", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^28.0.2", - "jest-util": "^28.0.2", + "jest-message-util": "^28.1.0", + "jest-util": "^28.1.0", "slash": "^3.0.0" }, "engines": { @@ -11195,12 +11207,12 @@ } }, "node_modules/jest-watch-typeahead/node_modules/@jest/test-result": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-28.0.2.tgz", - "integrity": "sha512-4EUqgjq9VzyUiVTvZfI9IRJD6t3NYBNP4f+Eq8Zr93+hkJ0RrGU4OBTw8tfNzidKX+bmuYzn8FxqpxOPIGGCMA==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-28.1.0.tgz", + "integrity": "sha512-sBBFIyoPzrZho3N+80P35A5oAkSKlGfsEFfXFWuPGBsW40UAjCkGakZhn4UQK4iQlW2vgCDMRDOob9FGKV8YoQ==", "dependencies": { - "@jest/console": "^28.0.2", - "@jest/types": "^28.0.2", + "@jest/console": "^28.1.0", + "@jest/types": "^28.1.0", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" }, @@ -11209,9 +11221,9 @@ } }, "node_modules/jest-watch-typeahead/node_modules/@jest/types": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-28.0.2.tgz", - "integrity": "sha512-hi3jUdm9iht7I2yrV5C4s3ucCJHUP8Eh3W6rQ1s4n/Qw9rQgsda4eqCt+r3BKRi7klVmZfQlMx1nGlzNMP2d8A==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-28.1.0.tgz", + "integrity": "sha512-xmEggMPr317MIOjjDoZ4ejCSr9Lpbt/u34+dvc99t7DS8YirW5rwZEhzKPC2BMUFkUhI48qs6qLUSGw5FuL0GA==", "dependencies": { "@jest/schemas": "^28.0.2", "@types/istanbul-lib-coverage": "^2.0.0", @@ -11297,17 +11309,17 @@ } }, "node_modules/jest-watch-typeahead/node_modules/jest-message-util": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.0.2.tgz", - "integrity": "sha512-knK7XyojvwYh1XiF2wmVdskgM/uN11KsjcEWWHfnMZNEdwXCrqB4sCBO94F4cfiAwCS8WFV6CDixDwPlMh/wdA==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.1.0.tgz", + "integrity": "sha512-RpA8mpaJ/B2HphDMiDlrAZdDytkmwFqgjDZovM21F35lHGeUeCvYmm6W+sbQ0ydaLpg5bFAUuWG1cjqOl8vqrw==", "dependencies": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^28.0.2", + "@jest/types": "^28.1.0", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^28.0.2", + "pretty-format": "^28.1.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -11332,11 +11344,11 @@ } }, "node_modules/jest-watch-typeahead/node_modules/jest-util": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-28.0.2.tgz", - "integrity": "sha512-EVdpIRCC8lzqhp9A0u0aAKlsFIzufK6xKxNK7awsnebTdOP4hpyQW5o6Ox2qPl8gbeUKYF+POLyItaND53kpGA==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-28.1.0.tgz", + "integrity": "sha512-qYdCKD77k4Hwkose2YBEqQk7PzUf/NSE+rutzceduFveQREeH6b+89Dc9+wjX9dAwHcgdx4yedGA3FQlU/qCTA==", "dependencies": { - "@jest/types": "^28.0.2", + "@jest/types": "^28.1.0", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -11348,17 +11360,17 @@ } }, "node_modules/jest-watch-typeahead/node_modules/jest-watcher": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-28.0.2.tgz", - "integrity": "sha512-uIVJLpQ/5VTGQWBiBatHsi7jrCqHjHl0e0dFHMWzwuIfUbdW/muk0DtSr0fteY2T7QTFylv+7a5Rm8sBKrE12Q==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-28.1.0.tgz", + "integrity": "sha512-tNHMtfLE8Njcr2IRS+5rXYA4BhU90gAOwI9frTGOqd+jX0P/Au/JfRSNqsf5nUTcWdbVYuLxS1KjnzILSoR5hA==", "dependencies": { - "@jest/test-result": "^28.0.2", - "@jest/types": "^28.0.2", + "@jest/test-result": "^28.1.0", + "@jest/types": "^28.1.0", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.10.2", - "jest-util": "^28.0.2", + "jest-util": "^28.1.0", "string-length": "^4.0.1" }, "engines": { @@ -11389,9 +11401,9 @@ } }, "node_modules/jest-watch-typeahead/node_modules/pretty-format": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.0.2.tgz", - "integrity": "sha512-UmGZ1IERwS3yY35LDMTaBUYI1w4udZDdJGGT/DqQeKG9ZLDn7/K2Jf/JtYSRiHCCKMHvUA+zsEGSmHdpaVp1yw==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.0.tgz", + "integrity": "sha512-79Z4wWOYCdvQkEoEuSlBhHJqWeZ8D8YRPiPctJFCtvuaClGpiwiQYSCUOE6IEKUbbFukKOTFIUAXE8N4EQTo1Q==", "dependencies": { "@jest/schemas": "^28.0.2", "ansi-regex": "^5.0.1", @@ -12624,12 +12636,12 @@ } }, "node_modules/object.hasown": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.0.tgz", - "integrity": "sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.1.tgz", + "integrity": "sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==", "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -13090,27 +13102,6 @@ "node": ">=4" } }, - "node_modules/portfinder": { - "version": "1.0.28", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", - "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", - "dependencies": { - "async": "^2.6.2", - "debug": "^3.1.1", - "mkdirp": "^0.5.5" - }, - "engines": { - "node": ">= 0.12.0" - } - }, - "node_modules/portfinder/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dependencies": { - "ms": "^2.1.1" - } - }, "node_modules/postcss": { "version": "8.4.13", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.13.tgz", @@ -15318,9 +15309,9 @@ } }, "node_modules/rollup": { - "version": "2.71.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.71.1.tgz", - "integrity": "sha512-lMZk3XfUBGjrrZQpvPSoXcZSfKcJ2Bgn+Z0L1MoW2V8Wh7BVM+LOBJTPo16yul2MwL59cXedzW1ruq3rCjSRgw==", + "version": "2.72.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.0.tgz", + "integrity": "sha512-KqtR2YcO35/KKijg4nx4STO3569aqCUeGRkKWnJ6r+AvBBrVY9L4pmf4NHVrQr4mTOq6msbohflxr2kpihhaOA==", "bin": { "rollup": "dist/bin/rollup" }, @@ -17224,9 +17215,9 @@ } }, "node_modules/webpack-dev-server": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.8.1.tgz", - "integrity": "sha512-dwld70gkgNJa33czmcj/PlKY/nOy/BimbrgZRaR9vDATBQAYgLzggR0nxDtPLJiLrMgZwbE6RRfJ5vnBBasTyg==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.9.0.tgz", + "integrity": "sha512-+Nlb39iQSOSsFv0lWUuUTim3jDQO8nhK3E68f//J2r5rIcp4lULHXz2oZ0UVdEeWXEh5lSzYUlzarZhDAeAVQw==", "dependencies": { "@types/bonjour": "^3.5.9", "@types/connect-history-api-fallback": "^1.3.5", @@ -17248,7 +17239,6 @@ "ipaddr.js": "^2.0.1", "open": "^8.0.9", "p-retry": "^4.5.0", - "portfinder": "^1.0.28", "rimraf": "^3.0.2", "schema-utils": "^4.0.0", "selfsigned": "^2.0.1", @@ -19917,24 +19907,24 @@ } }, "@jridgewell/resolve-uri": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.6.tgz", - "integrity": "sha512-R7xHtBSNm+9SyvpJkdQl+qrM3Hm2fea3Ef197M3mUug+v+yR+Rhfbs7PBtcBUVnIWJ4JcAdjvij+c8hXS9p5aw==" + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", + "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==" }, "@jridgewell/set-array": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.0.tgz", - "integrity": "sha512-SfJxIxNVYLTsKwzB3MoOQ1yxf4w/E6MdkvTgrgAt1bfxjSrLUoHMKrDOykwN14q65waezZIdqDneUIPh4/sKxg==" + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.1.tgz", + "integrity": "sha512-Ct5MqZkLGEXTVmQYbGtx9SVqD2fqwvdubdps5D3djjAkgkKwT918VNOz65pEHFaYTeWcukmJmH5SwsA9Tn2ObQ==" }, "@jridgewell/sourcemap-codec": { - "version": "1.4.12", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.12.tgz", - "integrity": "sha512-az/NhpIwP3K33ILr0T2bso+k2E/SLf8Yidd8mHl0n6sCQ4YdyC8qDhZA6kOPDNDBA56ZnIjngVl0U3jREA0BUA==" + "version": "1.4.13", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", + "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==" }, "@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "version": "0.3.10", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.10.tgz", + "integrity": "sha512-Q0YbBd6OTsXm8Y21+YUSDXupHnodNC2M4O18jtd3iwJ3+vMZNdKGols0a9G6JOK0dcJ3IdUUHoh908ZI6qhk8Q==", "requires": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" @@ -21231,12 +21221,9 @@ "integrity": "sha1-9wtzXGvKGlycItmCw+Oef+ujva0=" }, "async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "requires": { - "lodash": "^4.17.14" - } + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", + "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" }, "async-validator": { "version": "4.1.1", @@ -21839,9 +21826,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001335", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001335.tgz", - "integrity": "sha512-ddP1Tgm7z2iIxu6QTtbZUv6HJxSaV/PZeSrWFZtbY4JZ69tOeNhBCl3HyRQgeNZKE5AOn1kpV7fhljigy0Ty3w==" + "version": "1.0.30001338", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001338.tgz", + "integrity": "sha512-1gLHWyfVoRDsHieO+CaeYe7jSo/MT7D7lhaXUiwwbuR5BwQxORs0f1tAwUSQr3YbxRXJvxHM/PA5FfPQRnsPeQ==" }, "case-sensitive-paths-webpack-plugin": { "version": "2.4.0", @@ -22773,9 +22760,9 @@ } }, "electron-to-chromium": { - "version": "1.4.132", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.132.tgz", - "integrity": "sha512-JYdZUw/1068NWN+SwXQ7w6Ue0bWYGihvSUNNQwurvcDV/SM7vSiGZ3NuFvFgoEiCs4kB8xs3cX2an3wB7d4TBw==" + "version": "1.4.136", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.136.tgz", + "integrity": "sha512-GnITX8rHnUrIVnTxU9UlsTnSemHUA2iF+6QrRqxFbp/mf0vfuSc/goEyyQhUX3TUUCE3mv/4BNuXOtaJ4ur0eA==" }, "emittery": { "version": "0.8.1", @@ -22837,16 +22824,18 @@ } }, "es-abstract": { - "version": "1.19.5", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.19.5.tgz", - "integrity": "sha512-Aa2G2+Rd3b6kxEUKTF4TaW67czBLyAv3z7VOhYRU50YBx+bbsYZ9xQP4lMNazePuFlybXI0V4MruPos7qUo5fA==", + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.20.0.tgz", + "integrity": "sha512-URbD8tgRthKD3YcC39vbvSDrX23upXnPcnGAjQfgxXF5ID75YcENawc9ZX/9iTP9ptUyfCLIxTTuMYoRfiOVKA==", "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", + "function.prototype.name": "^1.1.5", "get-intrinsic": "^1.1.1", "get-symbol-description": "^1.0.0", "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", "has-symbols": "^1.0.3", "internal-slot": "^1.0.3", "is-callable": "^1.2.4", @@ -22858,9 +22847,10 @@ "object-inspect": "^1.12.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", - "string.prototype.trimend": "^1.0.4", - "string.prototype.trimstart": "^1.0.4", - "unbox-primitive": "^1.0.1" + "regexp.prototype.flags": "^1.4.1", + "string.prototype.trimend": "^1.0.5", + "string.prototype.trimstart": "^1.0.5", + "unbox-primitive": "^1.0.2" } }, "es-module-lexer": { @@ -23931,6 +23921,17 @@ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" }, + "function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "requires": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" + } + }, "functional-red-black-tree": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", @@ -24800,11 +24801,6 @@ "color-convert": "^2.0.1" } }, - "async": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.3.tgz", - "integrity": "sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g==" - }, "chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -25902,15 +25898,15 @@ }, "dependencies": { "@jest/console": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/@jest/console/-/console-28.0.2.tgz", - "integrity": "sha512-tiRpnMeeyQuuzgL5UNSeiqMwF8UOWPbAE5rzcu/1zyq4oPG2Ox6xm4YCOruwbp10F8odWc+XwVxTyGzMSLMqxA==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-28.1.0.tgz", + "integrity": "sha512-tscn3dlJFGay47kb4qVruQg/XWlmvU0xp3EJOjzzY+sBaI+YgwKcvAmTcyYU7xEiLLIY5HCdWRooAL8dqkFlDA==", "requires": { - "@jest/types": "^28.0.2", + "@jest/types": "^28.1.0", "@types/node": "*", "chalk": "^4.0.0", - "jest-message-util": "^28.0.2", - "jest-util": "^28.0.2", + "jest-message-util": "^28.1.0", + "jest-util": "^28.1.0", "slash": "^3.0.0" }, "dependencies": { @@ -25922,20 +25918,20 @@ } }, "@jest/test-result": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-28.0.2.tgz", - "integrity": "sha512-4EUqgjq9VzyUiVTvZfI9IRJD6t3NYBNP4f+Eq8Zr93+hkJ0RrGU4OBTw8tfNzidKX+bmuYzn8FxqpxOPIGGCMA==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-28.1.0.tgz", + "integrity": "sha512-sBBFIyoPzrZho3N+80P35A5oAkSKlGfsEFfXFWuPGBsW40UAjCkGakZhn4UQK4iQlW2vgCDMRDOob9FGKV8YoQ==", "requires": { - "@jest/console": "^28.0.2", - "@jest/types": "^28.0.2", + "@jest/console": "^28.1.0", + "@jest/types": "^28.1.0", "@types/istanbul-lib-coverage": "^2.0.0", "collect-v8-coverage": "^1.0.0" } }, "@jest/types": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-28.0.2.tgz", - "integrity": "sha512-hi3jUdm9iht7I2yrV5C4s3ucCJHUP8Eh3W6rQ1s4n/Qw9rQgsda4eqCt+r3BKRi7klVmZfQlMx1nGlzNMP2d8A==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-28.1.0.tgz", + "integrity": "sha512-xmEggMPr317MIOjjDoZ4ejCSr9Lpbt/u34+dvc99t7DS8YirW5rwZEhzKPC2BMUFkUhI48qs6qLUSGw5FuL0GA==", "requires": { "@jest/schemas": "^28.0.2", "@types/istanbul-lib-coverage": "^2.0.0", @@ -25994,17 +25990,17 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "jest-message-util": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.0.2.tgz", - "integrity": "sha512-knK7XyojvwYh1XiF2wmVdskgM/uN11KsjcEWWHfnMZNEdwXCrqB4sCBO94F4cfiAwCS8WFV6CDixDwPlMh/wdA==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-28.1.0.tgz", + "integrity": "sha512-RpA8mpaJ/B2HphDMiDlrAZdDytkmwFqgjDZovM21F35lHGeUeCvYmm6W+sbQ0ydaLpg5bFAUuWG1cjqOl8vqrw==", "requires": { "@babel/code-frame": "^7.12.13", - "@jest/types": "^28.0.2", + "@jest/types": "^28.1.0", "@types/stack-utils": "^2.0.0", "chalk": "^4.0.0", "graceful-fs": "^4.2.9", "micromatch": "^4.0.4", - "pretty-format": "^28.0.2", + "pretty-format": "^28.1.0", "slash": "^3.0.0", "stack-utils": "^2.0.3" }, @@ -26022,11 +26018,11 @@ "integrity": "sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw==" }, "jest-util": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-28.0.2.tgz", - "integrity": "sha512-EVdpIRCC8lzqhp9A0u0aAKlsFIzufK6xKxNK7awsnebTdOP4hpyQW5o6Ox2qPl8gbeUKYF+POLyItaND53kpGA==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-28.1.0.tgz", + "integrity": "sha512-qYdCKD77k4Hwkose2YBEqQk7PzUf/NSE+rutzceduFveQREeH6b+89Dc9+wjX9dAwHcgdx4yedGA3FQlU/qCTA==", "requires": { - "@jest/types": "^28.0.2", + "@jest/types": "^28.1.0", "@types/node": "*", "chalk": "^4.0.0", "ci-info": "^3.2.0", @@ -26035,17 +26031,17 @@ } }, "jest-watcher": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-28.0.2.tgz", - "integrity": "sha512-uIVJLpQ/5VTGQWBiBatHsi7jrCqHjHl0e0dFHMWzwuIfUbdW/muk0DtSr0fteY2T7QTFylv+7a5Rm8sBKrE12Q==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-28.1.0.tgz", + "integrity": "sha512-tNHMtfLE8Njcr2IRS+5rXYA4BhU90gAOwI9frTGOqd+jX0P/Au/JfRSNqsf5nUTcWdbVYuLxS1KjnzILSoR5hA==", "requires": { - "@jest/test-result": "^28.0.2", - "@jest/types": "^28.0.2", + "@jest/test-result": "^28.1.0", + "@jest/types": "^28.1.0", "@types/node": "*", "ansi-escapes": "^4.2.1", "chalk": "^4.0.0", "emittery": "^0.10.2", - "jest-util": "^28.0.2", + "jest-util": "^28.1.0", "string-length": "^4.0.1" }, "dependencies": { @@ -26069,9 +26065,9 @@ } }, "pretty-format": { - "version": "28.0.2", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.0.2.tgz", - "integrity": "sha512-UmGZ1IERwS3yY35LDMTaBUYI1w4udZDdJGGT/DqQeKG9ZLDn7/K2Jf/JtYSRiHCCKMHvUA+zsEGSmHdpaVp1yw==", + "version": "28.1.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-28.1.0.tgz", + "integrity": "sha512-79Z4wWOYCdvQkEoEuSlBhHJqWeZ8D8YRPiPctJFCtvuaClGpiwiQYSCUOE6IEKUbbFukKOTFIUAXE8N4EQTo1Q==", "requires": { "@jest/schemas": "^28.0.2", "ansi-regex": "^5.0.1", @@ -26974,12 +26970,12 @@ } }, "object.hasown": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.0.tgz", - "integrity": "sha512-MhjYRfj3GBlhSkDHo6QmvgjRLXQ2zndabdf3nX0yTyZK9rPfxb6uRpAac8HXNLy1GpqWtZ81Qh4v3uOls2sRAg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object.hasown/-/object.hasown-1.1.1.tgz", + "integrity": "sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==", "requires": { - "define-properties": "^1.1.3", - "es-abstract": "^1.19.1" + "define-properties": "^1.1.4", + "es-abstract": "^1.19.5" } }, "object.values": { @@ -27303,26 +27299,6 @@ } } }, - "portfinder": { - "version": "1.0.28", - "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz", - "integrity": "sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==", - "requires": { - "async": "^2.6.2", - "debug": "^3.1.1", - "mkdirp": "^0.5.5" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "requires": { - "ms": "^2.1.1" - } - } - } - }, "postcss": { "version": "8.4.13", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.13.tgz", @@ -28786,9 +28762,9 @@ } }, "rollup": { - "version": "2.71.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.71.1.tgz", - "integrity": "sha512-lMZk3XfUBGjrrZQpvPSoXcZSfKcJ2Bgn+Z0L1MoW2V8Wh7BVM+LOBJTPo16yul2MwL59cXedzW1ruq3rCjSRgw==", + "version": "2.72.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.72.0.tgz", + "integrity": "sha512-KqtR2YcO35/KKijg4nx4STO3569aqCUeGRkKWnJ6r+AvBBrVY9L4pmf4NHVrQr4mTOq6msbohflxr2kpihhaOA==", "requires": { "fsevents": "~2.3.2" } @@ -30239,9 +30215,9 @@ } }, "webpack-dev-server": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.8.1.tgz", - "integrity": "sha512-dwld70gkgNJa33czmcj/PlKY/nOy/BimbrgZRaR9vDATBQAYgLzggR0nxDtPLJiLrMgZwbE6RRfJ5vnBBasTyg==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-4.9.0.tgz", + "integrity": "sha512-+Nlb39iQSOSsFv0lWUuUTim3jDQO8nhK3E68f//J2r5rIcp4lULHXz2oZ0UVdEeWXEh5lSzYUlzarZhDAeAVQw==", "requires": { "@types/bonjour": "^3.5.9", "@types/connect-history-api-fallback": "^1.3.5", @@ -30263,7 +30239,6 @@ "ipaddr.js": "^2.0.1", "open": "^8.0.9", "p-retry": "^4.5.0", - "portfinder": "^1.0.28", "rimraf": "^3.0.2", "schema-utils": "^4.0.0", "selfsigned": "^2.0.1", diff --git a/interface/src/project/DashboardData.tsx b/interface/src/project/DashboardData.tsx index 6d3b9440f..42dd661df 100644 --- a/interface/src/project/DashboardData.tsx +++ b/interface/src/project/DashboardData.tsx @@ -355,7 +355,7 @@ const DashboardData: FC = () => { if (sc === '' || sc === '""') { return sc; } - if (sc.includes('"') || sc.includes(',') || sc.includes('\n') || sc.includes('\r')) { + if (sc.includes('"') || sc.includes(';') || sc.includes('\n') || sc.includes('\r')) { return '"' + sc.replace(/"/g, '""') + '"'; } return sc; @@ -363,13 +363,13 @@ const DashboardData: FC = () => { const makeCsvData = (columns: any, data: any) => { return data.reduce((csvString: any, rowItem: any) => { - return csvString + columns.map(({ accessor }: any) => escapeCsvCell(accessor(rowItem))).join(',') + '\r\n'; - }, columns.map(({ name }: any) => escapeCsvCell(name)).join(',') + '\r\n'); + return csvString + columns.map(({ accessor }: any) => escapeCsvCell(accessor(rowItem))).join(';') + '\r\n'; + }, columns.map(({ name }: any) => escapeCsvCell(name)).join(';') + '\r\n'); }; const downloadAsCsv = (columns: any, data: any, filename: string) => { const csvData = makeCsvData(columns, data); - const csvFile = new Blob([csvData], { type: 'text/csv' }); + const csvFile = new Blob([csvData], { type: 'text/csv;charset:utf-8' }); const downloadLink = document.createElement('a'); downloadLink.download = filename; @@ -384,8 +384,8 @@ const DashboardData: FC = () => { const handleDownloadCsv = () => { const columns = [ { accessor: (dv: any) => dv.id.slice(2), name: 'Entity' }, - { accessor: (dv: any) => dv.v, name: 'Value' }, - { accessor: (dv: any) => (dv.u >= 1 && dv.u <= 2 ? 'C' : DeviceValueUOM_s[dv.u]), name: 'UoM' } + { accessor: (dv: any) => (typeof dv.v === 'number') ? new Intl.NumberFormat().format(dv.v) : dv.v, name: 'Value' }, + { accessor: (dv: any) => DeviceValueUOM_s[dv.u], name: 'UoM' } ]; downloadAsCsv( columns, diff --git a/src/analogsensor.cpp b/src/analogsensor.cpp index 7a6856f53..8131754d6 100644 --- a/src/analogsensor.cpp +++ b/src/analogsensor.cpp @@ -435,15 +435,43 @@ void AnalogSensor::publish_values(const bool force) { // called from emsesp.cpp, similar to the emsdevice->get_value_info // searches by name bool AnalogSensor::get_value_info(JsonObject & output, const char * cmd, const int8_t id) const { + // make a copy of the string command for parsing + char command_s[30]; + strlcpy(command_s, cmd, sizeof(command_s)); + char * attribute_s = nullptr; + + // check specific attribute to fetch instead of the complete record + char * breakp = strchr(command_s, '/'); + if (breakp) { + *breakp = '\0'; + attribute_s = breakp + 1; + } + for (const auto & sensor : sensors_) { - if (strcmp(cmd, sensor.name().c_str()) == 0) { + if (strcmp(command_s, sensor.name().c_str()) == 0) { output["gpio"] = sensor.gpio(); output["name"] = sensor.name(); - output["type"] = sensor.type(); - output["uom"] = sensor.uom(); + output["type"] = F_(number); + output["analog"] = FL_(enum_sensortype)[sensor.type()]; + output["uom"] = EMSdevice::uom_to_string(sensor.uom()); output["offset"] = sensor.offset(); output["factor"] = sensor.factor(); output["value"] = sensor.value(); + // if we're filtering on an attribute, go find it + if (attribute_s) { + if (output.containsKey(attribute_s)) { + JsonVariant data = output[attribute_s]; + output.clear(); + output["api_data"] = data; + return true; + } else { + char error[100]; + snprintf(error, sizeof(error), "cannot find attribute %s in entity %s", attribute_s, command_s); + output.clear(); + output["message"] = error; + return false; + } + } return true; } } @@ -461,7 +489,8 @@ bool AnalogSensor::command_info(const char * value, const int8_t id, JsonObject if (id == -1) { // show number and id JsonObject dataSensor = output.createNestedObject(sensor.name()); dataSensor["gpio"] = sensor.gpio(); - dataSensor["type"] = FL_(enum_sensortype)[sensor.type()]; + dataSensor["type"] = F_(number); + dataSensor["analog"] = FL_(enum_sensortype)[sensor.type()]; if (sensor.type() == AnalogType::ADC) { dataSensor["uom"] = EMSdevice::uom_to_string(sensor.uom()); dataSensor["offset"] = sensor.offset(); diff --git a/src/command.cpp b/src/command.cpp index 3af705d56..e54cc1ced 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -96,7 +96,7 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec snprintf(command, sizeof(command), "%s/%s", p.paths()[1].c_str(), p.paths()[2].c_str()); command_p = command; } else if (num_paths > 3) { - // concatenate the path into one string as it could be in the format 'hc/XXX' + // concatenate the path into one string as it could be in the format 'hc/XXX/attribute' char command[50]; snprintf(command, sizeof(command), "%s/%s/%s", p.paths()[1].c_str(), p.paths()[2].c_str(), p.paths()[3].c_str()); command_p = command; @@ -192,37 +192,7 @@ const char * Command::parse_command_string(const char * command, int8_t & id) { if (command == nullptr) { return nullptr; } - /* - // make a copy of the string command for parsing - char command_s[30]; - strlcpy(command_s, command, sizeof(command_s)); - - // look for a delimeter and split the string - char * p = command_s; - char * breakp = strchr(p, '.'); - if (!breakp) { - p = command_s; // reset and look for / - breakp = strchr(p, '/'); - if (!breakp) { - p = command_s; // reset and look for _ - breakp = strchr(p, '_'); - if (!breakp) { - return command; // no delimeter found, return the whole string - } - } - } - // extract the hc or wwc number - uint8_t start_pos = breakp - p + 1; - if (!strncmp(command, "hc", 2) && start_pos == 4) { - id = command[start_pos - 2] - '0'; - } else if (!strncmp(command, "wwc", 3) && start_pos == 5) { - id = command[start_pos - 2] - '0' + 8; // wwc1 has id 9 - } else { - // id = 0; // special case for extracting the attributes - return command; - } - */ if (!strncmp(command, "hc", 2) && strlen(command) >= 3) { id = command[2] - '0'; command += 3; @@ -235,12 +205,15 @@ const char * Command::parse_command_string(const char * command, int8_t & id) { command += 4; } } + // remove separator if (command[0] == '/' || command[0] == '.' || command[0] == '_') { command++; } + // return null for empty command if (command[0] == '\0') { return nullptr; } + return command; } diff --git a/src/dallassensor.cpp b/src/dallassensor.cpp index a66e070fd..58c15e123 100644 --- a/src/dallassensor.cpp +++ b/src/dallassensor.cpp @@ -375,8 +375,20 @@ bool DallasSensor::command_info(const char * value, const int8_t id, JsonObject // called from emsesp.cpp, similar to the emsdevice->get_value_info bool DallasSensor::get_value_info(JsonObject & output, const char * cmd, const int8_t id) { + // make a copy of the string command for parsing + char command_s[30]; + strlcpy(command_s, cmd, sizeof(command_s)); + char * attribute_s = nullptr; + + // check specific attribute to fetch instead of the complete record + char * breakp = strchr(command_s, '/'); + if (breakp) { + *breakp = '\0'; + attribute_s = breakp + 1; + } + for (const auto & sensor : sensors_) { - if (strcmp(cmd, sensor.name().c_str()) == 0) { + if (strcmp(command_s, sensor.name().c_str()) == 0) { output["id"] = sensor.id(); output["name"] = sensor.name(); if (Helpers::hasValue(sensor.temperature_c)) { @@ -385,8 +397,23 @@ bool DallasSensor::get_value_info(JsonObject & output, const char * cmd, const i output["type"] = F_(number); output["min"] = Helpers::round2(-55, 0, EMSESP::system_.fahrenheit() ? 2 : 0); output["max"] = Helpers::round2(125, 0, EMSESP::system_.fahrenheit() ? 2 : 0); - output["unit"] = EMSdevice::uom_to_string(DeviceValueUOM::DEGREES); + output["uom"] = EMSdevice::uom_to_string(DeviceValueUOM::DEGREES); output["writeable"] = false; + // if we're filtering on an attribute, go find it + if (attribute_s) { + if (output.containsKey(attribute_s)) { + JsonVariant data = output[attribute_s]; + output.clear(); + output["api_data"] = data; + return true; + } else { + char error[100]; + snprintf(error, sizeof(error), "cannot find attribute %s in entity %s", attribute_s, command_s); + output.clear(); + output["message"] = error; + return false; + } + } return true; } } diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 581effa6c..900894d6e 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -925,10 +925,8 @@ bool EMSdevice::get_value_info(JsonObject & output, const char * cmd, const int8 // check specific attribute to fetch instead of the complete record char * breakp = strchr(command_s, '/'); if (breakp) { - *breakp = '\0'; - if (strlen(breakp + 1)) { - attribute_s = breakp + 1; - } + *breakp = '\0'; + attribute_s = breakp + 1; } // search device value with this tag