Merge pull request #2420 from proddy/dev

collection of minor fixes
This commit is contained in:
Proddy
2025-02-22 13:40:40 +01:00
committed by GitHub
20 changed files with 274 additions and 229 deletions

View File

@@ -5604,6 +5604,7 @@
| ventmode | ventilation mode | enum [auto\|off\|L1\|L2\|L3\|L4\|demand\|sleep\|intense\|bypass\|party\|fireplace] | | true | DEVICE_DATA | 6 | 1 | 1 | | ventmode | ventilation mode | enum [auto\|off\|L1\|L2\|L3\|L4\|demand\|sleep\|intense\|bypass\|party\|fireplace] | | true | DEVICE_DATA | 6 | 1 | 1 |
| airquality | air quality (voc) | uint16 (>=0<=31999) | | false | DEVICE_DATA | 7 | 1 | 1 | | airquality | air quality (voc) | uint16 (>=0<=31999) | | false | DEVICE_DATA | 7 | 1 | 1 |
| airhumidity | relative air humidity | uint8 (>=0<=100) | % | false | DEVICE_DATA | 8 | 1 | 1 | | airhumidity | relative air humidity | uint8 (>=0<=100) | % | false | DEVICE_DATA | 8 | 1 | 1 |
| bypass | bypass | boolean | | true | DEVICE_DATA | 9 | 1 | 1 |
## Devices of type *water* ## Devices of type *water*
### IPM ### IPM

View File

