Set device_class to duration in HA sensor definitions #822

This commit is contained in:
Proddy
2022-12-23 13:42:59 +01:00
parent 9802581301
commit 3c91ac27dc
7 changed files with 133 additions and 130 deletions

View File

@@ -40,4 +40,5 @@
- reload page after restart button is pressed - reload page after restart button is pressed
- analog/dallas values command as list like ems-devices - analog/dallas values command as list like ems-devices
- analog/dallas HA-entities based on id - analog/dallas HA-entities based on id
- MQTT Base is a mandatory field. Removed MQTT topic length from settings. - MQTT Base is a mandatory field. Removed MQTT topic length from settings
- HA duration class for time entities [[#822](https://github.com/emsesp/EMS-ESP32/issues/822

View File

@@ -1,5 +1,5 @@
{ {
"adapter": "react", "adapter": "react",
"baseLocale": "pl", "baseLocale": "pl",
"$schema": "https://unpkg.com/typesafe-i18n@5.17.2/schema/typesafe-i18n.json" "$schema": "https://unpkg.com/typesafe-i18n@5.18.0/schema/typesafe-i18n.json"
} }

View File

@@ -12,12 +12,12 @@
"@emotion/styled": "^11.10.5", "@emotion/styled": "^11.10.5",
"@msgpack/msgpack": "^2.8.0", "@msgpack/msgpack": "^2.8.0",
"@mui/icons-material": "^5.11.0", "@mui/icons-material": "^5.11.0",
"@mui/material": "^5.11.0", "@mui/material": "^5.11.1",
"@table-library/react-table-library": "4.0.23", "@table-library/react-table-library": "4.0.23",
"@types/lodash": "^4.14.191", "@types/lodash": "^4.14.191",
"@types/node": "^18.11.17", "@types/node": "^18.11.17",
"@types/react": "^18.0.26", "@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9", "@types/react-dom": "^18.0.10",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"async-validator": "^4.2.5", "async-validator": "^4.2.5",
"axios": "^1.2.1", "axios": "^1.2.1",
@@ -31,10 +31,10 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-dropzone": "^14.2.3", "react-dropzone": "^14.2.3",
"react-icons": "^4.7.1", "react-icons": "^4.7.1",
"react-router-dom": "^6.5.0", "react-router-dom": "^6.6.0",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"sockette": "^2.0.6", "sockette": "^2.0.6",
"typesafe-i18n": "^5.17.2", "typesafe-i18n": "^5.18.0",
"typescript": "^4.9.4" "typescript": "^4.9.4"
}, },
"devDependencies": { "devDependencies": {
@@ -3091,14 +3091,14 @@
} }
}, },
"node_modules/@mui/base": { "node_modules/@mui/base": {
"version": "5.0.0-alpha.110", "version": "5.0.0-alpha.111",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.110.tgz", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.111.tgz",
"integrity": "sha512-q4TH9T3sTBknTXXTEf2zO8F3nbHg5iGgiaRx9XErTbXvHrmLrQXbQ4hmrLERocSTBFCFWkKyne/qZj0diWlPtA==", "integrity": "sha512-2wfIPpl97S4dPzD0QOM3UIzQ/EuXCYQvHmXxTpfKxev/cfkzOe7Ik/McoYUBbtM1bSOqH3W276R/L2LF9cyXqQ==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@emotion/is-prop-valid": "^1.2.0", "@emotion/is-prop-valid": "^1.2.0",
"@mui/types": "^7.2.3", "@mui/types": "^7.2.3",
"@mui/utils": "^5.11.0", "@mui/utils": "^5.11.1",
"@popperjs/core": "^2.11.6", "@popperjs/core": "^2.11.6",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
@@ -3123,9 +3123,9 @@
} }
}, },
"node_modules/@mui/core-downloads-tracker": { "node_modules/@mui/core-downloads-tracker": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.1.tgz",
"integrity": "sha512-Bmogung451ezVv2YI1RvweOIVsTj2RQ4Fk61+e/+8LFPLTFEwVGbL0YhNy1VB5tri8pzGNV228kxtWVTFooQkg==", "integrity": "sha512-QVqVNlZ2K+LqUDE5kFgYd0r4KekR/dv2cNYbAutQWbfOA8VPVUVrDz0ELrEcoe8TjM/CwnsmGvaDh/YSNl/ALA==",
"funding": { "funding": {
"type": "opencollective", "type": "opencollective",
"url": "https://opencollective.com/mui" "url": "https://opencollective.com/mui"
@@ -3157,16 +3157,16 @@
} }
}, },
"node_modules/@mui/material": { "node_modules/@mui/material": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.1.tgz",
"integrity": "sha512-8Zl34lb89rLKTTi50Kakki675/LLHMKKnkp8Ee3rAZ2qmisQlRODsGh1MBjENKp0vwhQnNSvlsCfJteVTfotPQ==", "integrity": "sha512-yaZiXvcrl2vgUK+VO24780BWRgwdAMmAyuMVZnRTts1Yu0tWd6PjIYq2ZtaOlpj6/LbaSS+Q2kSfxYnDQ20CEQ==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@mui/base": "5.0.0-alpha.110", "@mui/base": "5.0.0-alpha.111",
"@mui/core-downloads-tracker": "^5.11.0", "@mui/core-downloads-tracker": "^5.11.1",
"@mui/system": "^5.11.0", "@mui/system": "^5.11.1",
"@mui/types": "^7.2.3", "@mui/types": "^7.2.3",
"@mui/utils": "^5.11.0", "@mui/utils": "^5.11.1",
"@types/react-transition-group": "^4.4.5", "@types/react-transition-group": "^4.4.5",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"csstype": "^3.1.1", "csstype": "^3.1.1",
@@ -3201,12 +3201,12 @@
} }
}, },
"node_modules/@mui/private-theming": { "node_modules/@mui/private-theming": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.1.tgz",
"integrity": "sha512-UFQLb9x5Sj4pg2GhhCGw3Ls/y1Hw/tz9RsBrULvUF0Vgps1z19o7XTq2xqUvp7pN7fJTW7eVIT2gwVg2xlk8PQ==", "integrity": "sha512-nnHg7kA5RwFRhy0wiDYe59sLCVGORpPypL1JcEdhv0+N0Zbmc2E/y4z2zqMRZ62MAEscpro7cQbvv244ThA84A==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@mui/utils": "^5.11.0", "@mui/utils": "^5.11.1",
"prop-types": "^15.8.1" "prop-types": "^15.8.1"
}, },
"engines": { "engines": {
@@ -3258,15 +3258,15 @@
} }
}, },
"node_modules/@mui/system": { "node_modules/@mui/system": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.1.tgz",
"integrity": "sha512-HFUT7Dlmyq6Wfuxsw8QBXZxXDYIQQaJ4YHaZd7s+nDMcjerLnILxjh2g3a6umtOUM+jEcRaFJAtvLZvlGfa5fw==", "integrity": "sha512-BEA2S0hay8n8CcZftkeAVsi0nsb5ZjdnZRCahv5lX7QJYwDjO4ucJ6lnvxHe2v/9Te1LLjTO7ojxu/qM6CE5Cg==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@mui/private-theming": "^5.11.0", "@mui/private-theming": "^5.11.1",
"@mui/styled-engine": "^5.11.0", "@mui/styled-engine": "^5.11.0",
"@mui/types": "^7.2.3", "@mui/types": "^7.2.3",
"@mui/utils": "^5.11.0", "@mui/utils": "^5.11.1",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"csstype": "^3.1.1", "csstype": "^3.1.1",
"prop-types": "^15.8.1" "prop-types": "^15.8.1"
@@ -3310,9 +3310,9 @@
} }
}, },
"node_modules/@mui/utils": { "node_modules/@mui/utils": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.11.1.tgz",
"integrity": "sha512-DP/YDaVVCVzJpZ5FFPLKNmaJkeaYRviTyIZkL/D5/FmPXQiA6ecd6z0/+VwoNQtp7aXAQWaRhvz4FM25yqFlHA==", "integrity": "sha512-lMAPgIJoil8V9ZxsMbEflMsvZmWcHbRVMc4JDY9jPO9V4welpF43h/O267b1RqlcRnC5MEbVQV605GYkTZY29Q==",
"dependencies": { "dependencies": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@types/prop-types": "^15.7.5", "@types/prop-types": "^15.7.5",
@@ -3458,9 +3458,9 @@
} }
}, },
"node_modules/@remix-run/router": { "node_modules/@remix-run/router": {
"version": "1.1.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.2.0.tgz",
"integrity": "sha512-rGl+jH/7x1KBCQScz9p54p0dtPLNeKGb3e0wD2H5/oZj41bwQUnXdzbj2TbUAFhvD7cp9EyEQA4dEgpUFa1O7Q==", "integrity": "sha512-GO82KYYTWPRCgdNtnheaZG3LcViUlxRFlHM7ykh7N+ufoXi6PVIHoP+9RUG/vuzl2hr9i/h6EA1Eq+2HpqJ0gQ==",
"engines": { "engines": {
"node": ">=14" "node": ">=14"
} }
@@ -4062,9 +4062,9 @@
} }
}, },
"node_modules/@types/react-dom": { "node_modules/@types/react-dom": {
"version": "18.0.9", "version": "18.0.10",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.9.tgz", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.10.tgz",
"integrity": "sha512-qnVvHxASt/H7i+XG1U1xMiY5t+IHcPGUK7TDMDzom08xa7e86eCeKOiLZezwCKVxJn6NEiiy2ekgX8aQssjIKg==", "integrity": "sha512-E42GW/JA4Qv15wQdqJq8DL4JhNpB3prJgjgapN3qJT9K2zO5IIAQh4VXvCEDupoqAwnz0cY4RlXeC/ajX5SFHg==",
"dependencies": { "dependencies": {
"@types/react": "*" "@types/react": "*"
} }
@@ -14576,11 +14576,11 @@
} }
}, },
"node_modules/react-router": { "node_modules/react-router": {
"version": "6.5.0", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.5.0.tgz", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.6.0.tgz",
"integrity": "sha512-fqqUSU0NC0tSX0sZbyuxzuAzvGqbjiZItBQnyicWlOUmzhAU8YuLgRbaCL2hf3sJdtRy4LP/WBrWtARkMvdGPQ==", "integrity": "sha512-+VPfCIaFbkW7BAiB/2oeprxKAt1KLbl+zXZ10CXOYezKWgBmTKyh8XjI53eLqY5kd7uY+V4rh3UW44FclwUU+Q==",
"dependencies": { "dependencies": {
"@remix-run/router": "1.1.0" "@remix-run/router": "1.2.0"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=14"
@@ -14590,12 +14590,12 @@
} }
}, },
"node_modules/react-router-dom": { "node_modules/react-router-dom": {
"version": "6.5.0", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.5.0.tgz", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.6.0.tgz",
"integrity": "sha512-/XzRc5fq80gW1ctiIGilyKFZC/j4kfe75uivMsTChFbkvrK4ZrF3P3cGIc1f/SSkQ4JiJozPrf+AwUHHWVehVg==", "integrity": "sha512-qC4jnvpfCPKVle1mKLD75IvZLcbVJyFMlSn16WY9ZiOed3dgSmqhslCf/u3tmSccWOujkdsT/OwGq12bELmvjg==",
"dependencies": { "dependencies": {
"@remix-run/router": "1.1.0", "@remix-run/router": "1.2.0",
"react-router": "6.5.0" "react-router": "6.6.0"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=14"
@@ -16441,9 +16441,9 @@
} }
}, },
"node_modules/typesafe-i18n": { "node_modules/typesafe-i18n": {
"version": "5.17.2", "version": "5.18.0",
"resolved": "https://registry.npmjs.org/typesafe-i18n/-/typesafe-i18n-5.17.2.tgz", "resolved": "https://registry.npmjs.org/typesafe-i18n/-/typesafe-i18n-5.18.0.tgz",
"integrity": "sha512-G5LCXLDugzvG0GtkBS1+0f+ctQzQNPqwPElvrOMQ8LAG/mwwtW84H42sGfNJ9Dfqlh+t7250N/8TQ7Vta98cKQ==", "integrity": "sha512-4uzmbSwBOYQ5Upuam1btGf8/fKhBR19b8fg1auILRs9tHlaWtvIYORU7MJsoNee/rmQfIAv6pkiXrIEuMCoW7Q==",
"bin": { "bin": {
"typesafe-i18n": "cli/typesafe-i18n.mjs" "typesafe-i18n": "cli/typesafe-i18n.mjs"
}, },
@@ -19657,14 +19657,14 @@
"integrity": "sha512-h9u4u/jiIRKbq25PM+zymTyW6bhTzELvOoUd+AvYriWOAKpLGnIamaET3pnHYoI5iYphAHBI4ayx0MehR+VVPQ==" "integrity": "sha512-h9u4u/jiIRKbq25PM+zymTyW6bhTzELvOoUd+AvYriWOAKpLGnIamaET3pnHYoI5iYphAHBI4ayx0MehR+VVPQ=="
}, },
"@mui/base": { "@mui/base": {
"version": "5.0.0-alpha.110", "version": "5.0.0-alpha.111",
"resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.110.tgz", "resolved": "https://registry.npmjs.org/@mui/base/-/base-5.0.0-alpha.111.tgz",
"integrity": "sha512-q4TH9T3sTBknTXXTEf2zO8F3nbHg5iGgiaRx9XErTbXvHrmLrQXbQ4hmrLERocSTBFCFWkKyne/qZj0diWlPtA==", "integrity": "sha512-2wfIPpl97S4dPzD0QOM3UIzQ/EuXCYQvHmXxTpfKxev/cfkzOe7Ik/McoYUBbtM1bSOqH3W276R/L2LF9cyXqQ==",
"requires": { "requires": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@emotion/is-prop-valid": "^1.2.0", "@emotion/is-prop-valid": "^1.2.0",
"@mui/types": "^7.2.3", "@mui/types": "^7.2.3",
"@mui/utils": "^5.11.0", "@mui/utils": "^5.11.1",
"@popperjs/core": "^2.11.6", "@popperjs/core": "^2.11.6",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"prop-types": "^15.8.1", "prop-types": "^15.8.1",
@@ -19672,9 +19672,9 @@
} }
}, },
"@mui/core-downloads-tracker": { "@mui/core-downloads-tracker": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/core-downloads-tracker/-/core-downloads-tracker-5.11.1.tgz",
"integrity": "sha512-Bmogung451ezVv2YI1RvweOIVsTj2RQ4Fk61+e/+8LFPLTFEwVGbL0YhNy1VB5tri8pzGNV228kxtWVTFooQkg==" "integrity": "sha512-QVqVNlZ2K+LqUDE5kFgYd0r4KekR/dv2cNYbAutQWbfOA8VPVUVrDz0ELrEcoe8TjM/CwnsmGvaDh/YSNl/ALA=="
}, },
"@mui/icons-material": { "@mui/icons-material": {
"version": "5.11.0", "version": "5.11.0",
@@ -19685,16 +19685,16 @@
} }
}, },
"@mui/material": { "@mui/material": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/material/-/material-5.11.1.tgz",
"integrity": "sha512-8Zl34lb89rLKTTi50Kakki675/LLHMKKnkp8Ee3rAZ2qmisQlRODsGh1MBjENKp0vwhQnNSvlsCfJteVTfotPQ==", "integrity": "sha512-yaZiXvcrl2vgUK+VO24780BWRgwdAMmAyuMVZnRTts1Yu0tWd6PjIYq2ZtaOlpj6/LbaSS+Q2kSfxYnDQ20CEQ==",
"requires": { "requires": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@mui/base": "5.0.0-alpha.110", "@mui/base": "5.0.0-alpha.111",
"@mui/core-downloads-tracker": "^5.11.0", "@mui/core-downloads-tracker": "^5.11.1",
"@mui/system": "^5.11.0", "@mui/system": "^5.11.1",
"@mui/types": "^7.2.3", "@mui/types": "^7.2.3",
"@mui/utils": "^5.11.0", "@mui/utils": "^5.11.1",
"@types/react-transition-group": "^4.4.5", "@types/react-transition-group": "^4.4.5",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"csstype": "^3.1.1", "csstype": "^3.1.1",
@@ -19704,12 +19704,12 @@
} }
}, },
"@mui/private-theming": { "@mui/private-theming": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/private-theming/-/private-theming-5.11.1.tgz",
"integrity": "sha512-UFQLb9x5Sj4pg2GhhCGw3Ls/y1Hw/tz9RsBrULvUF0Vgps1z19o7XTq2xqUvp7pN7fJTW7eVIT2gwVg2xlk8PQ==", "integrity": "sha512-nnHg7kA5RwFRhy0wiDYe59sLCVGORpPypL1JcEdhv0+N0Zbmc2E/y4z2zqMRZ62MAEscpro7cQbvv244ThA84A==",
"requires": { "requires": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@mui/utils": "^5.11.0", "@mui/utils": "^5.11.1",
"prop-types": "^15.8.1" "prop-types": "^15.8.1"
} }
}, },
@@ -19725,15 +19725,15 @@
} }
}, },
"@mui/system": { "@mui/system": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/system/-/system-5.11.1.tgz",
"integrity": "sha512-HFUT7Dlmyq6Wfuxsw8QBXZxXDYIQQaJ4YHaZd7s+nDMcjerLnILxjh2g3a6umtOUM+jEcRaFJAtvLZvlGfa5fw==", "integrity": "sha512-BEA2S0hay8n8CcZftkeAVsi0nsb5ZjdnZRCahv5lX7QJYwDjO4ucJ6lnvxHe2v/9Te1LLjTO7ojxu/qM6CE5Cg==",
"requires": { "requires": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@mui/private-theming": "^5.11.0", "@mui/private-theming": "^5.11.1",
"@mui/styled-engine": "^5.11.0", "@mui/styled-engine": "^5.11.0",
"@mui/types": "^7.2.3", "@mui/types": "^7.2.3",
"@mui/utils": "^5.11.0", "@mui/utils": "^5.11.1",
"clsx": "^1.2.1", "clsx": "^1.2.1",
"csstype": "^3.1.1", "csstype": "^3.1.1",
"prop-types": "^15.8.1" "prop-types": "^15.8.1"
@@ -19746,9 +19746,9 @@
"requires": {} "requires": {}
}, },
"@mui/utils": { "@mui/utils": {
"version": "5.11.0", "version": "5.11.1",
"resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.11.0.tgz", "resolved": "https://registry.npmjs.org/@mui/utils/-/utils-5.11.1.tgz",
"integrity": "sha512-DP/YDaVVCVzJpZ5FFPLKNmaJkeaYRviTyIZkL/D5/FmPXQiA6ecd6z0/+VwoNQtp7aXAQWaRhvz4FM25yqFlHA==", "integrity": "sha512-lMAPgIJoil8V9ZxsMbEflMsvZmWcHbRVMc4JDY9jPO9V4welpF43h/O267b1RqlcRnC5MEbVQV605GYkTZY29Q==",
"requires": { "requires": {
"@babel/runtime": "^7.20.6", "@babel/runtime": "^7.20.6",
"@types/prop-types": "^15.7.5", "@types/prop-types": "^15.7.5",
@@ -19833,9 +19833,9 @@
"integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw==" "integrity": "sha512-50/17A98tWUfQ176raKiOGXuYpLyyVMkxxG6oylzL3BPOlA6ADGdK7EYunSa4I064xerltq9TGXs8HmOk5E+vw=="
}, },
"@remix-run/router": { "@remix-run/router": {
"version": "1.1.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.1.0.tgz", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.2.0.tgz",
"integrity": "sha512-rGl+jH/7x1KBCQScz9p54p0dtPLNeKGb3e0wD2H5/oZj41bwQUnXdzbj2TbUAFhvD7cp9EyEQA4dEgpUFa1O7Q==" "integrity": "sha512-GO82KYYTWPRCgdNtnheaZG3LcViUlxRFlHM7ykh7N+ufoXi6PVIHoP+9RUG/vuzl2hr9i/h6EA1Eq+2HpqJ0gQ=="
}, },
"@rollup/plugin-babel": { "@rollup/plugin-babel": {
"version": "5.3.1", "version": "5.3.1",
@@ -20292,9 +20292,9 @@
} }
}, },
"@types/react-dom": { "@types/react-dom": {
"version": "18.0.9", "version": "18.0.10",
"resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.9.tgz", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.10.tgz",
"integrity": "sha512-qnVvHxASt/H7i+XG1U1xMiY5t+IHcPGUK7TDMDzom08xa7e86eCeKOiLZezwCKVxJn6NEiiy2ekgX8aQssjIKg==", "integrity": "sha512-E42GW/JA4Qv15wQdqJq8DL4JhNpB3prJgjgapN3qJT9K2zO5IIAQh4VXvCEDupoqAwnz0cY4RlXeC/ajX5SFHg==",
"requires": { "requires": {
"@types/react": "*" "@types/react": "*"
} }
@@ -27748,20 +27748,20 @@
"integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==" "integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A=="
}, },
"react-router": { "react-router": {
"version": "6.5.0", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.5.0.tgz", "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.6.0.tgz",
"integrity": "sha512-fqqUSU0NC0tSX0sZbyuxzuAzvGqbjiZItBQnyicWlOUmzhAU8YuLgRbaCL2hf3sJdtRy4LP/WBrWtARkMvdGPQ==", "integrity": "sha512-+VPfCIaFbkW7BAiB/2oeprxKAt1KLbl+zXZ10CXOYezKWgBmTKyh8XjI53eLqY5kd7uY+V4rh3UW44FclwUU+Q==",
"requires": { "requires": {
"@remix-run/router": "1.1.0" "@remix-run/router": "1.2.0"
} }
}, },
"react-router-dom": { "react-router-dom": {
"version": "6.5.0", "version": "6.6.0",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.5.0.tgz", "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.6.0.tgz",
"integrity": "sha512-/XzRc5fq80gW1ctiIGilyKFZC/j4kfe75uivMsTChFbkvrK4ZrF3P3cGIc1f/SSkQ4JiJozPrf+AwUHHWVehVg==", "integrity": "sha512-qC4jnvpfCPKVle1mKLD75IvZLcbVJyFMlSn16WY9ZiOed3dgSmqhslCf/u3tmSccWOujkdsT/OwGq12bELmvjg==",
"requires": { "requires": {
"@remix-run/router": "1.1.0", "@remix-run/router": "1.2.0",
"react-router": "6.5.0" "react-router": "6.6.0"
} }
}, },
"react-scripts": { "react-scripts": {
@@ -29136,9 +29136,9 @@
} }
}, },
"typesafe-i18n": { "typesafe-i18n": {
"version": "5.17.2", "version": "5.18.0",
"resolved": "https://registry.npmjs.org/typesafe-i18n/-/typesafe-i18n-5.17.2.tgz", "resolved": "https://registry.npmjs.org/typesafe-i18n/-/typesafe-i18n-5.18.0.tgz",
"integrity": "sha512-G5LCXLDugzvG0GtkBS1+0f+ctQzQNPqwPElvrOMQ8LAG/mwwtW84H42sGfNJ9Dfqlh+t7250N/8TQ7Vta98cKQ==", "integrity": "sha512-4uzmbSwBOYQ5Upuam1btGf8/fKhBR19b8fg1auILRs9tHlaWtvIYORU7MJsoNee/rmQfIAv6pkiXrIEuMCoW7Q==",
"requires": {} "requires": {}
}, },
"typescript": { "typescript": {

View File

@@ -8,12 +8,12 @@
"@emotion/styled": "^11.10.5", "@emotion/styled": "^11.10.5",
"@msgpack/msgpack": "^2.8.0", "@msgpack/msgpack": "^2.8.0",
"@mui/icons-material": "^5.11.0", "@mui/icons-material": "^5.11.0",
"@mui/material": "^5.11.0", "@mui/material": "^5.11.1",
"@table-library/react-table-library": "4.0.23", "@table-library/react-table-library": "4.0.23",
"@types/lodash": "^4.14.191", "@types/lodash": "^4.14.191",
"@types/node": "^18.11.17", "@types/node": "^18.11.17",
"@types/react": "^18.0.26", "@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9", "@types/react-dom": "^18.0.10",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"async-validator": "^4.2.5", "async-validator": "^4.2.5",
"axios": "^1.2.1", "axios": "^1.2.1",
@@ -27,10 +27,10 @@
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"react-dropzone": "^14.2.3", "react-dropzone": "^14.2.3",
"react-icons": "^4.7.1", "react-icons": "^4.7.1",
"react-router-dom": "^6.5.0", "react-router-dom": "^6.6.0",
"react-scripts": "5.0.1", "react-scripts": "5.0.1",
"sockette": "^2.0.6", "sockette": "^2.0.6",
"typesafe-i18n": "^5.17.2", "typesafe-i18n": "^5.18.0",
"typescript": "^4.9.4" "typescript": "^4.9.4"
}, },
"scripts": { "scripts": {

View File

@@ -48,28 +48,28 @@ class DeviceValue {
// also used with HA as uom // also used with HA as uom
enum DeviceValueUOM : uint8_t { enum DeviceValueUOM : uint8_t {
NONE = 0, // 0 NONE = 0, // 0
DEGREES, // 1 DEGREES, // 1 - °C
DEGREES_R, // 2 - relative temperature DEGREES_R, // 2 - °C (relative temperature)
PERCENT, // 3 PERCENT, // 3 - %
LMIN, // 4 - l/min LMIN, // 4 - l/min
KWH, // 5 - kWh KWH, // 5 - kWh
WH, // 6 - Wh WH, // 6 - Wh
HOURS, // 7 HOURS, // 7 - h
MINUTES, // 8 MINUTES, // 8 - m
UA, // 9 - µA UA, // 9 - µA
BAR, // 10 BAR, // 10 - bar
KW, // 11 - kW KW, // 11 - kW
W, // 12 W, // 12 - W
KB, // 13 KB, // 13 - kB
SECONDS, // 14 SECONDS, // 14 - s
DBM, // 15 - dBm DBM, // 15 - dBm
FAHRENHEIT, // 16 FAHRENHEIT, // 16 - °F
MV, // 17 - mV MV, // 17 - mV
SQM, // 18 - square meter SQM, // 18 -
M3, // 19 - cubic meter M3, // 19 -
L, // 20 - liter L, // 20 - L
KMIN, // 21 - Kelvin * minutes KMIN, // 21 - K*min
K, // 22 - Kelvin K, // 22 - K
CONNECTIVITY // 23 - used in HA CONNECTIVITY // 23 - used in HA
}; };

View File

@@ -197,7 +197,7 @@ MAKE_PSTR_LIST(tpl_input, "Format: <inv>[<evu1><evu2><evu3><comp><aux><cool><hea
MAKE_PSTR_LIST(tpl_input4, "Format: <inv>[<comp><aux><cool><heat><dhw><pv>]") MAKE_PSTR_LIST(tpl_input4, "Format: <inv>[<comp><aux><cool><heat><dhw><pv>]")
// Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp // Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp
// Translating hours/minute/seconds in emsdevice.cpp // Translating hours/minute/seconds are done in emsdevice.cpp (uom_to_string())
MAKE_PSTR(uom_blank, " ") MAKE_PSTR(uom_blank, " ")
MAKE_PSTR(uom_percent, "%") MAKE_PSTR(uom_percent, "%")
MAKE_PSTR(uom_degrees, "°C") MAKE_PSTR(uom_degrees, "°C")
@@ -208,13 +208,13 @@ MAKE_PSTR(uom_ua, "µA")
MAKE_PSTR(uom_lmin, "l/min") MAKE_PSTR(uom_lmin, "l/min")
MAKE_PSTR(uom_kw, "kW") MAKE_PSTR(uom_kw, "kW")
MAKE_PSTR(uom_w, "W") MAKE_PSTR(uom_w, "W")
MAKE_PSTR(uom_kb, "KB") MAKE_PSTR(uom_kb, "kB")
MAKE_PSTR(uom_dbm, "dBm") MAKE_PSTR(uom_dbm, "dBm")
MAKE_PSTR(uom_fahrenheit, "°F") MAKE_PSTR(uom_fahrenheit, "°F")
MAKE_PSTR(uom_mv, "mV") MAKE_PSTR(uom_mv, "mV")
MAKE_PSTR(uom_sqm, "") MAKE_PSTR(uom_sqm, "")
MAKE_PSTR(uom_m3, "") MAKE_PSTR(uom_m3, "")
MAKE_PSTR(uom_l, "l") MAKE_PSTR(uom_l, "L")
MAKE_PSTR(uom_kmin, "K*min") MAKE_PSTR(uom_kmin, "K*min")
MAKE_PSTR(uom_k, "K") MAKE_PSTR(uom_k, "K")

View File

@@ -66,16 +66,10 @@ MAKE_PSTR_WORD(measurement)
MAKE_PSTR_WORD(total_increasing) MAKE_PSTR_WORD(total_increasing)
MAKE_PSTR(icondegrees, "mdi:coolant-temperature") // DeviceValueUOM::DEGREES MAKE_PSTR(icondegrees, "mdi:coolant-temperature") // DeviceValueUOM::DEGREES
MAKE_PSTR(iconpercent, "mdi:percent-outline") // DeviceValueUOM::PERCENT MAKE_PSTR(iconpercent, "mdi:percent-outline") // DeviceValueUOM::PERCENT
MAKE_PSTR(icontime, "mdi:clock-outline") // DeviceValueUOM::SECONDS MINUTES & HOURS
MAKE_PSTR(iconkb, "mdi:memory") // DeviceValueUOM::KB MAKE_PSTR(iconkb, "mdi:memory") // DeviceValueUOM::KB
MAKE_PSTR(iconlmin, "mdi:water-boiler") // DeviceValueUOM::LMIN MAKE_PSTR(iconlmin, "mdi:water-boiler") // DeviceValueUOM::LMIN
// MAKE_PSTR(iconkwh, "mdi:transmission-tower") // DeviceValueUOM::KWH & WH
MAKE_PSTR(iconua, "mdi:lightning-bolt-circle") // DeviceValueUOM::UA MAKE_PSTR(iconua, "mdi:lightning-bolt-circle") // DeviceValueUOM::UA
// MAKE_PSTR(iconbar, "mdi:gauge") // DeviceValueUOM::BAR
// MAKE_PSTR(iconkw, "mdi:omega") // DeviceValueUOM::KW & W
// MAKE_PSTR(icondbm, "mdi:wifi-strength-2") // DeviceValueUOM::DBM
MAKE_PSTR(iconnum, "mdi:counter") // DeviceValueUOM::NONE MAKE_PSTR(iconnum, "mdi:counter") // DeviceValueUOM::NONE
// MAKE_PSTR(icondevice, "mdi:home-automation") // for devices in HA
uuid::log::Logger Mqtt::logger_{F_(mqtt), uuid::log::Facility::DAEMON}; uuid::log::Logger Mqtt::logger_{F_(mqtt), uuid::log::Facility::DAEMON};
@@ -1171,8 +1165,16 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
doc["payload_off"] = Helpers::render_boolean(result, false); doc["payload_off"] = Helpers::render_boolean(result, false);
doc[sc_ha] = F_(measurement); doc[sc_ha] = F_(measurement);
} else { } else {
// always set the uom // always set the uom, using the standards except for hours/minutes/seconds
if (uom != DeviceValueUOM::NONE) { // using HA specific codes from https://github.com/home-assistant/core/blob/dev/homeassistant/const.py
if (uom == DeviceValueUOM::HOURS) {
doc[uom_ha] = "h";
} else if (uom == DeviceValueUOM::MINUTES) {
doc[uom_ha] = "min";
} else if (uom == DeviceValueUOM::SECONDS) {
doc[uom_ha] = "s";
} else if (uom != DeviceValueUOM::NONE) {
// default
doc[uom_ha] = EMSdevice::uom_to_string(uom); doc[uom_ha] = EMSdevice::uom_to_string(uom);
} }
} }
@@ -1196,12 +1198,12 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
case DeviceValueUOM::SECONDS: case DeviceValueUOM::SECONDS:
case DeviceValueUOM::MINUTES: case DeviceValueUOM::MINUTES:
case DeviceValueUOM::HOURS: case DeviceValueUOM::HOURS:
doc[ic_ha] = F_(icontime);
if (type == DeviceValueType::TIME) { if (type == DeviceValueType::TIME) {
doc[sc_ha] = F_(total_increasing); doc[sc_ha] = F_(total_increasing);
} else { } else {
doc[sc_ha] = F_(measurement); doc[sc_ha] = F_(measurement);
} }
doc[dc_ha] = "duration"; // https://github.com/emsesp/EMS-ESP32/issues/822
break; break;
case DeviceValueUOM::KB: case DeviceValueUOM::KB:
doc[ic_ha] = F_(iconkb); doc[ic_ha] = F_(iconkb);