From ccbb56d4031dd47b690e646f228d35982e337ee5 Mon Sep 17 00:00:00 2001 From: Proddy Date: Wed, 14 Dec 2022 22:07:42 +0100 Subject: [PATCH 1/4] add v3.4 entity id flag to MQTT settings --- interface/package-lock.json | 210 +++++++++--------- interface/package.json | 6 +- .../src/framework/mqtt/MqttSettingsForm.tsx | 8 + interface/src/i18n/de/index.ts | 1 + interface/src/i18n/en/index.ts | 1 + interface/src/i18n/nl/index.ts | 1 + interface/src/i18n/no/index.ts | 1 + interface/src/i18n/pl/index.ts | 1 + interface/src/i18n/se/index.ts | 1 + interface/src/types/mqtt.ts | 1 + lib/framework/MqttSettingsService.cpp | 7 +- lib/framework/MqttSettingsService.h | 7 + lib_standalone/ESP8266React.h | 1 + mock-api/server.js | 1 + src/mqtt.cpp | 17 +- src/mqtt.h | 6 + src/system.cpp | 1 + src/version.h | 2 +- 18 files changed, 158 insertions(+), 115 deletions(-) diff --git a/interface/package-lock.json b/interface/package-lock.json index 59ff55056..d954a2317 100644 --- a/interface/package-lock.json +++ b/interface/package-lock.json @@ -11,11 +11,11 @@ "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@msgpack/msgpack": "^2.8.0", - "@mui/icons-material": "^5.10.16", - "@mui/material": "^5.10.17", + "@mui/icons-material": "^5.11.0", + "@mui/material": "^5.11.0", "@table-library/react-table-library": "4.0.23", "@types/lodash": "^4.14.191", - "@types/node": "^18.11.12", + "@types/node": "^18.11.15", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", "@types/react-router-dom": "^5.3.3", @@ -3091,14 +3091,14 @@ } }, "node_modules/@mui/base": { - "version": "5.0.0-alpha.109", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.109.tgz", - "integrity": "sha512-UQxoONPI3ntzxcD/cbFHl+Lp2xsVj6HpKmU9QhUZ2kZ2K2yej2QJyU1gnADoWl/Hu94VrvwSSRnjTjR3HvXO/g==", + "version": "5.0.0-alpha.110", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.110.tgz", + "integrity": "sha512-q4TH9T3sTBknTXXTEf2zO8F3nbHg5iGgiaRx9XErTbXvHrmLrQXbQ4hmrLERocSTBFCFWkKyne/qZj0diWlPtA==", "dependencies": { - "@babel/runtime": "^7.20.1", + "@babel/runtime": "^7.20.6", "@emotion/is-prop-valid": "^1.2.0", - "@mui/types": "^7.2.2", - "@mui/utils": "^5.10.16", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.0", "@popperjs/core": "^2.11.6", "clsx": "^1.2.1", "prop-types": "^15.8.1", @@ -3123,20 +3123,20 @@ } }, "node_modules/@mui/core-downloads-tracker": { - "version": "5.10.17", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.17.tgz", - "integrity": "sha512-iNwUuMA30nrN0tiEkeD3zaczv7Tk2jlZIDbXRnijAsYXkZtl/xEzQsVRIPYRDuyEz6D18vQJhV8h7gPUXEubTg==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.0.tgz", + "integrity": "sha512-Bmogung451ezVv2YI1RvweOIVsTj2RQ4Fk61+e/+8LFPLTFEwVGbL0YhNy1VB5tri8pzGNV228kxtWVTFooQkg==", "funding": { "type": "opencollective", "url": "https://opencollective.com/mui" } }, "node_modules/@mui/icons-material": { - "version": "5.10.16", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.10.16.tgz", - "integrity": "sha512-jjCc0IF6iyLiucQCu5igg3fOscSqbbvRCmyRxXgzOcLR56B0sg2L8o+ZfJ0dAg59+wvgtXaxvjze/mJg0B4iWA==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.11.0.tgz", + "integrity": "sha512-I2LaOKqO8a0xcLGtIozC9xoXjZAto5G5gh0FYUMAlbsIHNHIjn4Xrw9rvjY20vZonyiGrZNMAlAXYkY6JvhF6A==", "dependencies": { - "@babel/runtime": "^7.20.1" + "@babel/runtime": "^7.20.6" }, "engines": { "node": ">=12.0.0" @@ -3157,16 +3157,16 @@ } }, "node_modules/@mui/material": { - "version": "5.10.17", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.17.tgz", - "integrity": "sha512-Kuqgv1qI5HXnc/Xu426xhCGYBSKzplb+xFNLitbnIb92Qx8jmcpfNpFlDJa2kD2H6qP66rr/m4c/zMUfGX/xBQ==", - "dependencies": { - "@babel/runtime": "^7.20.1", - "@mui/base": "5.0.0-alpha.109", - "@mui/core-downloads-tracker": "^5.10.17", - "@mui/system": "^5.10.17", - "@mui/types": "^7.2.2", - "@mui/utils": "^5.10.16", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.0.tgz", + "integrity": "sha512-8Zl34lb89rLKTTi50Kakki675/LLHMKKnkp8Ee3rAZ2qmisQlRODsGh1MBjENKp0vwhQnNSvlsCfJteVTfotPQ==", + "dependencies": { + "@babel/runtime": "^7.20.6", + "@mui/base": "5.0.0-alpha.110", + "@mui/core-downloads-tracker": "^5.11.0", + "@mui/system": "^5.11.0", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.0", "@types/react-transition-group": "^4.4.5", "clsx": "^1.2.1", "csstype": "^3.1.1", @@ -3201,12 +3201,12 @@ } }, "node_modules/@mui/private-theming": { - "version": "5.10.16", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.10.16.tgz", - "integrity": "sha512-0MArkJaOHRCKqL/GWjngGZmyOeRz+uxffhx82bKcewr8swqV7xx7EFP02pk0L/gLdfcvYdqwH4YTVjG/+TaKrg==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.0.tgz", + "integrity": "sha512-UFQLb9x5Sj4pg2GhhCGw3Ls/y1Hw/tz9RsBrULvUF0Vgps1z19o7XTq2xqUvp7pN7fJTW7eVIT2gwVg2xlk8PQ==", "dependencies": { - "@babel/runtime": "^7.20.1", - "@mui/utils": "^5.10.16", + "@babel/runtime": "^7.20.6", + "@mui/utils": "^5.11.0", "prop-types": "^15.8.1" }, "engines": { @@ -3227,11 +3227,11 @@ } }, "node_modules/@mui/styled-engine": { - "version": "5.10.16", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.10.16.tgz", - "integrity": "sha512-ZMSjXvtiGwGDKqrSlXhpxK2voUaF2/lpC/pSTfFmZvKH9j9a9h1/iwo3ybgjFVYGgbfNeW4h0xEchiRohu9xsw==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.11.0.tgz", + "integrity": "sha512-AF06K60Zc58qf0f7X+Y/QjaHaZq16znliLnGc9iVrV/+s8Ln/FCoeNuFvhlCbZZQ5WQcJvcy59zp0nXrklGGPQ==", "dependencies": { - "@babel/runtime": "^7.20.1", + "@babel/runtime": "^7.20.6", "@emotion/cache": "^11.10.5", "csstype": "^3.1.1", "prop-types": "^15.8.1" @@ -3258,15 +3258,15 @@ } }, "node_modules/@mui/system": { - "version": "5.10.17", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.17.tgz", - "integrity": "sha512-UYzAOSK7uxkMsUssqrIUW3lnOuQpU8vqh4hLwfSw+GYAnQo3qjK4m4NhlDx+pFpsjjiGnr3K+vrSH+aIAMbcLg==", - "dependencies": { - "@babel/runtime": "^7.20.1", - "@mui/private-theming": "^5.10.16", - "@mui/styled-engine": "^5.10.16", - "@mui/types": "^7.2.2", - "@mui/utils": "^5.10.16", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.0.tgz", + "integrity": "sha512-HFUT7Dlmyq6Wfuxsw8QBXZxXDYIQQaJ4YHaZd7s+nDMcjerLnILxjh2g3a6umtOUM+jEcRaFJAtvLZvlGfa5fw==", + "dependencies": { + "@babel/runtime": "^7.20.6", + "@mui/private-theming": "^5.11.0", + "@mui/styled-engine": "^5.11.0", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.0", "clsx": "^1.2.1", "csstype": "^3.1.1", "prop-types": "^15.8.1" @@ -3297,9 +3297,9 @@ } }, "node_modules/@mui/types": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.2.tgz", - "integrity": "sha512-siex8cZDtWeC916cXOoUOnEQQejuMYmHtc4hM6VkKVYaBICz3VIiqyiAomRboTQHt2jchxQ5Q5ATlbcDekTxDA==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.3.tgz", + "integrity": "sha512-tZ+CQggbe9Ol7e/Fs5RcKwg/woU+o8DCtOnccX6KmbBc7YrfqMYEYuaIcXHuhpT880QwNkZZ3wQwvtlDFA2yOw==", "peerDependencies": { "@types/react": "*" }, @@ -3310,11 +3310,11 @@ } }, "node_modules/@mui/utils": { - "version": "5.10.16", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.10.16.tgz", - "integrity": "sha512-3MB/SGsgiiu9Z55CFmAfiONUoR7AAue/H4F6w3mc2LnhFQCsoVvXhioDPcsiRpUMIQr34jDPzGXdCuqWooPCXQ==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.11.0.tgz", + "integrity": "sha512-DP/YDaVVCVzJpZ5FFPLKNmaJkeaYRviTyIZkL/D5/FmPXQiA6ecd6z0/+VwoNQtp7aXAQWaRhvz4FM25yqFlHA==", "dependencies": { - "@babel/runtime": "^7.20.1", + "@babel/runtime": "^7.20.6", "@types/prop-types": "^15.7.5", "@types/react-is": "^16.7.1 || ^17.0.0", "prop-types": "^15.8.1", @@ -4017,9 +4017,9 @@ "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" }, "node_modules/@types/node": { - "version": "18.11.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.12.tgz", - "integrity": "sha512-FgD3NtTAKvyMmD44T07zz2fEf+OKwutgBCEVM8GcvMGVGaDktiLNTDvPwC/LUe3PinMW+X6CuLOF2Ui1mAlSXg==" + "version": "18.11.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.15.tgz", + "integrity": "sha512-VkhBbVo2+2oozlkdHXLrb3zjsRkpdnaU2bXmX8Wgle3PUi569eLRaHGlgETQHR7lLL1w7GiG3h9SnePhxNDecw==" }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -19642,14 +19642,14 @@ "integrity": "sha512-h9u4u/jiIRKbq25PM+zymTyW6bhTzELvOoUd+AvYriWOAKpLGnIamaET3pnHYoI5iYphAHBI4ayx0MehR+VVPQ==" }, "@mui/base": { - "version": "5.0.0-alpha.109", - "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.109.tgz", - "integrity": "sha512-UQxoONPI3ntzxcD/cbFHl+Lp2xsVj6HpKmU9QhUZ2kZ2K2yej2QJyU1gnADoWl/Hu94VrvwSSRnjTjR3HvXO/g==", + "version": "5.0.0-alpha.110", + "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.110.tgz", + "integrity": "sha512-q4TH9T3sTBknTXXTEf2zO8F3nbHg5iGgiaRx9XErTbXvHrmLrQXbQ4hmrLERocSTBFCFWkKyne/qZj0diWlPtA==", "requires": { - "@babel/runtime": "^7.20.1", + "@babel/runtime": "^7.20.6", "@emotion/is-prop-valid": "^1.2.0", - "@mui/types": "^7.2.2", - "@mui/utils": "^5.10.16", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.0", "@popperjs/core": "^2.11.6", "clsx": "^1.2.1", "prop-types": "^15.8.1", @@ -19657,29 +19657,29 @@ } }, "@mui/core-downloads-tracker": { - "version": "5.10.17", - "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.10.17.tgz", - "integrity": "sha512-iNwUuMA30nrN0tiEkeD3zaczv7Tk2jlZIDbXRnijAsYXkZtl/xEzQsVRIPYRDuyEz6D18vQJhV8h7gPUXEubTg==" + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.0.tgz", + "integrity": "sha512-Bmogung451ezVv2YI1RvweOIVsTj2RQ4Fk61+e/+8LFPLTFEwVGbL0YhNy1VB5tri8pzGNV228kxtWVTFooQkg==" }, "@mui/icons-material": { - "version": "5.10.16", - "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.10.16.tgz", - "integrity": "sha512-jjCc0IF6iyLiucQCu5igg3fOscSqbbvRCmyRxXgzOcLR56B0sg2L8o+ZfJ0dAg59+wvgtXaxvjze/mJg0B4iWA==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/icons-material/-/icons-material-5.11.0.tgz", + "integrity": "sha512-I2LaOKqO8a0xcLGtIozC9xoXjZAto5G5gh0FYUMAlbsIHNHIjn4Xrw9rvjY20vZonyiGrZNMAlAXYkY6JvhF6A==", "requires": { - "@babel/runtime": "^7.20.1" + "@babel/runtime": "^7.20.6" } }, "@mui/material": { - "version": "5.10.17", - "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.10.17.tgz", - "integrity": "sha512-Kuqgv1qI5HXnc/Xu426xhCGYBSKzplb+xFNLitbnIb92Qx8jmcpfNpFlDJa2kD2H6qP66rr/m4c/zMUfGX/xBQ==", - "requires": { - "@babel/runtime": "^7.20.1", - "@mui/base": "5.0.0-alpha.109", - "@mui/core-downloads-tracker": "^5.10.17", - "@mui/system": "^5.10.17", - "@mui/types": "^7.2.2", - "@mui/utils": "^5.10.16", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.0.tgz", + "integrity": "sha512-8Zl34lb89rLKTTi50Kakki675/LLHMKKnkp8Ee3rAZ2qmisQlRODsGh1MBjENKp0vwhQnNSvlsCfJteVTfotPQ==", + "requires": { + "@babel/runtime": "^7.20.6", + "@mui/base": "5.0.0-alpha.110", + "@mui/core-downloads-tracker": "^5.11.0", + "@mui/system": "^5.11.0", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.0", "@types/react-transition-group": "^4.4.5", "clsx": "^1.2.1", "csstype": "^3.1.1", @@ -19689,53 +19689,53 @@ } }, "@mui/private-theming": { - "version": "5.10.16", - "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.10.16.tgz", - "integrity": "sha512-0MArkJaOHRCKqL/GWjngGZmyOeRz+uxffhx82bKcewr8swqV7xx7EFP02pk0L/gLdfcvYdqwH4YTVjG/+TaKrg==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.0.tgz", + "integrity": "sha512-UFQLb9x5Sj4pg2GhhCGw3Ls/y1Hw/tz9RsBrULvUF0Vgps1z19o7XTq2xqUvp7pN7fJTW7eVIT2gwVg2xlk8PQ==", "requires": { - "@babel/runtime": "^7.20.1", - "@mui/utils": "^5.10.16", + "@babel/runtime": "^7.20.6", + "@mui/utils": "^5.11.0", "prop-types": "^15.8.1" } }, "@mui/styled-engine": { - "version": "5.10.16", - "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.10.16.tgz", - "integrity": "sha512-ZMSjXvtiGwGDKqrSlXhpxK2voUaF2/lpC/pSTfFmZvKH9j9a9h1/iwo3ybgjFVYGgbfNeW4h0xEchiRohu9xsw==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/styled-engine/-/styled-engine-5.11.0.tgz", + "integrity": "sha512-AF06K60Zc58qf0f7X+Y/QjaHaZq16znliLnGc9iVrV/+s8Ln/FCoeNuFvhlCbZZQ5WQcJvcy59zp0nXrklGGPQ==", "requires": { - "@babel/runtime": "^7.20.1", + "@babel/runtime": "^7.20.6", "@emotion/cache": "^11.10.5", "csstype": "^3.1.1", "prop-types": "^15.8.1" } }, "@mui/system": { - "version": "5.10.17", - "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.10.17.tgz", - "integrity": "sha512-UYzAOSK7uxkMsUssqrIUW3lnOuQpU8vqh4hLwfSw+GYAnQo3qjK4m4NhlDx+pFpsjjiGnr3K+vrSH+aIAMbcLg==", - "requires": { - "@babel/runtime": "^7.20.1", - "@mui/private-theming": "^5.10.16", - "@mui/styled-engine": "^5.10.16", - "@mui/types": "^7.2.2", - "@mui/utils": "^5.10.16", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.0.tgz", + "integrity": "sha512-HFUT7Dlmyq6Wfuxsw8QBXZxXDYIQQaJ4YHaZd7s+nDMcjerLnILxjh2g3a6umtOUM+jEcRaFJAtvLZvlGfa5fw==", + "requires": { + "@babel/runtime": "^7.20.6", + "@mui/private-theming": "^5.11.0", + "@mui/styled-engine": "^5.11.0", + "@mui/types": "^7.2.3", + "@mui/utils": "^5.11.0", "clsx": "^1.2.1", "csstype": "^3.1.1", "prop-types": "^15.8.1" } }, "@mui/types": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.2.tgz", - "integrity": "sha512-siex8cZDtWeC916cXOoUOnEQQejuMYmHtc4hM6VkKVYaBICz3VIiqyiAomRboTQHt2jchxQ5Q5ATlbcDekTxDA==", + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/@mui/types/-/types-7.2.3.tgz", + "integrity": "sha512-tZ+CQggbe9Ol7e/Fs5RcKwg/woU+o8DCtOnccX6KmbBc7YrfqMYEYuaIcXHuhpT880QwNkZZ3wQwvtlDFA2yOw==", "requires": {} }, "@mui/utils": { - "version": "5.10.16", - "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.10.16.tgz", - "integrity": "sha512-3MB/SGsgiiu9Z55CFmAfiONUoR7AAue/H4F6w3mc2LnhFQCsoVvXhioDPcsiRpUMIQr34jDPzGXdCuqWooPCXQ==", + "version": "5.11.0", + "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.11.0.tgz", + "integrity": "sha512-DP/YDaVVCVzJpZ5FFPLKNmaJkeaYRviTyIZkL/D5/FmPXQiA6ecd6z0/+VwoNQtp7aXAQWaRhvz4FM25yqFlHA==", "requires": { - "@babel/runtime": "^7.20.1", + "@babel/runtime": "^7.20.6", "@types/prop-types": "^15.7.5", "@types/react-is": "^16.7.1 || ^17.0.0", "prop-types": "^15.8.1", @@ -20232,9 +20232,9 @@ "integrity": "sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==" }, "@types/node": { - "version": "18.11.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.12.tgz", - "integrity": "sha512-FgD3NtTAKvyMmD44T07zz2fEf+OKwutgBCEVM8GcvMGVGaDktiLNTDvPwC/LUe3PinMW+X6CuLOF2Ui1mAlSXg==" + "version": "18.11.15", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.15.tgz", + "integrity": "sha512-VkhBbVo2+2oozlkdHXLrb3zjsRkpdnaU2bXmX8Wgle3PUi569eLRaHGlgETQHR7lLL1w7GiG3h9SnePhxNDecw==" }, "@types/parse-json": { "version": "4.0.0", diff --git a/interface/package.json b/interface/package.json index 4238aba64..bda56b4c0 100644 --- a/interface/package.json +++ b/interface/package.json @@ -7,11 +7,11 @@ "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@msgpack/msgpack": "^2.8.0", - "@mui/icons-material": "^5.10.16", - "@mui/material": "^5.10.17", + "@mui/icons-material": "^5.11.0", + "@mui/material": "^5.11.0", "@table-library/react-table-library": "4.0.23", "@types/lodash": "^4.14.191", - "@types/node": "^18.11.12", + "@types/node": "^18.11.15", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", "@types/react-router-dom": "^5.3.3", diff --git a/interface/src/framework/mqtt/MqttSettingsForm.tsx b/interface/src/framework/mqtt/MqttSettingsForm.tsx index 03f305508..f3059463a 100644 --- a/interface/src/framework/mqtt/MqttSettingsForm.tsx +++ b/interface/src/framework/mqtt/MqttSettingsForm.tsx @@ -233,6 +233,14 @@ const MqttSettingsForm: FC = () => { label={LL.MQTT_MULTIPLE_INSTANCES()} /> + + + } + label={LL.MQTT_ENTITY_FULLNAME()} + /> + Date: Thu, 15 Dec 2022 21:51:11 +0100 Subject: [PATCH 2/4] merge multiple_instances with entity_format --- .../src/framework/mqtt/MqttSettingsForm.tsx | 62 +++++++++---------- interface/src/i18n/de/index.ts | 5 +- interface/src/i18n/en/index.ts | 5 +- interface/src/i18n/nl/index.ts | 5 +- interface/src/i18n/no/index.ts | 5 +- interface/src/i18n/pl/index.ts | 5 +- interface/src/i18n/se/index.ts | 5 +- interface/src/types/mqtt.ts | 1 - lib/framework/MqttSettingsService.cpp | 2 - lib/framework/MqttSettingsService.h | 7 --- lib_standalone/ESP8266React.h | 1 - mock-api/server.js | 1 - src/mqtt.cpp | 16 ++--- src/mqtt.h | 5 -- src/system.cpp | 1 - 15 files changed, 52 insertions(+), 74 deletions(-) diff --git a/interface/src/framework/mqtt/MqttSettingsForm.tsx b/interface/src/framework/mqtt/MqttSettingsForm.tsx index f3059463a..85f468771 100644 --- a/interface/src/framework/mqtt/MqttSettingsForm.tsx +++ b/interface/src/framework/mqtt/MqttSettingsForm.tsx @@ -170,6 +170,7 @@ const MqttSettingsForm: FC = () => { control={} label={LL.MQTT_RETAIN_FLAG()} /> + {LL.FORMATTING()} @@ -214,49 +215,46 @@ const MqttSettingsForm: FC = () => { } label={LL.MQTT_PUBLISH_TEXT_3()} /> {data.ha_enabled && ( <> - - - } - label={LL.MQTT_MULTIPLE_INSTANCES()} - /> - - - - } - label={LL.MQTT_ENTITY_FULLNAME()} - /> - - - + + + + + + + {LL.MQTT_ENTITY_FORMAT_0()} + {LL.MQTT_ENTITY_FORMAT_1()} + + )} )} - + {LL.MQTT_PUBLISH_INTERVALS()} (0=auto) diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts index acf30a622..f480b9c51 100644 --- a/interface/src/i18n/de/index.ts +++ b/interface/src/i18n/de/index.ts @@ -249,8 +249,9 @@ const de: Translation = { MQTT_INT_HEARTBEAT: 'Heartbeat', MQTT_QUEUE: 'MQTT Queue', DEFAULT: 'Standard', - MQTT_MULTIPLE_INSTANCES: 'Erlaube EMS-ESP Mehrfachinstanzen', - MQTT_ENTITY_FULLNAME: 'Use v3.4 style Entity IDs', + MQTT_ENTITY_FORMAT: 'Entity ID format', + MQTT_ENTITY_FORMAT_0: 'Single instance, long name', + MQTT_ENTITY_FORMAT_1: 'Multiple instances, short name', MQTT_CLEAN_SESSION: 'Setze `Clean Session`', MQTT_RETAIN_FLAG: 'Setze `Retain flag` immer', INACTIVE: 'Inaktiv', diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index 6be5a0c59..e76450b70 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -248,8 +248,9 @@ const en: Translation = { MQTT_INT_HEARTBEAT: 'Heartbeat', MQTT_QUEUE: 'MQTT Queue', DEFAULT: 'Default', - MQTT_MULTIPLE_INSTANCES: 'Enable Multiple Instances of EMS-ESP', - MQTT_ENTITY_FULLNAME: 'Use v3.4 style Entity IDs', + MQTT_ENTITY_FORMAT: 'Entity ID format', + MQTT_ENTITY_FORMAT_0: 'Single instance, long name', + MQTT_ENTITY_FORMAT_1: 'Multiple instances, short name', MQTT_CLEAN_SESSION: 'Set Clean Session', MQTT_RETAIN_FLAG: 'Always set Retain flag', INACTIVE: 'Inactive', diff --git a/interface/src/i18n/nl/index.ts b/interface/src/i18n/nl/index.ts index 8df8dfb45..dc250c99b 100644 --- a/interface/src/i18n/nl/index.ts +++ b/interface/src/i18n/nl/index.ts @@ -248,8 +248,9 @@ const nl: Translation = { MQTT_INT_HEARTBEAT: 'Heartbeat', MQTT_QUEUE: 'MQTT Queue', DEFAULT: 'Default', - MQTT_MULTIPLE_INSTANCES: 'Enable Multiple Instances of EMS-ESP', - MQTT_ENTITY_FULLNAME: 'Use v3.4 style Entity IDs', + MQTT_ENTITY_FORMAT: 'Entity ID format', + MQTT_ENTITY_FORMAT_0: 'Single instance, long name', + MQTT_ENTITY_FORMAT_1: 'Multiple instances, short name', MQTT_CLEAN_SESSION: 'Clean Session aan', MQTT_RETAIN_FLAG: 'Retain flag aan', INACTIVE: 'Inactief', diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index b6fc323dd..b9e7db89c 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -248,8 +248,9 @@ const no: Translation = { MQTT_INT_HEARTBEAT: 'Heartbeat', MQTT_QUEUE: 'MQTT Queue', DEFAULT: 'Standard', - MQTT_MULTIPLE_INSTANCES: 'Enable Multiple Instances of EMS-ESP', - MQTT_ENTITY_FULLNAME: 'Use v3.4 style Entity IDs', + MQTT_ENTITY_FORMAT: 'Entity ID format', + MQTT_ENTITY_FORMAT_0: 'Single instance, long name', + MQTT_ENTITY_FORMAT_1: 'Multiple instances, short name', MQTT_CLEAN_SESSION: 'Benytt Clean Session', MQTT_RETAIN_FLAG: 'Alltid sett Retain flag', INACTIVE: 'Innaktiv', diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index ba6023d2d..ed542e798 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -248,8 +248,9 @@ const pl: BaseTranslation = { MQTT_INT_HEARTBEAT: 'Heartbeat', MQTT_QUEUE: 'Kolejka MQTT', DEFAULT: '{{Pozostałe|Domyślna|}}', - MQTT_MULTIPLE_INSTANCES: 'Enable Multiple Instances of EMS-ESP', - MQTT_ENTITY_FULLNAME: 'Use v3.4 style Entity IDs', + MQTT_ENTITY_FORMAT: 'Entity ID format', + MQTT_ENTITY_FORMAT_0: 'Single instance, long name', + MQTT_ENTITY_FORMAT_1: 'Multiple instances, short name', MQTT_CLEAN_SESSION: 'Ustawiaj flagę "Clean session"', MQTT_RETAIN_FLAG: 'Ustawiaj flagę "Retain"', INACTIVE: 'nieaktywny', diff --git a/interface/src/i18n/se/index.ts b/interface/src/i18n/se/index.ts index b5e9090b7..99e33eebc 100644 --- a/interface/src/i18n/se/index.ts +++ b/interface/src/i18n/se/index.ts @@ -248,8 +248,9 @@ const se: Translation = { MQTT_INT_HEARTBEAT: 'Heartbeat', MQTT_QUEUE: 'MQTT Queue', DEFAULT: 'Standard', - MQTT_MULTIPLE_INSTANCES: 'Enable Multiple Instances of EMS-ESP', - MQTT_ENTITY_FULLNAME: 'Use v3.4 style Entity IDs', + MQTT_ENTITY_FORMAT: 'Entity ID format', + MQTT_ENTITY_FORMAT_0: 'Single instance, long name', + MQTT_ENTITY_FORMAT_1: 'Multiple instances, short name', MQTT_CLEAN_SESSION: 'Använd "Clean Session"-flaggan', MQTT_RETAIN_FLAG: 'Använd "Always Retain"-flaggan', INACTIVE: 'Inaktiv', diff --git a/interface/src/types/mqtt.ts b/interface/src/types/mqtt.ts index ad9a23531..ee69da5b5 100644 --- a/interface/src/types/mqtt.ts +++ b/interface/src/types/mqtt.ts @@ -30,7 +30,6 @@ export interface MqttSettings { keep_alive: number; clean_session: boolean; multiple_instances: boolean; - entity_fullname: boolean; publish_time_boiler: number; publish_time_thermostat: number; publish_time_solar: number; diff --git a/lib/framework/MqttSettingsService.cpp b/lib/framework/MqttSettingsService.cpp index 0ad414553..aa6198706 100644 --- a/lib/framework/MqttSettingsService.cpp +++ b/lib/framework/MqttSettingsService.cpp @@ -155,7 +155,6 @@ void MqttSettings::read(MqttSettings & settings, JsonObject & root) { root["keep_alive"] = settings.keepAlive; root["clean_session"] = settings.cleanSession; root["multiple_instances"] = settings.multiple_instances; - root["entity_fullname"] = settings.entity_fullname; // added by proddy for EMS-ESP root["publish_time_boiler"] = settings.publish_time_boiler; @@ -189,7 +188,6 @@ StateUpdateResult MqttSettings::update(JsonObject & root, MqttSettings & setting newSettings.keepAlive = root["keep_alive"] | FACTORY_MQTT_KEEP_ALIVE; newSettings.cleanSession = root["clean_session"] | FACTORY_MQTT_CLEAN_SESSION; newSettings.multiple_instances = root["multiple_instances"] | FACTORY_MQTT_MULTIPLE_INSTANCES; - newSettings.entity_fullname = root["entity_fullname"] | FACTORY_MQTT_ENTITY_FULLNAME; newSettings.mqtt_qos = root["mqtt_qos"] | EMSESP_DEFAULT_MQTT_QOS; newSettings.mqtt_retain = root["mqtt_retain"] | EMSESP_DEFAULT_MQTT_RETAIN; diff --git a/lib/framework/MqttSettingsService.h b/lib/framework/MqttSettingsService.h index 934edd4ff..21ec908bd 100644 --- a/lib/framework/MqttSettingsService.h +++ b/lib/framework/MqttSettingsService.h @@ -61,10 +61,6 @@ static String generateClientId() { #define FACTORY_MQTT_MULTIPLE_INSTANCES false #endif -#ifndef FACTORY_MQTT_ENTITY_FULLNAME -#define FACTORY_MQTT_ENTITY_FULLNAME false -#endif - class MqttSettings { public: // host and port - if enabled @@ -86,9 +82,6 @@ class MqttSettings { // multiple instances bool multiple_instances; - // use v3.4 entity fullnames in Discovery - bool entity_fullname; - // proddy EMS-ESP specific String base; uint16_t publish_time_boiler; diff --git a/lib_standalone/ESP8266React.h b/lib_standalone/ESP8266React.h index 2efdf9be5..f0e8b3817 100644 --- a/lib_standalone/ESP8266React.h +++ b/lib_standalone/ESP8266React.h @@ -82,7 +82,6 @@ class DummySettings { uint16_t keepAlive = 60; bool cleanSession = false; bool multiple_instances = false; - bool entity_fullname = false; uint16_t publish_time_boiler = 10; uint16_t publish_time_thermostat = 10; diff --git a/mock-api/server.js b/mock-api/server.js index 51ae2706a..f73d04026 100644 --- a/mock-api/server.js +++ b/mock-api/server.js @@ -224,7 +224,6 @@ mqtt_settings = { keep_alive: 60, clean_session: true, multiple_instances: false, - entity_fullname: false, publish_time_boiler: 10, publish_time_thermostat: 10, publish_time_solar: 10, diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 442f28a7b..d279fc931 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -39,7 +39,6 @@ uint32_t Mqtt::publish_time_other_; uint32_t Mqtt::publish_time_heartbeat_; bool Mqtt::mqtt_enabled_; bool Mqtt::multiple_instances_; -bool Mqtt::entity_fullname_; bool Mqtt::ha_enabled_; uint8_t Mqtt::nested_format_; std::string Mqtt::discovery_prefix_; @@ -432,7 +431,6 @@ void Mqtt::load_settings() { send_response_ = mqttSettings.send_response; discovery_prefix_ = mqttSettings.discovery_prefix.c_str(); multiple_instances_ = mqttSettings.multiple_instances; - entity_fullname_ = mqttSettings.entity_fullname; // convert to milliseconds publish_time_boiler_ = mqttSettings.publish_time_boiler * 1000; @@ -993,18 +991,12 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev // build unique identifier which will be used in the topic, also used as object_id char uniq_id[70]; - char entityid[50]; - if (Mqtt::entity_fullname()) { - strlcpy(entityid, en_name, sizeof(entityid)); // old v3.4 style - } else { - strlcpy(entityid, entity_with_tag, sizeof(entityid)); - } - if (Mqtt::multiple_instances()) { - // prefix base name to each uniq_id - snprintf(uniq_id, sizeof(uniq_id), "%s_%s_%s", mqtt_basename_.c_str(), device_name, entityid); + // prefix base name to each uniq_id and use the shortname + snprintf(uniq_id, sizeof(uniq_id), "%s_%s_%s", mqtt_basename_.c_str(), device_name, entity_with_tag); } else { - snprintf(uniq_id, sizeof(uniq_id), "%s_%s", device_name, entityid); + // old v3.4 style + snprintf(uniq_id, sizeof(uniq_id), "%s_%s", device_name, en_name); } // build a config topic that will be prefix onto a HA type (e.g. number, switch) diff --git a/src/mqtt.h b/src/mqtt.h index 47e813e46..e2de8bba4 100644 --- a/src/mqtt.h +++ b/src/mqtt.h @@ -185,10 +185,6 @@ class Mqtt { return multiple_instances_; } - static bool entity_fullname() { - return entity_fullname_; - } - static void nested_format(uint8_t nested_format) { nested_format_ = nested_format; } @@ -327,7 +323,6 @@ class Mqtt { static bool ha_enabled_; static uint8_t nested_format_; static bool multiple_instances_; - static bool entity_fullname_; static std::string discovery_prefix_; static bool publish_single_; static bool publish_single2cmd_; diff --git a/src/system.cpp b/src/system.cpp index 4cee96913..a66a5c8d1 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -1153,7 +1153,6 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp node["keep alive"] = settings.keepAlive; node["clean session"] = settings.cleanSession; node["multiple instances"] = settings.multiple_instances; - node["entity fullname"] = settings.entity_fullname; node["base"] = settings.base; node["discovery prefix"] = settings.discovery_prefix; node["nested format"] = settings.nested_format; From 1e78979ed0092330c68ed770ac0ae21445a247fa Mon Sep 17 00:00:00 2001 From: Proddy Date: Thu, 15 Dec 2022 23:14:44 +0100 Subject: [PATCH 3/4] default multiple_instances is enabled --- lib/framework/MqttSettingsService.h | 2 +- mock-api/server.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/framework/MqttSettingsService.h b/lib/framework/MqttSettingsService.h index 21ec908bd..cac21aa86 100644 --- a/lib/framework/MqttSettingsService.h +++ b/lib/framework/MqttSettingsService.h @@ -58,7 +58,7 @@ static String generateClientId() { #endif #ifndef FACTORY_MQTT_MULTIPLE_INSTANCES -#define FACTORY_MQTT_MULTIPLE_INSTANCES false +#define FACTORY_MQTT_MULTIPLE_INSTANCES true #endif class MqttSettings { diff --git a/mock-api/server.js b/mock-api/server.js index f73d04026..e2d06fef9 100644 --- a/mock-api/server.js +++ b/mock-api/server.js @@ -223,7 +223,7 @@ mqtt_settings = { client_id: 'ems-esp', keep_alive: 60, clean_session: true, - multiple_instances: false, + multiple_instances: true, publish_time_boiler: 10, publish_time_thermostat: 10, publish_time_solar: 10, From b6de431a56d64a3ccf2793e9411ac13bd2c21987 Mon Sep 17 00:00:00 2001 From: Proddy Date: Thu, 15 Dec 2022 23:19:53 +0100 Subject: [PATCH 4/4] add French MQTT entity format strings (in EN) --- interface/src/i18n/fr/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/src/i18n/fr/index.ts b/interface/src/i18n/fr/index.ts index df1234972..659c96359 100644 --- a/interface/src/i18n/fr/index.ts +++ b/interface/src/i18n/fr/index.ts @@ -248,7 +248,9 @@ const fr: Translation = { MQTT_INT_HEARTBEAT: 'Battements', MQTT_QUEUE: 'Queue MQTT', DEFAULT: 'Défaut', - MQTT_MULTIPLE_INSTANCES: 'Activer plusieurs instances de EMS-ESP', + MQTT_ENTITY_FORMAT: 'Entity ID format', + MQTT_ENTITY_FORMAT_0: 'Single instance, long name', + MQTT_ENTITY_FORMAT_1: 'Multiple instances, short name', MQTT_CLEAN_SESSION: 'Flag Clean Session', MQTT_RETAIN_FLAG: 'Toujours activer le Retain Flag', INACTIVE: 'Inactif',