@@ -5214,6 +5214,7 @@ device name,device type,product id,shortname,fullname,type [options...] \| (min/
"Logavent HRV176",ventilation,231,ventmode,ventilation mode,enum [auto\|off\|L1\|L2\|L3\|L4\|demand\|sleep\|intense\|bypass\|party\|fireplace], ,true,select.ventilation_ventilation_mode,select.ventilation_ventmode,18,0,1,6,1 "Logavent HRV176",ventilation,231,ventmode,ventilation mode,enum [auto\|off\|L1\|L2\|L3\|L4\|demand\|sleep\|intense\|bypass\|party\|fireplace], ,true,select.ventilation_ventilation_mode,select.ventilation_ventmode,18,0,1,6,1
"Logavent HRV176",ventilation,231,airquality,air quality (voc),uint16 (>=0<=31999), ,false,sensor.ventilation_air_quality_(voc),sensor.ventilation_airquality,18,0,1,7,1 "Logavent HRV176",ventilation,231,airquality,air quality (voc),uint16 (>=0<=31999), ,false,sensor.ventilation_air_quality_(voc),sensor.ventilation_airquality,18,0,1,7,1
"Logavent HRV176",ventilation,231,airhumidity,relative air humidity,uint8 (>=0<=100),%,false,sensor.ventilation_relative_air_humidity,sensor.ventilation_airhumidity,18,0,1,8,1 "Logavent HRV176",ventilation,231,airhumidity,relative air humidity,uint8 (>=0<=100),%,false,sensor.ventilation_relative_air_humidity,sensor.ventilation_airhumidity,18,0,1,8,1
"Logavent HRV176",ventilation,231,bypass,bypass,boolean, ,true,switch.ventilation_bypass,switch.ventilation_bypass,18,0,1,9,1
"IPM",water,100,dhw.seltemp,selected temperature,uint8 (>=0<=254),C,true,number.water_dhw_selected_temperature,number.water_dhw_seltemp,19,9,1,0,1 "IPM",water,100,dhw.seltemp,selected temperature,uint8 (>=0<=254),C,true,number.water_dhw_selected_temperature,number.water_dhw_seltemp,19,9,1,0,1
"IPM",water,100,dhw.temp,current temperature,uint16 (>=0<=3199),C,false,sensor.water_dhw_current_temperature,sensor.water_dhw_temp,19,9,1/10,1,1 "IPM",water,100,dhw.temp,current temperature,uint16 (>=0<=3199),C,false,sensor.water_dhw_current_temperature,sensor.water_dhw_temp,19,9,1/10,1,1
"IPM",water,100,dhw.curtemp2,current extern temperature,uint16 (>=0<=3199),C,false,sensor.water_dhw_current_extern_temperature,sensor.water_dhw_curtemp2,19,9,1/10,2,1 "IPM",water,100,dhw.curtemp2,current extern temperature,uint16 (>=0<=3199),C,false,sensor.water_dhw_current_extern_temperature,sensor.water_dhw_curtemp2,19,9,1/10,2,1
Can't render this file because it is too large.

View File

@@ -42,19 +42,19 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.26.9", "@babel/core": "^7.26.9",
"@eslint/js": "^9.20.0", "@eslint/js": "^9.21.0",
"@preact/compat": "^18.3.1", "@preact/compat": "^18.3.1",
"@preact/preset-vite": "^2.10.1", "@preact/preset-vite": "^2.10.1",
"@trivago/prettier-plugin-sort-imports": "^5.2.2", "@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/formidable": "^3", "@types/formidable": "^3",
"@types/node": "^22.13.4", "@types/node": "^22.13.5",
"@types/react": "^19.0.10", "@types/react": "^19.0.10",
"@types/react-dom": "^19.0.4", "@types/react-dom": "^19.0.4",
"concurrently": "^9.1.2", "concurrently": "^9.1.2",
"eslint": "^9.20.1", "eslint": "^9.21.0",
"eslint-config-prettier": "^10.0.1", "eslint-config-prettier": "^10.0.1",
"formidable": "^3.5.2", "formidable": "^3.5.2",
"prettier": "^3.5.1", "prettier": "^3.5.2",
"rollup-plugin-visualizer": "^5.14.0", "rollup-plugin-visualizer": "^5.14.0",
"terser": "^5.39.0", "terser": "^5.39.0",
"typescript-eslint": "8.24.1", "typescript-eslint": "8.24.1",

View File

@@ -140,7 +140,9 @@ const Version = () => {
</DialogTitle> </DialogTitle>
<DialogContent dividers> <DialogContent dividers>
<Typography mb={2}> <Typography mb={2}>
{LL.INSTALL_VERSION(usingDevVersion ? latestDevVersion?.name : latestVersion?.name)} {LL.INSTALL_VERSION(
usingDevVersion ? latestDevVersion?.name : latestVersion?.name
)}
</Typography> </Typography>
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>

View File

@@ -609,7 +609,7 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@eslint/config-array@npm:^0.19.0": "@eslint/config-array@npm:^0.19.2":
version: 0.19.2 version: 0.19.2
resolution: "@eslint/config-array@npm:0.19.2" resolution: "@eslint/config-array@npm:0.19.2"
dependencies: dependencies:
@@ -620,27 +620,18 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@eslint/core@npm:^0.10.0": "@eslint/core@npm:^0.12.0":
version: 0.10.0 version: 0.12.0
resolution: "@eslint/core@npm:0.10.0" resolution: "@eslint/core@npm:0.12.0"
dependencies: dependencies:
"@types/json-schema": "npm:^7.0.15" "@types/json-schema": "npm:^7.0.15"
checksum: 10c0/074018075079b3ed1f14fab9d116f11a8824cdfae3e822badf7ad546962fafe717a31e61459bad8cc59cf7070dc413ea9064ddb75c114f05b05921029cde0a64 checksum: 10c0/d032af81195bb28dd800c2b9617548c6c2a09b9490da3c5537fd2a1201501666d06492278bb92cfccac1f7ac249e58601dd87f813ec0d6a423ef0880434fa0c3
languageName: node languageName: node
linkType: hard linkType: hard
"@eslint/core@npm:^0.11.0": "@eslint/eslintrc@npm:^3.3.0":
version: 0.11.0 version: 3.3.0
resolution: "@eslint/core@npm:0.11.0" resolution: "@eslint/eslintrc@npm:3.3.0"
dependencies:
"@types/json-schema": "npm:^7.0.15"
checksum: 10c0/1e0671d035c908175f445864a7864cf6c6a8b67a5dfba8c47b2ac91e2d3ed36e8c1f2fd81d98a73264f8677055559699d4adb0f97d86588e616fc0dc9a4b86c9
languageName: node
linkType: hard
"@eslint/eslintrc@npm:^3.2.0":
version: 3.2.0
resolution: "@eslint/eslintrc@npm:3.2.0"
dependencies: dependencies:
ajv: "npm:^6.12.4" ajv: "npm:^6.12.4"
debug: "npm:^4.3.2" debug: "npm:^4.3.2"
@@ -651,14 +642,14 @@ __metadata:
js-yaml: "npm:^4.1.0" js-yaml: "npm:^4.1.0"
minimatch: "npm:^3.1.2" minimatch: "npm:^3.1.2"
strip-json-comments: "npm:^3.1.1" strip-json-comments: "npm:^3.1.1"
checksum: 10c0/43867a07ff9884d895d9855edba41acf325ef7664a8df41d957135a81a477ff4df4196f5f74dc3382627e5cc8b7ad6b815c2cea1b58f04a75aced7c43414ab8b checksum: 10c0/215de990231b31e2fe6458f225d8cea0f5c781d3ecb0b7920703501f8cd21b3101fc5ef2f0d4f9a38865d36647b983e0e8ce8bf12fd2bcdd227fc48a5b1a43be
languageName: node languageName: node
linkType: hard linkType: hard
"@eslint/js@npm:9.20.0, @eslint/js@npm:^9.20.0": "@eslint/js@npm:9.21.0, @eslint/js@npm:^9.21.0":
version: 9.20.0 version: 9.21.0
resolution: "@eslint/js@npm:9.20.0" resolution: "@eslint/js@npm:9.21.0"
checksum: 10c0/10e7b5b9e628b5192e8fc6b0ecd27cf48322947e83e999ff60f9f9e44ac8d499138bcb9383cbfa6e51e780d53b4e76ccc2d1753b108b7173b8404fd484d37328 checksum: 10c0/86c24a2668808995037e3f40c758335df2ae277c553ac0cf84381a1a8698f3099d8a22dd9c388947e6b7f93fcc1142f62406072faaa2b83c43ca79993fc01bb3
languageName: node languageName: node
linkType: hard linkType: hard
@@ -669,13 +660,13 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@eslint/plugin-kit@npm:^0.2.5": "@eslint/plugin-kit@npm:^0.2.7":
version: 0.2.5 version: 0.2.7
resolution: "@eslint/plugin-kit@npm:0.2.5" resolution: "@eslint/plugin-kit@npm:0.2.7"
dependencies: dependencies:
"@eslint/core": "npm:^0.10.0" "@eslint/core": "npm:^0.12.0"
levn: "npm:^0.4.1" levn: "npm:^0.4.1"
checksum: 10c0/ba9832b8409af618cf61791805fe201dd62f3c82c783adfcec0f5cd391e68b40beaecb47b9a3209e926dbcab65135f410cae405b69a559197795793399f61176 checksum: 10c0/0a1aff1ad63e72aca923217e556c6dfd67d7cd121870eb7686355d7d1475d569773528a8b2111b9176f3d91d2ea81f7413c34600e8e5b73d59e005d70780b633
languageName: node languageName: node
linkType: hard linkType: hard
@@ -710,10 +701,10 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@humanwhocodes/retry@npm:^0.4.1": "@humanwhocodes/retry@npm:^0.4.2":
version: 0.4.1 version: 0.4.2
resolution: "@humanwhocodes/retry@npm:0.4.1" resolution: "@humanwhocodes/retry@npm:0.4.2"
checksum: 10c0/be7bb6841c4c01d0b767d9bb1ec1c9359ee61421ce8ba66c249d035c5acdfd080f32d55a5c9e859cdd7868788b8935774f65b2caf24ec0b7bd7bf333791f063b checksum: 10c0/0235525d38f243bee3bf8b25ed395fbf957fb51c08adae52787e1325673071abe856c7e18e530922ed2dd3ce12ed82ba01b8cee0279ac52a3315fcdc3a69ef0c
languageName: node languageName: node
linkType: hard linkType: hard
@@ -1091,135 +1082,135 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-android-arm-eabi@npm:4.34.7": "@rollup/rollup-android-arm-eabi@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-android-arm-eabi@npm:4.34.7" resolution: "@rollup/rollup-android-arm-eabi@npm:4.34.8"
conditions: os=android & cpu=arm conditions: os=android & cpu=arm
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-android-arm64@npm:4.34.7": "@rollup/rollup-android-arm64@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-android-arm64@npm:4.34.7" resolution: "@rollup/rollup-android-arm64@npm:4.34.8"
conditions: os=android & cpu=arm64 conditions: os=android & cpu=arm64
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-darwin-arm64@npm:4.34.7": "@rollup/rollup-darwin-arm64@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-darwin-arm64@npm:4.34.7" resolution: "@rollup/rollup-darwin-arm64@npm:4.34.8"
conditions: os=darwin & cpu=arm64 conditions: os=darwin & cpu=arm64
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-darwin-x64@npm:4.34.7": "@rollup/rollup-darwin-x64@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-darwin-x64@npm:4.34.7" resolution: "@rollup/rollup-darwin-x64@npm:4.34.8"
conditions: os=darwin & cpu=x64 conditions: os=darwin & cpu=x64
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-freebsd-arm64@npm:4.34.7": "@rollup/rollup-freebsd-arm64@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-freebsd-arm64@npm:4.34.7" resolution: "@rollup/rollup-freebsd-arm64@npm:4.34.8"
conditions: os=freebsd & cpu=arm64 conditions: os=freebsd & cpu=arm64
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-freebsd-x64@npm:4.34.7": "@rollup/rollup-freebsd-x64@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-freebsd-x64@npm:4.34.7" resolution: "@rollup/rollup-freebsd-x64@npm:4.34.8"
conditions: os=freebsd & cpu=x64 conditions: os=freebsd & cpu=x64
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-arm-gnueabihf@npm:4.34.7": "@rollup/rollup-linux-arm-gnueabihf@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.34.7" resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.34.8"
conditions: os=linux & cpu=arm & libc=glibc conditions: os=linux & cpu=arm & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-arm-musleabihf@npm:4.34.7": "@rollup/rollup-linux-arm-musleabihf@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.34.7" resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.34.8"
conditions: os=linux & cpu=arm & libc=musl conditions: os=linux & cpu=arm & libc=musl
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-arm64-gnu@npm:4.34.7": "@rollup/rollup-linux-arm64-gnu@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.34.7" resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.34.8"
conditions: os=linux & cpu=arm64 & libc=glibc conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-arm64-musl@npm:4.34.7": "@rollup/rollup-linux-arm64-musl@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-arm64-musl@npm:4.34.7" resolution: "@rollup/rollup-linux-arm64-musl@npm:4.34.8"
conditions: os=linux & cpu=arm64 & libc=musl conditions: os=linux & cpu=arm64 & libc=musl
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-loongarch64-gnu@npm:4.34.7": "@rollup/rollup-linux-loongarch64-gnu@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.34.7" resolution: "@rollup/rollup-linux-loongarch64-gnu@npm:4.34.8"
conditions: os=linux & cpu=loong64 & libc=glibc conditions: os=linux & cpu=loong64 & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.7": "@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.7" resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.34.8"
conditions: os=linux & cpu=ppc64 & libc=glibc conditions: os=linux & cpu=ppc64 & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-riscv64-gnu@npm:4.34.7": "@rollup/rollup-linux-riscv64-gnu@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.34.7" resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.34.8"
conditions: os=linux & cpu=riscv64 & libc=glibc conditions: os=linux & cpu=riscv64 & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-s390x-gnu@npm:4.34.7": "@rollup/rollup-linux-s390x-gnu@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.34.7" resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.34.8"
conditions: os=linux & cpu=s390x & libc=glibc conditions: os=linux & cpu=s390x & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-x64-gnu@npm:4.34.7": "@rollup/rollup-linux-x64-gnu@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-x64-gnu@npm:4.34.7" resolution: "@rollup/rollup-linux-x64-gnu@npm:4.34.8"
conditions: os=linux & cpu=x64 & libc=glibc conditions: os=linux & cpu=x64 & libc=glibc
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-linux-x64-musl@npm:4.34.7": "@rollup/rollup-linux-x64-musl@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-linux-x64-musl@npm:4.34.7" resolution: "@rollup/rollup-linux-x64-musl@npm:4.34.8"
conditions: os=linux & cpu=x64 & libc=musl conditions: os=linux & cpu=x64 & libc=musl
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-win32-arm64-msvc@npm:4.34.7": "@rollup/rollup-win32-arm64-msvc@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.34.7" resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.34.8"
conditions: os=win32 & cpu=arm64 conditions: os=win32 & cpu=arm64
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-win32-ia32-msvc@npm:4.34.7": "@rollup/rollup-win32-ia32-msvc@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.34.7" resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.34.8"
conditions: os=win32 & cpu=ia32 conditions: os=win32 & cpu=ia32
languageName: node languageName: node
linkType: hard linkType: hard
"@rollup/rollup-win32-x64-msvc@npm:4.34.7": "@rollup/rollup-win32-x64-msvc@npm:4.34.8":
version: 4.34.7 version: 4.34.8
resolution: "@rollup/rollup-win32-x64-msvc@npm:4.34.7" resolution: "@rollup/rollup-win32-x64-msvc@npm:4.34.8"
conditions: os=win32 & cpu=x64 conditions: os=win32 & cpu=x64
languageName: node languageName: node
linkType: hard linkType: hard
@@ -1408,12 +1399,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/node@npm:*, @types/node@npm:^22.13.4": "@types/node@npm:*, @types/node@npm:^22.13.5":
version: 22.13.4 version: 22.13.5
resolution: "@types/node@npm:22.13.4" resolution: "@types/node@npm:22.13.5"
dependencies: dependencies:
undici-types: "npm:~6.20.0" undici-types: "npm:~6.20.0"
checksum: 10c0/3a234fa7766a3efc382cf81f66f474c26cdab2f54f43f757634c81c0444eb2160c2dabbde9741e4983078a318a88515b65416b5f1ab5478548579d7b3ead1d95 checksum: 10c0/a2e7ed7bb0690e439004779baedeb05159c5cc41ef6d81c7a6ebea5303fde4033669e1c0e41ff7453b45fd2fea8dbd55fddfcd052950c7fcae3167c970bca725
languageName: node languageName: node
linkType: hard linkType: hard
@@ -1596,7 +1587,7 @@ __metadata:
"@babel/core": "npm:^7.26.9" "@babel/core": "npm:^7.26.9"
"@emotion/react": "npm:^11.14.0" "@emotion/react": "npm:^11.14.0"
"@emotion/styled": "npm:^11.14.0" "@emotion/styled": "npm:^11.14.0"
"@eslint/js": "npm:^9.20.0" "@eslint/js": "npm:^9.21.0"
"@mui/icons-material": "npm:^6.4.5" "@mui/icons-material": "npm:^6.4.5"
"@mui/material": "npm:^6.4.5" "@mui/material": "npm:^6.4.5"
"@preact/compat": "npm:^18.3.1" "@preact/compat": "npm:^18.3.1"
@@ -1604,19 +1595,19 @@ __metadata:
"@table-library/react-table-library": "npm:4.1.12" "@table-library/react-table-library": "npm:4.1.12"
"@trivago/prettier-plugin-sort-imports": "npm:^5.2.2" "@trivago/prettier-plugin-sort-imports": "npm:^5.2.2"
"@types/formidable": "npm:^3" "@types/formidable": "npm:^3"
"@types/node": "npm:^22.13.4" "@types/node": "npm:^22.13.5"
"@types/react": "npm:^19.0.10" "@types/react": "npm:^19.0.10"
"@types/react-dom": "npm:^19.0.4" "@types/react-dom": "npm:^19.0.4"
alova: "npm:3.2.8" alova: "npm:3.2.8"
async-validator: "npm:^4.2.5" async-validator: "npm:^4.2.5"
concurrently: "npm:^9.1.2" concurrently: "npm:^9.1.2"
eslint: "npm:^9.20.1" eslint: "npm:^9.21.0"
eslint-config-prettier: "npm:^10.0.1" eslint-config-prettier: "npm:^10.0.1"
formidable: "npm:^3.5.2" formidable: "npm:^3.5.2"
jwt-decode: "npm:^4.0.0" jwt-decode: "npm:^4.0.0"
mime-types: "npm:^2.1.35" mime-types: "npm:^2.1.35"
preact: "npm:^10.26.2" preact: "npm:^10.26.2"
prettier: "npm:^3.5.1" prettier: "npm:^3.5.2"
react: "npm:^19.0.0" react: "npm:^19.0.0"
react-dom: "npm:^19.0.0" react-dom: "npm:^19.0.0"
react-icons: "npm:^5.5.0" react-icons: "npm:^5.5.0"
@@ -2041,9 +2032,9 @@ __metadata:
linkType: hard linkType: hard
"caniuse-lite@npm:^1.0.30001688": "caniuse-lite@npm:^1.0.30001688":
version: 1.0.30001699 version: 1.0.30001700
resolution: "caniuse-lite@npm:1.0.30001699" resolution: "caniuse-lite@npm:1.0.30001700"
checksum: 10c0/e87b3a0602c3124131f6a21f1eb262378e17a2ee3089e3c472ac8b9caa85cf7d6a219655379302c29c6f10a74051f2a712639d7f98ee0444c73fefcbaf25d519 checksum: 10c0/3d391bcdd193208166d3ad759de240b9c18ac3759dbd57195770f0fcd2eedcd47d5e853609aba1eee5a2def44b0a14eee457796bdb3451a27de0c8b27355017c
languageName: node languageName: node
linkType: hard linkType: hard
@@ -2624,9 +2615,9 @@ __metadata:
linkType: hard linkType: hard
"electron-to-chromium@npm:^1.5.73": "electron-to-chromium@npm:^1.5.73":
version: 1.5.101 version: 1.5.103
resolution: "electron-to-chromium@npm:1.5.101" resolution: "electron-to-chromium@npm:1.5.103"
checksum: 10c0/9c6579e58b09cc27151ad135444253d241b8a354c2d1a122d280086549ce3c78a47388f6c37774d93ee73b353defdc1f215b702de2b18d34d53fcf8ed25e5f53 checksum: 10c0/3b297311b9266ec3ad00eaa8566901603afedc2e19310a16ab9e7217e62f54dda83120ca5f2f75fe64a214d1ba6f6cbb52d7a1692e28de03fcba8bebf7bfc4d5
languageName: node languageName: node
linkType: hard linkType: hard
@@ -3055,20 +3046,20 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"eslint@npm:^9.20.1": "eslint@npm:^9.21.0":
version: 9.20.1 version: 9.21.0
resolution: "eslint@npm:9.20.1" resolution: "eslint@npm:9.21.0"
dependencies: dependencies:
"@eslint-community/eslint-utils": "npm:^4.2.0" "@eslint-community/eslint-utils": "npm:^4.2.0"
"@eslint-community/regexpp": "npm:^4.12.1" "@eslint-community/regexpp": "npm:^4.12.1"
"@eslint/config-array": "npm:^0.19.0" "@eslint/config-array": "npm:^0.19.2"
"@eslint/core": "npm:^0.11.0" "@eslint/core": "npm:^0.12.0"
"@eslint/eslintrc": "npm:^3.2.0" "@eslint/eslintrc": "npm:^3.3.0"
"@eslint/js": "npm:9.20.0" "@eslint/js": "npm:9.21.0"
"@eslint/plugin-kit": "npm:^0.2.5" "@eslint/plugin-kit": "npm:^0.2.7"
"@humanfs/node": "npm:^0.16.6" "@humanfs/node": "npm:^0.16.6"
"@humanwhocodes/module-importer": "npm:^1.0.1" "@humanwhocodes/module-importer": "npm:^1.0.1"
"@humanwhocodes/retry": "npm:^0.4.1" "@humanwhocodes/retry": "npm:^0.4.2"
"@types/estree": "npm:^1.0.6" "@types/estree": "npm:^1.0.6"
"@types/json-schema": "npm:^7.0.15" "@types/json-schema": "npm:^7.0.15"
ajv: "npm:^6.12.4" ajv: "npm:^6.12.4"
@@ -3100,7 +3091,7 @@ __metadata:
optional: true optional: true
bin: bin:
eslint: bin/eslint.js eslint: bin/eslint.js
checksum: 10c0/056789dd5a00897730376f8c0a191e22840e97b7276916068ec096341cb2ec3a918c8bd474bf94ccd7b457ad9fbc16e5c521a993c7cc6ebcf241933e2fd378b0 checksum: 10c0/558edb25b440cd51825d66fed3e84f1081bd6f4cb2cf994e60ece4c5978fa0583e88b75faf187c1fc21688c4ff7072f12bf5f6d1be1e09a4d6af78cff39dc520
languageName: node languageName: node
linkType: hard linkType: hard
@@ -3301,13 +3292,13 @@ __metadata:
linkType: hard linkType: hard
"fast-xml-parser@npm:^4.1.3": "fast-xml-parser@npm:^4.1.3":
version: 4.5.1 version: 4.5.3
resolution: "fast-xml-parser@npm:4.5.1" resolution: "fast-xml-parser@npm:4.5.3"
dependencies: dependencies:
strnum: "npm:^1.0.5" strnum: "npm:^1.1.1"
bin: bin:
fxparser: src/cli/cli.js fxparser: src/cli/cli.js
checksum: 10c0/70c6c675770d57d4b73716a1cdccff3780a5f818cffdab9c7560003e1724209001af32fbe7bb27a01107389b1998191c62e20104788ba17e218dfe063aa15b57 checksum: 10c0/bf9ccadacfadc95f6e3f0e7882a380a7f219cf0a6f96575149f02cb62bf44c3b7f0daee75b8ff3847bcfd7fbcb201e402c71045936c265cf6d94b141ec4e9327
languageName: node languageName: node
linkType: hard linkType: hard
@@ -3471,9 +3462,9 @@ __metadata:
linkType: hard linkType: hard
"flatted@npm:^3.2.9": "flatted@npm:^3.2.9":
version: 3.3.2 version: 3.3.3
resolution: "flatted@npm:3.3.2" resolution: "flatted@npm:3.3.3"
checksum: 10c0/24cc735e74d593b6c767fe04f2ef369abe15b62f6906158079b9874bdb3ee5ae7110bb75042e70cd3f99d409d766f357caf78d5ecee9780206f5fdc5edbad334 checksum: 10c0/e957a1c6b0254aa15b8cce8533e24165abd98fadc98575db082b786b5da1b7d72062b81bfdcd1da2f4d46b6ed93bec2434e62333e9b4261d79ef2e75a10dd538
languageName: node languageName: node
linkType: hard linkType: hard
@@ -5478,12 +5469,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"prettier@npm:^3.5.1": "prettier@npm:^3.5.2":
version: 3.5.1 version: 3.5.2
resolution: "prettier@npm:3.5.1" resolution: "prettier@npm:3.5.2"
bin: bin:
prettier: bin/prettier.cjs prettier: bin/prettier.cjs
checksum: 10c0/9f6f810eae455d6e4213845151a484a2338f2e0d6a8b84ee8e13a83af8a2421ef6c1e31e61e4b135671fb57b9541f6624648880cc2061ac803e243ac898c0123 checksum: 10c0/d7b597ed33f39c32ace675896ad187f06a3e48dc8a1e80051b5c5f0dae3586d53981704b8fda5ac3b080e6c2e0e197d239131b953702674f044351621ca5e1ac
languageName: node languageName: node
linkType: hard linkType: hard
@@ -5864,28 +5855,28 @@ __metadata:
linkType: hard linkType: hard
"rollup@npm:^4.30.1": "rollup@npm:^4.30.1":
version: 4.34.7 version: 4.34.8
resolution: "rollup@npm:4.34.7" resolution: "rollup@npm:4.34.8"
dependencies: dependencies:
"@rollup/rollup-android-arm-eabi": "npm:4.34.7" "@rollup/rollup-android-arm-eabi": "npm:4.34.8"
"@rollup/rollup-android-arm64": "npm:4.34.7" "@rollup/rollup-android-arm64": "npm:4.34.8"
"@rollup/rollup-darwin-arm64": "npm:4.34.7" "@rollup/rollup-darwin-arm64": "npm:4.34.8"
"@rollup/rollup-darwin-x64": "npm:4.34.7" "@rollup/rollup-darwin-x64": "npm:4.34.8"
"@rollup/rollup-freebsd-arm64": "npm:4.34.7" "@rollup/rollup-freebsd-arm64": "npm:4.34.8"
"@rollup/rollup-freebsd-x64": "npm:4.34.7" "@rollup/rollup-freebsd-x64": "npm:4.34.8"
"@rollup/rollup-linux-arm-gnueabihf": "npm:4.34.7" "@rollup/rollup-linux-arm-gnueabihf": "npm:4.34.8"
"@rollup/rollup-linux-arm-musleabihf": "npm:4.34.7" "@rollup/rollup-linux-arm-musleabihf": "npm:4.34.8"
"@rollup/rollup-linux-arm64-gnu": "npm:4.34.7" "@rollup/rollup-linux-arm64-gnu": "npm:4.34.8"
"@rollup/rollup-linux-arm64-musl": "npm:4.34.7" "@rollup/rollup-linux-arm64-musl": "npm:4.34.8"
"@rollup/rollup-linux-loongarch64-gnu": "npm:4.34.7" "@rollup/rollup-linux-loongarch64-gnu": "npm:4.34.8"
"@rollup/rollup-linux-powerpc64le-gnu": "npm:4.34.7" "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.34.8"
"@rollup/rollup-linux-riscv64-gnu": "npm:4.34.7" "@rollup/rollup-linux-riscv64-gnu": "npm:4.34.8"
"@rollup/rollup-linux-s390x-gnu": "npm:4.34.7" "@rollup/rollup-linux-s390x-gnu": "npm:4.34.8"
"@rollup/rollup-linux-x64-gnu": "npm:4.34.7" "@rollup/rollup-linux-x64-gnu": "npm:4.34.8"
"@rollup/rollup-linux-x64-musl": "npm:4.34.7" "@rollup/rollup-linux-x64-musl": "npm:4.34.8"
"@rollup/rollup-win32-arm64-msvc": "npm:4.34.7" "@rollup/rollup-win32-arm64-msvc": "npm:4.34.8"
"@rollup/rollup-win32-ia32-msvc": "npm:4.34.7" "@rollup/rollup-win32-ia32-msvc": "npm:4.34.8"
"@rollup/rollup-win32-x64-msvc": "npm:4.34.7" "@rollup/rollup-win32-x64-msvc": "npm:4.34.8"
"@types/estree": "npm:1.0.6" "@types/estree": "npm:1.0.6"
fsevents: "npm:~2.3.2" fsevents: "npm:~2.3.2"
dependenciesMeta: dependenciesMeta:
@@ -5931,7 +5922,7 @@ __metadata:
optional: true optional: true
bin: bin:
rollup: dist/bin/rollup rollup: dist/bin/rollup
checksum: 10c0/115094e41ff8329e2320a7d37edb4d958aca678f8222b4b52e98981da700678c2ad92fddaf164455ca8c2cf9222d42e7b19a0f0e54bfb070b0b8c62d8f3e99aa checksum: 10c0/b9e711e33413112fbb761107c3fddc4561dfc74335c393542a829a85ccfb2763bfd17bf2422d84a2e9bee7646e5367018973e97005fdf64e49c2e209612f0eb6
languageName: node languageName: node
linkType: hard linkType: hard
@@ -5945,11 +5936,11 @@ __metadata:
linkType: hard linkType: hard
"rxjs@npm:^7.8.1": "rxjs@npm:^7.8.1":
version: 7.8.1 version: 7.8.2
resolution: "rxjs@npm:7.8.1" resolution: "rxjs@npm:7.8.2"
dependencies: dependencies:
tslib: "npm:^2.1.0" tslib: "npm:^2.1.0"
checksum: 10c0/3c49c1ecd66170b175c9cacf5cef67f8914dcbc7cd0162855538d365c83fea631167cacb644b3ce533b2ea0e9a4d0b12175186985f89d75abe73dbd8f7f06f68 checksum: 10c0/1fcd33d2066ada98ba8f21fcbbcaee9f0b271de1d38dc7f4e256bfbc6ffcdde68c8bfb69093de7eeb46f24b1fb820620bf0223706cff26b4ab99a7ff7b2e2c45
languageName: node languageName: node
linkType: hard linkType: hard
@@ -6404,10 +6395,10 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"strnum@npm:^1.0.5": "strnum@npm:^1.1.1":
version: 1.0.5 version: 1.1.1
resolution: "strnum@npm:1.0.5" resolution: "strnum@npm:1.1.1"
checksum: 10c0/64fb8cc2effbd585a6821faa73ad97d4b553c8927e49086a162ffd2cc818787643390b89d567460a8e74300148d11ac052e21c921ef2049f2987f4b1b89a7ff1 checksum: 10c0/c016034f9896ea99c4a22a8a8142d1ec72dba8d514ddec399f96998d5d2ab9f9e5b6c75c761d9730c3244b794022b1a63ec293f0da41ab0a994e3584020ba1ad
languageName: node languageName: node
linkType: hard linkType: hard

View File

@@ -9,11 +9,11 @@
"format": "prettier -l -w '**/*.{ts,tsx,js,css,json,md}'" "format": "prettier -l -w '**/*.{ts,tsx,js,css,json,md}'"
}, },
"dependencies": { "dependencies": {
"@msgpack/msgpack": "^3.0.1", "@msgpack/msgpack": "^3.1.0",
"@trivago/prettier-plugin-sort-imports": "^5.2.2", "@trivago/prettier-plugin-sort-imports": "^5.2.2",
"formidable": "^3.5.2", "formidable": "^3.5.2",
"itty-router": "^5.0.18", "itty-router": "^5.0.18",
"prettier": "^3.5.1" "prettier": "^3.5.2"
}, },
"packageManager": "yarn@4.6.0" "packageManager": "yarn@4.6.0"
} }

View File

@@ -132,10 +132,10 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@msgpack/msgpack@npm:^3.0.1": "@msgpack/msgpack@npm:^3.1.0":
version: 3.0.1 version: 3.1.0
resolution: "@msgpack/msgpack@npm:3.0.1" resolution: "@msgpack/msgpack@npm:3.1.0"
checksum: 10c0/f039c3d8d31374eac37cdb4e70cf9d839757eb9b3c061ca66bd57a582e7f8a4e29303aeb3a4ca891bc1958a265ec91f9644aa783fdc2b21fb4e6621704c4cc67 checksum: 10c0/d31c299cc9f7620715eec77b12ec0cb4950943fd8b0c23275e37afe6ad30efe237e61333e8e340a0a433eca7a4595212fb905e70b4506ae5b866758e4291289b
languageName: node languageName: node
linkType: hard linkType: hard
@@ -260,11 +260,11 @@ __metadata:
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "mock-api@workspace:." resolution: "mock-api@workspace:."
dependencies: dependencies:
"@msgpack/msgpack": "npm:^3.0.1" "@msgpack/msgpack": "npm:^3.1.0"
"@trivago/prettier-plugin-sort-imports": "npm:^5.2.2" "@trivago/prettier-plugin-sort-imports": "npm:^5.2.2"
formidable: "npm:^3.5.2" formidable: "npm:^3.5.2"
itty-router: "npm:^5.0.18" itty-router: "npm:^5.0.18"
prettier: "npm:^3.5.1" prettier: "npm:^3.5.2"
languageName: unknown languageName: unknown
linkType: soft linkType: soft
@@ -291,12 +291,12 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"prettier@npm:^3.5.1": "prettier@npm:^3.5.2":
version: 3.5.1 version: 3.5.2
resolution: "prettier@npm:3.5.1" resolution: "prettier@npm:3.5.2"
bin: bin:
prettier: bin/prettier.cjs prettier: bin/prettier.cjs
checksum: 10c0/9f6f810eae455d6e4213845151a484a2338f2e0d6a8b84ee8e13a83af8a2421ef6c1e31e61e4b135671fb57b9541f6624648880cc2061ac803e243ac898c0123 checksum: 10c0/d7b597ed33f39c32ace675896ad187f06a3e48dc8a1e80051b5c5f0dae3586d53981704b8fda5ac3b080e6c2e0e197d239131b953702674f044351621ca5e1ac
languageName: node languageName: node
linkType: hard linkType: hard

View File

@@ -200,6 +200,7 @@ build_flags =
; ;
[env:native] [env:native]
platform = native platform = native
extra_scripts =
build_flags = build_flags =
-DARDUINOJSON_ENABLE_ARDUINO_STRING=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING=1
-DEMSESP_STANDALONE -DEMSESP_TEST -DEMSESP_STANDALONE -DEMSESP_TEST
@@ -233,11 +234,12 @@ lib_deps =
; unit tests ; unit tests
; The code is in ./test/test_api.* ; The code is in ./test/test_api.*
; to run use `pio run -e native-test -t exec`. All tests should PASS. ; to run use `pio run -e native-test -t exec`. All tests should PASS.
; to update the test results, compile with -DEMSESP_UNITY_CREATE by uncommenting the line below ; to update the test results, compile with -DEMSESP_UNITY_CREATE by uncommenting the line below
; then run and capture the output between "START - CUT HERE" and "END - CUT HERE" into the test_api.h file ; then re-run and capture the output between "START - CUT HERE" and "END - CUT HERE" into the test_api.h file
[env:native-test] [env:native-test]
platform = native platform = native
extra_scripts =
test_build_src = true test_build_src = true
build_flags = build_flags =
-DARDUINOJSON_ENABLE_ARDUINO_STRING=1 -DARDUINOJSON_ENABLE_ARDUINO_STRING=1

View File

@@ -1411,4 +1411,5 @@ solarinfl
currsolarinfl currsolarinfl
temprature temprature
bblanchon bblanchon
vacationmode vacationmode
airbypass

View File

@@ -640,6 +640,7 @@ bool AnalogSensor::get_value_info(JsonObject output, const char * cmd, const int
return true; // no sensors, return true return true; // no sensors, return true
} }
// return all values if its an info and values command
if (!strcmp(cmd, F_(info)) || !strcmp(cmd, F_(values))) { if (!strcmp(cmd, F_(info)) || !strcmp(cmd, F_(values))) {
for (const auto & sensor : sensors_) { for (const auto & sensor : sensors_) {
output[sensor.name()] = sensor.value(); output[sensor.name()] = sensor.value();
@@ -647,6 +648,7 @@ bool AnalogSensor::get_value_info(JsonObject output, const char * cmd, const int
return true; return true;
} }
// show all entity details of the command is entities
if (!strcmp(cmd, F_(entities))) { if (!strcmp(cmd, F_(entities))) {
for (const auto & sensor : sensors_) { for (const auto & sensor : sensors_) {
get_value_json(output[sensor.name()].to<JsonObject>(), sensor); get_value_json(output[sensor.name()].to<JsonObject>(), sensor);
@@ -654,7 +656,7 @@ bool AnalogSensor::get_value_info(JsonObject output, const char * cmd, const int
return true; return true;
} }
// this is for a specific sensor // this is for a specific sensor, return the value
const char * attribute_s = Command::get_attribute(cmd); const char * attribute_s = Command::get_attribute(cmd);
for (const auto & sensor : sensors_) { for (const auto & sensor : sensors_) {
@@ -725,6 +727,7 @@ bool AnalogSensor::command_setvalue(const char * value, const int8_t gpio) {
} }
val = b ? 1 : 0; val = b ? 1 : 0;
} }
for (auto & sensor : sensors_) { for (auto & sensor : sensors_) {
if (sensor.gpio() == gpio) { if (sensor.gpio() == gpio) {
double oldoffset = sensor.offset(); double oldoffset = sensor.offset();
@@ -791,6 +794,7 @@ bool AnalogSensor::command_setvalue(const char * value, const int8_t gpio) {
return true; return true;
} }
} }
return false; return false;
} }

View File

@@ -113,16 +113,16 @@ class AnalogSensor {
~AnalogSensor() = default; ~AnalogSensor() = default;
enum AnalogType : int8_t { enum AnalogType : int8_t {
NOTUSED, // 0 - disabled NOTUSED = 0, // 0 = disabled
DIGITAL_IN, DIGITAL_IN = 1,
COUNTER, COUNTER = 2,
ADC, ADC = 3,
TIMER, TIMER = 4,
RATE, RATE = 5,
DIGITAL_OUT, DIGITAL_OUT = 6,
PWM_0, PWM_0 = 7,
PWM_1, PWM_1 = 8,
PWM_2 PWM_2 = 9
}; };
void start(); void start();

View File

@@ -298,6 +298,8 @@ const char * Command::get_attribute(const char * cmd) {
return nullptr; return nullptr;
} }
// returns the attribute in the given JSON object as a key/value pair called api_data
// or errors if the attribute is not found
bool Command::set_attribute(JsonObject output, const char * cmd, const char * attribute) { bool Command::set_attribute(JsonObject output, const char * cmd, const char * attribute) {
if (attribute == nullptr) { if (attribute == nullptr) {
return true; return true;
@@ -309,7 +311,14 @@ bool Command::set_attribute(JsonObject output, const char * cmd, const char * at
output["api_data"] = data; // always as a string output["api_data"] = data; // always as a string
return true; return true;
} }
return EMSESP::return_not_found(output, attribute, cmd); // not found
// not found
output.clear();
char error[100];
snprintf(error, sizeof(error), "no %s in %s", attribute, cmd);
output["message"] = error;
return false;
} }
// calls a command directly // calls a command directly
@@ -431,7 +440,8 @@ uint8_t Command::call(const uint8_t device_type, const char * command, const cha
logger_.debug("%sCalled command %s", ro.c_str(), info_s); logger_.debug("%sCalled command %s", ro.c_str(), info_s);
} else { } else {
if (id > 0) { if (id > 0) {
LOG_INFO(("%sCalled command %s with value %s and id %d on device 0x%02X"), ro.c_str(), info_s, value, id, device_id); (device_id) ? LOG_INFO(("%sCalled command %s with value %s and id %d on device 0x%02X"), ro.c_str(), info_s, value, id, device_id)
: LOG_INFO(("%sCalled command %s with value %s and id %d"), ro.c_str(), info_s, value, id);
} else { } else {
LOG_INFO(("%sCalled command %s with value %s"), ro.c_str(), info_s, value); LOG_INFO(("%sCalled command %s with value %s"), ro.c_str(), info_s, value);
} }
@@ -481,7 +491,7 @@ Command::CmdFunction * Command::find_command(const uint8_t device_type, const ui
for (auto & cf : cmdfunctions_) { for (auto & cf : cmdfunctions_) {
if (Helpers::toLower(cmd) == Helpers::toLower(cf.cmd_) && (cf.device_type_ == device_type) && (!device_id || cf.device_id_ == device_id) if (Helpers::toLower(cmd) == Helpers::toLower(cf.cmd_) && (cf.device_type_ == device_type) && (!device_id || cf.device_id_ == device_id)
&& (flag == CommandFlag::CMD_FLAG_DEFAULT || (flag & 0x3F) == (cf.flags_ & 0x3F))) { && (cf.device_type_ < EMSdevice::DeviceType::BOILER || flag == CommandFlag::CMD_FLAG_DEFAULT || (flag & 0x3F) == (cf.flags_ & 0x3F))) {
return &cf; return &cf;
} }
} }
@@ -639,9 +649,9 @@ void Command::show(uuid::console::Shell & shell, uint8_t device_type, bool verbo
shell.print('*'); shell.print('*');
} }
shell.print(COLOR_RESET); shell.print(COLOR_RESET);
shell.println();
} }
} }
shell.println();
} }
} }

View File

@@ -813,15 +813,6 @@ bool EMSESP::get_device_value_info(JsonObject root, const char * cmd, const int8
return false; // not found return false; // not found
} }
// sends JSON error message, used with API calls
bool EMSESP::return_not_found(JsonObject output, const char * msg, const char * cmd) {
output.clear();
char error[100];
snprintf(error, sizeof(error), "no %s in %s", msg, cmd);
output["message"] = error;
return false;
}
// search for recognized device_ids : Me, All, otherwise print hex value // search for recognized device_ids : Me, All, otherwise print hex value
std::string EMSESP::device_tostring(const uint8_t device_id) { std::string EMSESP::device_tostring(const uint8_t device_id) {
if ((device_id & 0x7F) == EMSbus::ems_bus_id()) { if ((device_id & 0x7F) == EMSbus::ems_bus_id()) {

View File

@@ -222,8 +222,6 @@ class EMSESP {
static void scan_devices(); static void scan_devices();
static void clear_all_devices(); static void clear_all_devices();
static bool return_not_found(JsonObject output, const char * msg, const char * cmd);
static std::deque<std::unique_ptr<EMSdevice>> emsdevices; static std::deque<std::unique_ptr<EMSdevice>> emsdevices;
// services // services

View File

@@ -573,6 +573,7 @@ const std::initializer_list<Modbus::EntityModbusInfo> Modbus::modbus_register_ma
REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(ventMode), 6, 1), // ventmode REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(ventMode), 6, 1), // ventmode
REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(airquality), 7, 1), // airquality REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(airquality), 7, 1), // airquality
REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(airHumidity), 8, 1), // airhumidity REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(airHumidity), 8, 1), // airhumidity
REGISTER_MAPPING(dt::VENTILATION, TAG_TYPE_DEVICE_DATA, FL_(airbypass), 9, 1), // bypass
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(selRoomTemp), 0, 1), // seltemp REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(selRoomTemp), 0, 1), // seltemp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwTemp), 1, 1), // temp REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwTemp), 1, 1), // temp
REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCurTemp2), 2, 1), // curtemp2 REGISTER_MAPPING(dt::WATER, TAG_TYPE_DHW, FL_(wwCurTemp2), 2, 1), // curtemp2

View File

@@ -859,10 +859,8 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
shell.printfln("Testing adding Analog sensor"); shell.printfln("Testing adding Analog sensor");
Mqtt::ha_enabled(true); Mqtt::ha_enabled(true);
// Mqtt::ha_enabled(false); // Mqtt::ha_enabled(false);
Mqtt::nested_format(1); Mqtt::nested_format(1);
// Mqtt::nested_format(0); // Mqtt::nested_format(0);
// Mqtt::send_response(false); // Mqtt::send_response(false);
// load some EMS data // load some EMS data
@@ -885,6 +883,23 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
request.url("/api/analogsensor/36"); request.url("/api/analogsensor/36");
EMSESP::webAPIService.webAPIService(&request); EMSESP::webAPIService.webAPIService(&request);
// test setting a value
request.method(HTTP_POST);
JsonDocument doc;
char data[] = "{\"value\":10,\"id\":33}";
deserializeJson(doc, data);
request.url("/api/analogsensor/setvalue");
EMSESP::webAPIService.webAPIService(&request, doc.as<JsonVariant>());
shell.invoke_command("call analogsensor test_analogsensor4");
char data2[] = "{\"value\":11}";
deserializeJson(doc, data2);
request.url("/api/analogsensor/test_analogsensor4");
EMSESP::webAPIService.webAPIService(&request, doc.as<JsonVariant>());
shell.invoke_command("call analogsensor test_analogsensor4");
// test renaming it // test renaming it
// bool update(uint8_t id, const std::string & name, int16_t offset, float factor, uint8_t uom, uint8_t type); // bool update(uint8_t id, const std::string & name, int16_t offset, float factor, uint8_t uom, uint8_t type);
// EMSESP::analogsensor_.update(36, "test_analog1_new", 2, 0.7, 17, 1); // EMSESP::analogsensor_.update(36, "test_analog1_new", 2, 0.7, 17, 1);
@@ -1071,6 +1086,8 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
// EMSESP::webAPIService.webAPIService(&request); // EMSESP::webAPIService.webAPIService(&request);
// request.url("/api/thermostat/hc1"); // request.url("/api/thermostat/hc1");
// EMSESP::webAPIService.webAPIService(&request); // EMSESP::webAPIService.webAPIService(&request);
// request.url("/api/boiler/comfort/value");
// EMSESP::webAPIService.webAPIService(&request);
// POST COMMANDS // POST COMMANDS
request.method(HTTP_POST); request.method(HTTP_POST);

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.7.2-dev.21" #define EMSESP_APP_VERSION "3.7.2-dev.22"

View File

@@ -391,7 +391,7 @@ void WebCustomizationService::test() {
analog.offset = 0; analog.offset = 0;
analog.factor = 0.1; analog.factor = 0.1;
analog.uom = 17; analog.uom = 17;
analog.type = 3; analog.type = 3; // ADC
webCustomization.analogCustomizations.push_back(analog); webCustomization.analogCustomizations.push_back(analog);
analog = AnalogCustomization(); analog = AnalogCustomization();
@@ -400,7 +400,7 @@ void WebCustomizationService::test() {
analog.offset = 0; analog.offset = 0;
analog.factor = 1; analog.factor = 1;
analog.uom = 0; analog.uom = 0;
analog.type = 1; analog.type = 1; // DIGITAL_IN
webCustomization.analogCustomizations.push_back(analog); webCustomization.analogCustomizations.push_back(analog);
analog = AnalogCustomization(); analog = AnalogCustomization();
@@ -412,6 +412,15 @@ void WebCustomizationService::test() {
analog.type = 0; // disabled, not-used analog.type = 0; // disabled, not-used
webCustomization.analogCustomizations.push_back(analog); webCustomization.analogCustomizations.push_back(analog);
analog = AnalogCustomization();
analog.gpio = 33;
analog.name = "test_analogsensor4";
analog.offset = 0;
analog.factor = 1;
analog.uom = 0;
analog.type = 2; // COUNTER
webCustomization.analogCustomizations.push_back(analog);
// EMS entities, mark some as favorites // EMS entities, mark some as favorites
webCustomization.entityCustomizations.clear(); webCustomization.entityCustomizations.clear();
auto emsEntity = EntityCustomization(); auto emsEntity = EntityCustomization();

View File

@@ -22,7 +22,6 @@
#include <emsesp.h> #include <emsesp.h>
#include "ESPAsyncWebServer.h" #include "ESPAsyncWebServer.h"
#include "ESP32React.h"
#include "web/WebAPIService.h" #include "web/WebAPIService.h"
using namespace emsesp; using namespace emsesp;
@@ -32,7 +31,7 @@ void run_tests();
const char * call_url(const char * url); const char * call_url(const char * url);
AsyncWebServer * webServer; AsyncWebServer * webServer;
ESP32React * esp32React; ESP32React * esp32React;
WebAPIService * webAPIService; WebAPIService * webAPIService;
EMSESP application; EMSESP application;
FS dummyFS; FS dummyFS;
@@ -67,13 +66,13 @@ static TestStream stream;
// load the tests // load the tests
// this is generated from this file when compiled with -DEMSESP_UNITY_CREATE // this is generated from this file when compiled with -DEMSESP_UNITY_CREATE
// copy the output to the test_api.h file // copy the output to the test_api.h file
#include "test_api.h" // generated test functions #include "test_api.h"
// Unity's setup call - is called before each test // Unity's setup call - is called before each test - empty for now
void setUp() { void setUp() {
} }
// Unity's teardown call - is called after each test // Unity's teardown call - is called after each test - empty for now
void tearDown() { void tearDown() {
} }
@@ -171,7 +170,6 @@ const char * call_url(const char * url) {
request.method(HTTP_GET); request.method(HTTP_GET);
request.url(url); request.url(url);
webAPIService->webAPIService(&request); webAPIService->webAPIService(&request);
return webAPIService->getResponse(); return webAPIService->getResponse();
} }
@@ -187,7 +185,6 @@ const char * call_url(const char * url, const char * data) {
request.method(HTTP_POST); request.method(HTTP_POST);
request.url(url); request.url(url);
webAPIService->webAPIService(&request, json); webAPIService->webAPIService(&request, json);
return webAPIService->getResponse(); return webAPIService->getResponse();
} }
@@ -268,11 +265,28 @@ void manual_test4() {
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/thermostat", data)); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/thermostat", data));
} }
void manual_test5() {
auto expected_response = "[{}]"; // empty is good
char data[] = "{\"value\":11}";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/analogsensor/test_analogsensor4", data));
}
void manual_test6() {
auto expected_response = "[{}]"; // empty is good
char data[] = "{\"value\":10,\"id\":33}";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/analogsensor/setvalue", data));
}
void run_manual_tests() { void run_manual_tests() {
RUN_TEST(manual_test1); RUN_TEST(manual_test1);
RUN_TEST(manual_test2); RUN_TEST(manual_test2);
RUN_TEST(manual_test3); RUN_TEST(manual_test3);
RUN_TEST(manual_test4); RUN_TEST(manual_test4);
RUN_TEST(manual_test5);
RUN_TEST(manual_test6);
} }
const char * run_console_command(const char * command) { const char * run_console_command(const char * command) {
@@ -318,8 +332,10 @@ void run_console_tests() {
// auto-generate the tests // auto-generate the tests
void create_tests() { void create_tests() {
// These tests should all pass.... // These match the calls in test_api.h
// They are all READ calls, no POST or PUT. We use the manual tests for those.
// this first section should all pass
capture("/api/boiler"); capture("/api/boiler");
capture("/api/boiler/commands"); capture("/api/boiler/commands");
capture("/api/boiler/values"); capture("/api/boiler/values");
@@ -406,7 +422,7 @@ void create_tests() {
// Main entry point // Main entry point
int main() { int main() {
webServer = new AsyncWebServer(80); webServer = new AsyncWebServer(80);
esp32React = new ESP32React(webServer, &dummyFS); esp32React = new ESP32React(webServer, &dummyFS);
webAPIService = new WebAPIService(webServer, esp32React->getSecurityManager()); webAPIService = new WebAPIService(webServer, esp32React->getSecurityManager());
// Serial console for commands // Serial console for commands

View File

@@ -1,7 +1,6 @@
// ************************************************************************************************** // **************************************************************************************************
// //
// Compile with -DEMSESP_UNITY_CREATE to generate the test functions // Compile with -DEMSESP_UNITY_CREATE to generate the test functions, copy the output and paste below.
// and copy the output and paste below.
// //
// TODO convert output to JSON and compare, showing differences // TODO convert output to JSON and compare, showing differences
// //
@@ -92,7 +91,9 @@ void test_7() {
void test_8() { void test_8() {
auto expected_response = "[{\"name\":\"outdoortemp\",\"fullname\":\"outside " auto expected_response = "[{\"name\":\"outdoortemp\",\"fullname\":\"outside "
"temperature\",\"circuit\":\"\",\"type\":\"number\",\"uom\":\"°C\",\"readable\":true,\"writeable\":false,\"visible\":true}]"; "temperature\",\"circuit\":\"\",\"type\":\"number\",\"uom\":\"°C\",\"state_class\":\"measurement\",\"device_class\":"
"\"temperature\",\"readable\":true,\"writeable\":false,\"visible\":true}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/boiler/outdoortemp")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/boiler/outdoortemp"));
} }
@@ -126,15 +127,15 @@ void test_13() {
void test_14() { void test_14() {
auto expected_response = "[{\"name\":\"seltemp\",\"fullname\":\"hc1 selected room " auto expected_response = "[{\"name\":\"seltemp\",\"fullname\":\"hc1 selected room "
"temperature\",\"circuit\":\"hc1\",\"value\":20.5,\"type\":\"number\",\"min\":0,\"max\":30,\"uom\":\"°C\",\"readable\":true," "temperature\",\"circuit\":\"hc1\",\"value\":20.5,\"type\":\"number\",\"min\":0,\"max\":30,\"uom\":\"°C\",\"state_class\":"
"\"writeable\":true,\"visible\":true}]"; "\"measurement\",\"device_class\":\"temperature\",\"readable\":true,\"writeable\":true,\"visible\":true}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/thermostat/hc1/seltemp")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/thermostat/hc1/seltemp"));
} }
void test_15() { void test_15() {
auto expected_response = "[{\"name\":\"seltemp\",\"fullname\":\"hc2 selected room " auto expected_response = "[{\"name\":\"seltemp\",\"fullname\":\"hc2 selected room "
"temperature\",\"circuit\":\"hc2\",\"value\":20.6,\"type\":\"number\",\"min\":0,\"max\":30,\"uom\":\"°C\",\"readable\":true," "temperature\",\"circuit\":\"hc2\",\"value\":20.6,\"type\":\"number\",\"min\":0,\"max\":30,\"uom\":\"°C\",\"state_class\":"
"\"writeable\":true,\"visible\":true}]"; "\"measurement\",\"device_class\":\"temperature\",\"readable\":true,\"writeable\":true,\"visible\":true}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/thermostat/hc2/seltemp")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/thermostat/hc2/seltemp"));
} }
@@ -163,20 +164,20 @@ void test_19() {
"\"entityFormat\":1,\"base\":\"ems-esp\",\"discoveryPrefix\":\"homeassistant\",\"discoveryType\":0,\"nestedFormat\":1,\"haEnabled\":true,\"mqttQos\":0," "\"entityFormat\":1,\"base\":\"ems-esp\",\"discoveryPrefix\":\"homeassistant\",\"discoveryType\":0,\"nestedFormat\":1,\"haEnabled\":true,\"mqttQos\":0,"
"\"mqttRetain\":false,\"publishTimeHeartbeat\":60,\"publishTimeBoiler\":10,\"publishTimeThermostat\":10,\"publishTimeSolar\":10,\"publishTimeMixer\":" "\"mqttRetain\":false,\"publishTimeHeartbeat\":60,\"publishTimeBoiler\":10,\"publishTimeThermostat\":10,\"publishTimeSolar\":10,\"publishTimeMixer\":"
"10,\"publishTimeWater\":0,\"publishTimeOther\":10,\"publishTimeSensor\":10,\"publishSingle\":false,\"publish2command\":false,\"sendResponse\":false}," "10,\"publishTimeWater\":0,\"publishTimeOther\":10,\"publishTimeSensor\":10,\"publishSingle\":false,\"publish2command\":false,\"sendResponse\":false},"
"\"syslog\":{\"enabled\":false},\"sensor\":{\"temperatureSensors\":2,\"temperatureSensorReads\":0,\"temperatureSensorFails\":0,\"analogSensors\":3," "\"syslog\":{\"enabled\":false},\"sensor\":{\"temperatureSensors\":2,\"temperatureSensorReads\":0,\"temperatureSensorFails\":0,\"analogSensors\":4,"
"\"analogSensorReads\":0,\"analogSensorFails\":0},\"api\":{\"APICalls\":0,\"APIFails\":0},\"bus\":{\"busStatus\":\"connected\",\"busProtocol\":" "\"analogSensorReads\":0,\"analogSensorFails\":0},\"api\":{\"APICalls\":0,\"APIFails\":0},\"bus\":{\"busStatus\":\"connected\",\"busProtocol\":"
"\"Buderus\",\"busTelegramsReceived\":8,\"busReads\":0,\"busWrites\":0,\"busIncompleteTelegrams\":0,\"busReadsFailed\":0,\"busWritesFailed\":0," "\"Buderus\",\"busTelegramsReceived\":8,\"busReads\":0,\"busWrites\":0,\"busIncompleteTelegrams\":0,\"busReadsFailed\":0,\"busWritesFailed\":0,"
"\"busRxLineQuality\":100,\"busTxLineQuality\":100},\"settings\":{\"boardProfile\":\"S32\",\"locale\":\"en\",\"txMode\":8,\"emsBusID\":11," "\"busRxLineQuality\":100,\"busTxLineQuality\":100},\"settings\":{\"boardProfile\":\"S32\",\"locale\":\"en\",\"txMode\":8,\"emsBusID\":11,"
"\"showerTimer\":false,\"showerMinDuration\":180,\"showerAlert\":false,\"hideLed\":false,\"noTokenApi\":false,\"readonlyMode\":false,\"fahrenheit\":" "\"showerTimer\":false,\"showerMinDuration\":180,\"showerAlert\":false,\"hideLed\":false,\"noTokenApi\":false,\"readonlyMode\":false,\"fahrenheit\":"
"false,\"dallasParasite\":false,\"boolFormat\":1,\"boolDashboard\":1,\"enumFormat\":1,\"analogEnabled\":true,\"telnetEnabled\":true," "false,\"dallasParasite\":false,\"boolFormat\":1,\"boolDashboard\":1,\"enumFormat\":1,\"analogEnabled\":true,\"telnetEnabled\":true,"
"\"maxWebLogBuffer\":25,\"webLogBuffer\":0,\"modbusEnabled\":false,\"forceHeatingOff\":false,\"developerMode\":false},\"devices\":[{\"type\":" "\"maxWebLogBuffer\":25,\"modbusEnabled\":false,\"forceHeatingOff\":false,\"developerMode\":false},\"devices\":[{\"type\":"
"\"boiler\",\"name\":\"My Custom " "\"boiler\",\"name\":\"My Custom "
"Boiler\",\"deviceID\":\"0x08\",\"productID\":123,\"brand\":\"\",\"version\":\"01.00\",\"entities\":37,\"handlersReceived\":\"0x18\"," "Boiler\",\"deviceID\":\"0x08\",\"productID\":123,\"brand\":\"\",\"version\":\"01.00\",\"entities\":37,\"handlersReceived\":\"0x18\","
"\"handlersFetched\":\"0x14 0x33\",\"handlersPending\":\"0xBF 0x10 0x11 0xC2 0x15 0x1C 0x19 0x1A 0x35 0x34 0x2A 0xD1 0xE3 0xE4 0xE5 0xE9 0x2E " "\"handlersFetched\":\"0x14 0x33\",\"handlersPending\":\"0xBF 0x10 0x11 0xC2 0x15 0x1C 0x19 0x1A 0x35 0x34 0x2A 0xD1 0xE3 0xE4 0xE5 0xE9 0x2E "
"0x3B\"},{\"type\":\"thermostat\",\"name\":\"FW120\",\"deviceID\":\"0x10\",\"productID\":192,\"brand\":\"\",\"version\":\"01.00\",\"entities\":15," "0x3B\"},{\"type\":\"thermostat\",\"name\":\"FW120\",\"deviceID\":\"0x10\",\"productID\":192,\"brand\":\"\",\"version\":\"01.00\",\"entities\":15,"
"\"handlersReceived\":\"0x016F\",\"handlersFetched\":\"0x0170 0x0171\",\"handlersPending\":\"0xA3 0x06 0xA2 0x12 0x13 0x0172 0x0165 " "\"handlersReceived\":\"0x016F\",\"handlersFetched\":\"0x0170 0x0171\",\"handlersPending\":\"0xA3 0x06 0xA2 0x12 0x13 0x0172 0x0165 "
"0x0168\"},{\"type\":\"temperaturesensor\",\"name\":\"temperaturesensor\",\"entities\":2},{\"type\":\"analogsensor\",\"name\":\"analogsensor\"," "0x0168\"},{\"type\":\"temperaturesensor\",\"name\":\"temperaturesensor\",\"entities\":2},{\"type\":\"analogsensor\",\"name\":\"analogsensor\","
"\"entities\":3},{\"type\":\"scheduler\",\"name\":\"scheduler\",\"entities\":2},{\"type\":\"custom\",\"name\":\"custom\",\"entities\":4}]}]"; "\"entities\":4},{\"type\":\"scheduler\",\"name\":\"scheduler\",\"entities\":2},{\"type\":\"custom\",\"name\":\"custom\",\"entities\":4}]}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/system")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/system"));
} }
@@ -189,26 +190,26 @@ void test_20() {
"\"entityFormat\":1,\"base\":\"ems-esp\",\"discoveryPrefix\":\"homeassistant\",\"discoveryType\":0,\"nestedFormat\":1,\"haEnabled\":true,\"mqttQos\":0," "\"entityFormat\":1,\"base\":\"ems-esp\",\"discoveryPrefix\":\"homeassistant\",\"discoveryType\":0,\"nestedFormat\":1,\"haEnabled\":true,\"mqttQos\":0,"
"\"mqttRetain\":false,\"publishTimeHeartbeat\":60,\"publishTimeBoiler\":10,\"publishTimeThermostat\":10,\"publishTimeSolar\":10,\"publishTimeMixer\":" "\"mqttRetain\":false,\"publishTimeHeartbeat\":60,\"publishTimeBoiler\":10,\"publishTimeThermostat\":10,\"publishTimeSolar\":10,\"publishTimeMixer\":"
"10,\"publishTimeWater\":0,\"publishTimeOther\":10,\"publishTimeSensor\":10,\"publishSingle\":false,\"publish2command\":false,\"sendResponse\":false}," "10,\"publishTimeWater\":0,\"publishTimeOther\":10,\"publishTimeSensor\":10,\"publishSingle\":false,\"publish2command\":false,\"sendResponse\":false},"
"\"syslog\":{\"enabled\":false},\"sensor\":{\"temperatureSensors\":2,\"temperatureSensorReads\":0,\"temperatureSensorFails\":0,\"analogSensors\":3," "\"syslog\":{\"enabled\":false},\"sensor\":{\"temperatureSensors\":2,\"temperatureSensorReads\":0,\"temperatureSensorFails\":0,\"analogSensors\":4,"
"\"analogSensorReads\":0,\"analogSensorFails\":0},\"api\":{\"APICalls\":0,\"APIFails\":0},\"bus\":{\"busStatus\":\"connected\",\"busProtocol\":" "\"analogSensorReads\":0,\"analogSensorFails\":0},\"api\":{\"APICalls\":0,\"APIFails\":0},\"bus\":{\"busStatus\":\"connected\",\"busProtocol\":"
"\"Buderus\",\"busTelegramsReceived\":8,\"busReads\":0,\"busWrites\":0,\"busIncompleteTelegrams\":0,\"busReadsFailed\":0,\"busWritesFailed\":0," "\"Buderus\",\"busTelegramsReceived\":8,\"busReads\":0,\"busWrites\":0,\"busIncompleteTelegrams\":0,\"busReadsFailed\":0,\"busWritesFailed\":0,"
"\"busRxLineQuality\":100,\"busTxLineQuality\":100},\"settings\":{\"boardProfile\":\"S32\",\"locale\":\"en\",\"txMode\":8,\"emsBusID\":11," "\"busRxLineQuality\":100,\"busTxLineQuality\":100},\"settings\":{\"boardProfile\":\"S32\",\"locale\":\"en\",\"txMode\":8,\"emsBusID\":11,"
"\"showerTimer\":false,\"showerMinDuration\":180,\"showerAlert\":false,\"hideLed\":false,\"noTokenApi\":false,\"readonlyMode\":false,\"fahrenheit\":" "\"showerTimer\":false,\"showerMinDuration\":180,\"showerAlert\":false,\"hideLed\":false,\"noTokenApi\":false,\"readonlyMode\":false,\"fahrenheit\":"
"false,\"dallasParasite\":false,\"boolFormat\":1,\"boolDashboard\":1,\"enumFormat\":1,\"analogEnabled\":true,\"telnetEnabled\":true," "false,\"dallasParasite\":false,\"boolFormat\":1,\"boolDashboard\":1,\"enumFormat\":1,\"analogEnabled\":true,\"telnetEnabled\":true,"
"\"maxWebLogBuffer\":25,\"webLogBuffer\":0,\"modbusEnabled\":false,\"forceHeatingOff\":false,\"developerMode\":false},\"devices\":[{\"type\":" "\"maxWebLogBuffer\":25,\"modbusEnabled\":false,\"forceHeatingOff\":false,\"developerMode\":false},\"devices\":[{\"type\":"
"\"boiler\",\"name\":\"My Custom " "\"boiler\",\"name\":\"My Custom "
"Boiler\",\"deviceID\":\"0x08\",\"productID\":123,\"brand\":\"\",\"version\":\"01.00\",\"entities\":37,\"handlersReceived\":\"0x18\"," "Boiler\",\"deviceID\":\"0x08\",\"productID\":123,\"brand\":\"\",\"version\":\"01.00\",\"entities\":37,\"handlersReceived\":\"0x18\","
"\"handlersFetched\":\"0x14 0x33\",\"handlersPending\":\"0xBF 0x10 0x11 0xC2 0x15 0x1C 0x19 0x1A 0x35 0x34 0x2A 0xD1 0xE3 0xE4 0xE5 0xE9 0x2E " "\"handlersFetched\":\"0x14 0x33\",\"handlersPending\":\"0xBF 0x10 0x11 0xC2 0x15 0x1C 0x19 0x1A 0x35 0x34 0x2A 0xD1 0xE3 0xE4 0xE5 0xE9 0x2E "
"0x3B\"},{\"type\":\"thermostat\",\"name\":\"FW120\",\"deviceID\":\"0x10\",\"productID\":192,\"brand\":\"\",\"version\":\"01.00\",\"entities\":15," "0x3B\"},{\"type\":\"thermostat\",\"name\":\"FW120\",\"deviceID\":\"0x10\",\"productID\":192,\"brand\":\"\",\"version\":\"01.00\",\"entities\":15,"
"\"handlersReceived\":\"0x016F\",\"handlersFetched\":\"0x0170 0x0171\",\"handlersPending\":\"0xA3 0x06 0xA2 0x12 0x13 0x0172 0x0165 " "\"handlersReceived\":\"0x016F\",\"handlersFetched\":\"0x0170 0x0171\",\"handlersPending\":\"0xA3 0x06 0xA2 0x12 0x13 0x0172 0x0165 "
"0x0168\"},{\"type\":\"temperaturesensor\",\"name\":\"temperaturesensor\",\"entities\":2},{\"type\":\"analogsensor\",\"name\":\"analogsensor\"," "0x0168\"},{\"type\":\"temperaturesensor\",\"name\":\"temperaturesensor\",\"entities\":2},{\"type\":\"analogsensor\",\"name\":\"analogsensor\","
"\"entities\":3},{\"type\":\"scheduler\",\"name\":\"scheduler\",\"entities\":2},{\"type\":\"custom\",\"name\":\"custom\",\"entities\":4}]}]"; "\"entities\":4},{\"type\":\"scheduler\",\"name\":\"scheduler\",\"entities\":2},{\"type\":\"custom\",\"name\":\"custom\",\"entities\":4}]}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/system/info")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/system/info"));
} }
void test_21() { void test_21() {
auto expected_response = auto expected_response =
"[{\"name\":\"locale\",\"circuit\":\"settings\",\"readable\":true,\"writable\":false,\"visible\":true,\"value\":\"en\",\"type\":\"string\"}]"; "[{\"name\":\"locale\",\"circuit\":\"settings\",\"readable\":true,\"writeable\":false,\"visible\":true,\"value\":\"en\",\"type\":\"string\"}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/system/settings/locale")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/system/settings/locale"));
} }
@@ -267,12 +268,12 @@ void test_31() {
} }
void test_32() { void test_32() {
auto expected_response = "[{\"test_analogsensor1\":0,\"test_analogsensor2\":1,\"test_analogsensor3\":0}]"; auto expected_response = "[{\"test_analogsensor1\":0,\"test_analogsensor2\":1,\"test_analogsensor3\":0,\"test_analogsensor4\":0}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/analogsensor")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/analogsensor"));
} }
void test_33() { void test_33() {
auto expected_response = "[{\"test_analogsensor1\":0,\"test_analogsensor2\":1,\"test_analogsensor3\":0}]"; auto expected_response = "[{\"test_analogsensor1\":0,\"test_analogsensor2\":1,\"test_analogsensor3\":0,\"test_analogsensor4\":0}]";
TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/analogsensor/info")); TEST_ASSERT_EQUAL_STRING(expected_response, call_url("/api/analogsensor/info"));
} }