Merge branch 'dev' into dev

This commit is contained in:
Proddy
2025-10-22 22:17:08 +02:00
committed by GitHub
12 changed files with 94 additions and 73 deletions

View File

@@ -49,7 +49,7 @@
"@preact/compat": "^18.3.1", "@preact/compat": "^18.3.1",
"@preact/preset-vite": "^2.10.2", "@preact/preset-vite": "^2.10.2",
"@trivago/prettier-plugin-sort-imports": "^5.2.2", "@trivago/prettier-plugin-sort-imports": "^5.2.2",
"@types/node": "^24.9.1", "@types/node": "^24.8.1",
"@types/react": "^19.2.2", "@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2", "@types/react-dom": "^19.2.2",
"concurrently": "^9.2.1", "concurrently": "^9.2.1",

View File

@@ -80,13 +80,13 @@ importers:
version: 18.3.1(preact@10.27.2) version: 18.3.1(preact@10.27.2)
'@preact/preset-vite': '@preact/preset-vite':
specifier: ^2.10.2 specifier: ^2.10.2
version: 2.10.2(@babel/core@7.28.4)(preact@10.27.2)(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0)) version: 2.10.2(@babel/core@7.28.4)(preact@10.27.2)(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0))
'@trivago/prettier-plugin-sort-imports': '@trivago/prettier-plugin-sort-imports':
specifier: ^5.2.2 specifier: ^5.2.2
version: 5.2.2(prettier@3.6.2) version: 5.2.2(prettier@3.6.2)
'@types/node': '@types/node':
specifier: ^24.9.1 specifier: ^24.8.1
version: 24.9.1 version: 24.8.1
'@types/react': '@types/react':
specifier: ^19.2.2 specifier: ^19.2.2
version: 19.2.2 version: 19.2.2
@@ -107,7 +107,7 @@ importers:
version: 3.6.2 version: 3.6.2
rollup-plugin-visualizer: rollup-plugin-visualizer:
specifier: ^6.0.5 specifier: ^6.0.5
version: 6.0.5(rollup@4.52.5) version: 6.0.5(rollup@4.52.4)
terser: terser:
specifier: ^5.44.0 specifier: ^5.44.0
version: 5.44.0 version: 5.44.0
@@ -115,14 +115,14 @@ importers:
specifier: ^8.46.2 specifier: ^8.46.2
version: 8.46.2(eslint@9.38.0)(typescript@5.9.3) version: 8.46.2(eslint@9.38.0)(typescript@5.9.3)
vite: vite:
specifier: ^7.1.11 specifier: ^7.1.10
version: 7.1.11(@types/node@24.9.1)(terser@5.44.0) version: 7.1.10(@types/node@24.8.1)(terser@5.44.0)
vite-plugin-imagemin: vite-plugin-imagemin:
specifier: ^0.6.1 specifier: ^0.6.1
version: 0.6.1(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0)) version: 0.6.1(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0))
vite-tsconfig-paths: vite-tsconfig-paths:
specifier: ^5.1.4 specifier: ^5.1.4
version: 5.1.4(typescript@5.9.3)(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0)) version: 5.1.4(typescript@5.9.3)(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0))
packages: packages:
@@ -851,8 +851,8 @@ packages:
resolution: {integrity: sha512-zmPitbQ8+6zNutpwgcQuLcsEpn/Cj54Kbn7L5pX0Os5kdWplB7xPgEh/g+SWOB/qmows2gpuCaPyduq8ZZRnxA==} resolution: {integrity: sha512-zmPitbQ8+6zNutpwgcQuLcsEpn/Cj54Kbn7L5pX0Os5kdWplB7xPgEh/g+SWOB/qmows2gpuCaPyduq8ZZRnxA==}
deprecated: This is a stub types definition. minimatch provides its own type definitions, so you do not need this installed. deprecated: This is a stub types definition. minimatch provides its own type definitions, so you do not need this installed.
'@types/node@24.9.1': '@types/node@24.8.1':
resolution: {integrity: sha512-QoiaXANRkSXK6p0Duvt56W208du4P9Uye9hWLWgGMDTEoKPhuenzNcC4vGUmrNkiOKTlIrBoyNQYNpSwfEZXSg==} resolution: {integrity: sha512-alv65KGRadQVfVcG69MuB4IzdYVpRwMG/mq8KWOaoOdyY617P5ivaDiMCGOFDWD2sAn5Q0mR3mRtUOgm99hL9Q==}
'@types/parse-json@4.0.2': '@types/parse-json@4.0.2':
resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==}
@@ -1014,8 +1014,8 @@ packages:
base64-js@1.5.1: base64-js@1.5.1:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
baseline-browser-mapping@2.8.19: baseline-browser-mapping@2.8.17:
resolution: {integrity: sha512-zoKGUdu6vb2jd3YOq0nnhEDQVbPcHhco3UImJrv5dSkvxTc2pl2WjOPsjZXDwPDSl5eghIMuY3R6J9NDKF3KcQ==} resolution: {integrity: sha512-j5zJcx6golJYTG6c05LUZ3Z8Gi+M62zRT/ycz4Xq4iCOdpcxwg7ngEYD4KA0eWZC7U17qh/Smq8bYbACJ0ipBA==}
hasBin: true hasBin: true
bin-build@3.0.0: bin-build@3.0.0:
@@ -2238,8 +2238,8 @@ packages:
node-html-parser@6.1.13: node-html-parser@6.1.13:
resolution: {integrity: sha512-qIsTMOY4C/dAa5Q5vsobRpOOvPfC4pB61UVW2uSwZNUp0QU/jCekTal1vMmbO0DgdHeLUJpv/ARmDqErVxA3Sg==} resolution: {integrity: sha512-qIsTMOY4C/dAa5Q5vsobRpOOvPfC4pB61UVW2uSwZNUp0QU/jCekTal1vMmbO0DgdHeLUJpv/ARmDqErVxA3Sg==}
node-releases@2.0.26: node-releases@2.0.25:
resolution: {integrity: sha512-S2M9YimhSjBSvYnlr5/+umAnPHE++ODwt5e2Ij6FoX45HA/s4vHdkDx1eax2pAPeAOqu4s9b7ppahsyEFdVqQA==} resolution: {integrity: sha512-4auku8B/vw5psvTiiN9j1dAOsXvMoGqJuKJcR+dTdqiXEK20mMTk1UEo3HS16LeGQsVG6+qKTPM9u/qQ2LqATA==}
normalize-package-data@2.5.0: normalize-package-data@2.5.0:
resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==}
@@ -3575,18 +3575,18 @@ snapshots:
dependencies: dependencies:
preact: 10.27.2 preact: 10.27.2
'@preact/preset-vite@2.10.2(@babel/core@7.28.4)(preact@10.27.2)(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0))': '@preact/preset-vite@2.10.2(@babel/core@7.28.4)(preact@10.27.2)(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0))':
dependencies: dependencies:
'@babel/core': 7.28.4 '@babel/core': 7.28.4
'@babel/plugin-transform-react-jsx': 7.27.1(@babel/core@7.28.4) '@babel/plugin-transform-react-jsx': 7.27.1(@babel/core@7.28.4)
'@babel/plugin-transform-react-jsx-development': 7.27.1(@babel/core@7.28.4) '@babel/plugin-transform-react-jsx-development': 7.27.1(@babel/core@7.28.4)
'@prefresh/vite': 2.4.10(preact@10.27.2)(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0)) '@prefresh/vite': 2.4.10(preact@10.27.2)(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0))
'@rollup/pluginutils': 4.2.1 '@rollup/pluginutils': 4.2.1
babel-plugin-transform-hook-names: 1.0.2(@babel/core@7.28.4) babel-plugin-transform-hook-names: 1.0.2(@babel/core@7.28.4)
debug: 4.4.3 debug: 4.4.3
picocolors: 1.1.1 picocolors: 1.1.1
vite: 7.1.11(@types/node@24.9.1)(terser@5.44.0) vite: 7.1.10(@types/node@24.8.1)(terser@5.44.0)
vite-prerender-plugin: 0.5.12(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0)) vite-prerender-plugin: 0.5.12(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0))
transitivePeerDependencies: transitivePeerDependencies:
- preact - preact
- supports-color - supports-color
@@ -3599,7 +3599,7 @@ snapshots:
'@prefresh/utils@1.2.1': {} '@prefresh/utils@1.2.1': {}
'@prefresh/vite@2.4.10(preact@10.27.2)(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0))': '@prefresh/vite@2.4.10(preact@10.27.2)(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0))':
dependencies: dependencies:
'@babel/core': 7.28.4 '@babel/core': 7.28.4
'@prefresh/babel-plugin': 0.5.2 '@prefresh/babel-plugin': 0.5.2
@@ -3607,7 +3607,7 @@ snapshots:
'@prefresh/utils': 1.2.1 '@prefresh/utils': 1.2.1
'@rollup/pluginutils': 4.2.1 '@rollup/pluginutils': 4.2.1
preact: 10.27.2 preact: 10.27.2
vite: 7.1.11(@types/node@24.9.1)(terser@5.44.0) vite: 7.1.10(@types/node@24.8.1)(terser@5.44.0)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
@@ -3712,7 +3712,7 @@ snapshots:
'@types/glob@7.2.0': '@types/glob@7.2.0':
dependencies: dependencies:
'@types/minimatch': 6.0.0 '@types/minimatch': 6.0.0
'@types/node': 24.9.1 '@types/node': 24.8.1
'@types/imagemin-gifsicle@7.0.4': '@types/imagemin-gifsicle@7.0.4':
dependencies: dependencies:
@@ -3741,19 +3741,19 @@ snapshots:
'@types/imagemin@7.0.1': '@types/imagemin@7.0.1':
dependencies: dependencies:
'@types/node': 24.9.1 '@types/node': 24.8.1
'@types/json-schema@7.0.15': {} '@types/json-schema@7.0.15': {}
'@types/keyv@3.1.4': '@types/keyv@3.1.4':
dependencies: dependencies:
'@types/node': 24.9.1 '@types/node': 24.8.1
'@types/minimatch@6.0.0': '@types/minimatch@6.0.0':
dependencies: dependencies:
minimatch: 10.0.3 minimatch: 10.0.3
'@types/node@24.9.1': '@types/node@24.8.1':
dependencies: dependencies:
undici-types: 7.16.0 undici-types: 7.16.0
@@ -3775,11 +3775,11 @@ snapshots:
'@types/responselike@1.0.3': '@types/responselike@1.0.3':
dependencies: dependencies:
'@types/node': 24.9.1 '@types/node': 24.8.1
'@types/svgo@2.6.4': '@types/svgo@2.6.4':
dependencies: dependencies:
'@types/node': 24.9.1 '@types/node': 24.8.1
'@typescript-eslint/eslint-plugin@8.46.2(@typescript-eslint/parser@8.46.2(eslint@9.38.0)(typescript@5.9.3))(eslint@9.38.0)(typescript@5.9.3)': '@typescript-eslint/eslint-plugin@8.46.2(@typescript-eslint/parser@8.46.2(eslint@9.38.0)(typescript@5.9.3))(eslint@9.38.0)(typescript@5.9.3)':
dependencies: dependencies:
@@ -3936,7 +3936,7 @@ snapshots:
base64-js@1.5.1: {} base64-js@1.5.1: {}
baseline-browser-mapping@2.8.19: {} baseline-browser-mapping@2.8.17: {}
bin-build@3.0.0: bin-build@3.0.0:
dependencies: dependencies:
@@ -3993,11 +3993,11 @@ snapshots:
browserslist@4.27.0: browserslist@4.27.0:
dependencies: dependencies:
baseline-browser-mapping: 2.8.19 baseline-browser-mapping: 2.8.17
caniuse-lite: 1.0.30001751 caniuse-lite: 1.0.30001751
electron-to-chromium: 1.5.238 electron-to-chromium: 1.5.237
node-releases: 2.0.26 node-releases: 2.0.25
update-browserslist-db: 1.1.4(browserslist@4.27.0) update-browserslist-db: 1.1.3(browserslist@4.26.3)
buffer-alloc-unsafe@1.1.0: {} buffer-alloc-unsafe@1.1.0: {}
@@ -5262,7 +5262,7 @@ snapshots:
css-select: 5.2.2 css-select: 5.2.2
he: 1.2.0 he: 1.2.0
node-releases@2.0.26: {} node-releases@2.0.25: {}
normalize-package-data@2.5.0: normalize-package-data@2.5.0:
dependencies: dependencies:
@@ -5586,7 +5586,7 @@ snapshots:
dependencies: dependencies:
glob: 7.2.3 glob: 7.2.3
rollup-plugin-visualizer@6.0.5(rollup@4.52.5): rollup-plugin-visualizer@6.0.5(rollup@4.52.4):
dependencies: dependencies:
open: 8.4.2 open: 8.4.2
picomatch: 4.0.3 picomatch: 4.0.3
@@ -5935,7 +5935,7 @@ snapshots:
spdx-correct: 3.2.0 spdx-correct: 3.2.0
spdx-expression-parse: 3.0.1 spdx-expression-parse: 3.0.1
vite-plugin-imagemin@0.6.1(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0)): vite-plugin-imagemin@0.6.1(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0)):
dependencies: dependencies:
'@types/imagemin': 7.0.1 '@types/imagemin': 7.0.1
'@types/imagemin-gifsicle': 7.0.4 '@types/imagemin-gifsicle': 7.0.4
@@ -5960,11 +5960,11 @@ snapshots:
imagemin-webp: 6.1.0 imagemin-webp: 6.1.0
jpegtran-bin: 6.0.1 jpegtran-bin: 6.0.1
pathe: 0.2.0 pathe: 0.2.0
vite: 7.1.11(@types/node@24.9.1)(terser@5.44.0) vite: 7.1.10(@types/node@24.8.1)(terser@5.44.0)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
vite-prerender-plugin@0.5.12(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0)): vite-prerender-plugin@0.5.12(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0)):
dependencies: dependencies:
kolorist: 1.8.0 kolorist: 1.8.0
magic-string: 0.30.19 magic-string: 0.30.19
@@ -5972,20 +5972,20 @@ snapshots:
simple-code-frame: 1.3.0 simple-code-frame: 1.3.0
source-map: 0.7.6 source-map: 0.7.6
stack-trace: 1.0.0-pre2 stack-trace: 1.0.0-pre2
vite: 7.1.11(@types/node@24.9.1)(terser@5.44.0) vite: 7.1.10(@types/node@24.8.1)(terser@5.44.0)
vite-tsconfig-paths@5.1.4(typescript@5.9.3)(vite@7.1.11(@types/node@24.9.1)(terser@5.44.0)): vite-tsconfig-paths@5.1.4(typescript@5.9.3)(vite@7.1.10(@types/node@24.8.1)(terser@5.44.0)):
dependencies: dependencies:
debug: 4.4.3 debug: 4.4.3
globrex: 0.1.2 globrex: 0.1.2
tsconfck: 3.1.6(typescript@5.9.3) tsconfck: 3.1.6(typescript@5.9.3)
optionalDependencies: optionalDependencies:
vite: 7.1.11(@types/node@24.9.1)(terser@5.44.0) vite: 7.1.10(@types/node@24.8.1)(terser@5.44.0)
transitivePeerDependencies: transitivePeerDependencies:
- supports-color - supports-color
- typescript - typescript
vite@7.1.11(@types/node@24.9.1)(terser@5.44.0): vite@7.1.10(@types/node@24.8.1)(terser@5.44.0):
dependencies: dependencies:
esbuild: 0.25.11 esbuild: 0.25.11
fdir: 6.5.0(picomatch@4.0.3) fdir: 6.5.0(picomatch@4.0.3)
@@ -5994,7 +5994,7 @@ snapshots:
rollup: 4.52.5 rollup: 4.52.5
tinyglobby: 0.2.15 tinyglobby: 0.2.15
optionalDependencies: optionalDependencies:
'@types/node': 24.9.1 '@types/node': 24.8.1
fsevents: 2.3.3 fsevents: 2.3.3
terser: 5.44.0 terser: 5.44.0

View File

@@ -43,7 +43,8 @@ string_sizes = {
"thermostat/switchtime": 16, "thermostat/switchtime": 16,
"thermostat/switchtimeww": 21, "thermostat/switchtimeww": 21,
"controller/datetime": 25, "controller/datetime": 25,
"connect/datetime": 30 "connect/datetime": 25,
"connect/name": 51
} }
tag_to_tagtype = { tag_to_tagtype = {
@@ -83,7 +84,23 @@ tag_to_tagtype = {
32: "TAG_TYPE_HS", 32: "TAG_TYPE_HS",
33: "TAG_TYPE_HS", 33: "TAG_TYPE_HS",
34: "TAG_TYPE_HS", 34: "TAG_TYPE_HS",
35: "TAG_TYPE_HS" 35: "TAG_TYPE_HS",
36: "TAG_TYPE_SRC",
37: "TAG_TYPE_SRC",
38: "TAG_TYPE_SRC",
39: "TAG_TYPE_SRC",
40: "TAG_TYPE_SRC",
41: "TAG_TYPE_SRC",
42: "TAG_TYPE_SRC",
43: "TAG_TYPE_SRC",
44: "TAG_TYPE_SRC",
45: "TAG_TYPE_SRC",
46: "TAG_TYPE_SRC",
47: "TAG_TYPE_SRC",
48: "TAG_TYPE_SRC",
49: "TAG_TYPE_SRC",
50: "TAG_TYPE_SRC",
50: "TAG_TYPE_SRC"
} }
device_type_names = [ device_type_names = [

View File

@@ -52,9 +52,6 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
return json_message(CommandRet::ERROR, "missing command in path", output); return json_message(CommandRet::ERROR, "missing command in path", output);
} }
std::string cmd_s;
int8_t id_n = -1; // default hc
// check for a device as first item in the path // check for a device as first item in the path
const char * device_s = nullptr; const char * device_s = nullptr;
if (!num_paths) { if (!num_paths) {
@@ -79,16 +76,15 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
// the next value on the path should be the command or entity name // the next value on the path should be the command or entity name
const char * command_p = nullptr; const char * command_p = nullptr;
char command[COMMAND_MAX_LENGTH];
if (num_paths == 2) { if (num_paths == 2) {
command_p = p.paths()[1].c_str(); command_p = p.paths()[1].c_str();
} else if (num_paths == 3) { } else if (num_paths == 3) {
// concatenate the path into one string as it could be in the format 'hc/XXX' // concatenate the path into one string as it could be in the format 'hc/XXX'
char command[COMMAND_MAX_LENGTH];
snprintf(command, sizeof(command), "%s/%s", p.paths()[1].c_str(), p.paths()[2].c_str()); snprintf(command, sizeof(command), "%s/%s", p.paths()[1].c_str(), p.paths()[2].c_str());
command_p = command; command_p = command;
} else if (num_paths > 3) { } else if (num_paths > 3) {
// concatenate the path into one string as it could be in the format 'hc/XXX/attribute' // concatenate the path into one string as it could be in the format 'hc/XXX/attribute'
char command[COMMAND_MAX_LENGTH];
snprintf(command, sizeof(command), "%s/%s/%s", p.paths()[1].c_str(), p.paths()[2].c_str(), p.paths()[3].c_str()); snprintf(command, sizeof(command), "%s/%s/%s", p.paths()[1].c_str(), p.paths()[2].c_str(), p.paths()[3].c_str());
command_p = command; command_p = command;
} else { } else {
@@ -100,6 +96,7 @@ uint8_t Command::process(const char * path, const bool is_admin, const JsonObjec
} }
} }
int8_t id_n = -1; // default hc
// some commands may be prefixed with hc. dhw. or hc/ or dhw/ so extract these if they exist // some commands may be prefixed with hc. dhw. or hc/ or dhw/ so extract these if they exist
// parse_command_string returns the extracted command // parse_command_string returns the extracted command
if (device_type >= EMSdevice::DeviceType::BOILER) { if (device_type >= EMSdevice::DeviceType::BOILER) {

View File

@@ -698,9 +698,9 @@ void EMSESP::publish_other_values() {
publish_device_values(EMSdevice::DeviceType::EXTENSION); publish_device_values(EMSdevice::DeviceType::EXTENSION);
publish_device_values(EMSdevice::DeviceType::ALERT); publish_device_values(EMSdevice::DeviceType::ALERT);
publish_device_values(EMSdevice::DeviceType::POOL); publish_device_values(EMSdevice::DeviceType::POOL);
publish_device_values(EMSdevice::DeviceType::CONNECT);
// other EMS devices without values yet // other EMS devices without values yet
// publish_device_values(EMSdevice::DeviceType::GATEWAY); // publish_device_values(EMSdevice::DeviceType::GATEWAY);
// publish_device_values(EMSdevice::DeviceType::CONNECT);
// publish_device_values(EMSdevice::DeviceType::GENERIC); // publish_device_values(EMSdevice::DeviceType::GENERIC);
webSchedulerService.publish(); webSchedulerService.publish();

View File

@@ -455,12 +455,10 @@ int Modbus::getRegisterCount(const DeviceValue & dv) {
uint32_t num_values = std::max(dv.max, (uint32_t)abs(dv.min)); uint32_t num_values = std::max(dv.max, (uint32_t)abs(dv.min));
int num_registers = 0; int num_registers = 0;
if (num_values <= (1L << 8)) if (num_values < (1L << 16))
num_registers = 1; num_registers = 1;
else if (num_values <= (1L << 16)) else if (num_values <= (0xFFFFFFFF))
num_registers = 2; num_registers = 2;
else if (num_values <= (1L << 32))
num_registers = 4;
else else
LOG_ERROR("num_registers is too big to be encoded with modbus registers"); LOG_ERROR("num_registers is too big to be encoded with modbus registers");

View File

@@ -941,9 +941,9 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const
48, 48,
63); 63);
register_device_value( register_device_value(
DeviceValueTAG::TAG_DHW1, &wwComfDiffTemp_, DeviceValueType::UINT8, FL_(wwComfDiffTemp), DeviceValueUOM::K, MAKE_CF_CB(set_wwComfDiffTemp), 6, 12); DeviceValueTAG::TAG_DHW1, &wwComfDiffTemp_, DeviceValueType::UINT8, FL_(wwComfDiffTemp), DeviceValueUOM::K, MAKE_CF_CB(set_wwComfDiffTemp), 4, 12);
register_device_value( register_device_value(
DeviceValueTAG::TAG_DHW1, &wwEcoDiffTemp_, DeviceValueType::UINT8, FL_(wwEcoDiffTemp), DeviceValueUOM::K, MAKE_CF_CB(set_wwEcoDiffTemp), 6, 12); DeviceValueTAG::TAG_DHW1, &wwEcoDiffTemp_, DeviceValueType::UINT8, FL_(wwEcoDiffTemp), DeviceValueUOM::K, MAKE_CF_CB(set_wwEcoDiffTemp), 4, 12);
register_device_value(DeviceValueTAG::TAG_DHW1, register_device_value(DeviceValueTAG::TAG_DHW1,
&wwEcoPlusDiffTemp_, &wwEcoPlusDiffTemp_,
DeviceValueType::UINT8, DeviceValueType::UINT8,

View File

@@ -87,7 +87,7 @@ void Connect::register_device_values_room(std::shared_ptr<Connect::RoomCircuit>
register_device_value(tag, &room->dewtemp_, DeviceValueType::INT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(dewTemperature), DeviceValueUOM::DEGREES); register_device_value(tag, &room->dewtemp_, DeviceValueType::INT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(dewTemperature), DeviceValueUOM::DEGREES);
register_device_value( register_device_value(
tag, &room->seltemp_, DeviceValueType::UINT8, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(selRoomTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_seltemp), 5, 30); tag, &room->seltemp_, DeviceValueType::UINT8, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(selRoomTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_seltemp), 5, 30);
register_device_value(tag, &room->mode_, DeviceValueType::ENUM, FL_(enum_mode8), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode)); register_device_value(tag, &room->mode_, DeviceValueType::ENUM, FL_(enum_mode2), FL_(mode), DeviceValueUOM::NONE, MAKE_CF_CB(set_mode));
register_device_value(tag, &room->name_, DeviceValueType::STRING, FL_(name), DeviceValueUOM::NONE, MAKE_CF_CB(set_name)); register_device_value(tag, &room->name_, DeviceValueType::STRING, FL_(name), DeviceValueUOM::NONE, MAKE_CF_CB(set_name));
register_device_value(tag, &room->childlock_, DeviceValueType::BOOL, FL_(childlock), DeviceValueUOM::NONE, MAKE_CF_CB(set_childlock)); register_device_value(tag, &room->childlock_, DeviceValueType::BOOL, FL_(childlock), DeviceValueUOM::NONE, MAKE_CF_CB(set_childlock));
register_device_value(tag, &room->icon_, DeviceValueType::ENUM, FL_(enum_icons), FL_(icon), DeviceValueUOM::NONE, MAKE_CF_CB(set_icon)); register_device_value(tag, &room->icon_, DeviceValueType::ENUM, FL_(enum_icons), FL_(icon), DeviceValueUOM::NONE, MAKE_CF_CB(set_icon));
@@ -145,7 +145,8 @@ void Connect::process_roomThermostatName(std::shared_ptr<const Telegram> telegra
has_update(telegram, rc->icon_, 0); has_update(telegram, rc->icon_, 0);
for (uint8_t i = telegram->offset; i < telegram->message_length + telegram->offset && i < 100; i++) { for (uint8_t i = telegram->offset; i < telegram->message_length + telegram->offset && i < 100; i++) {
if ((i > 1) && (i % 2) == 0) { if ((i > 1) && (i % 2) == 0) {
rc->name_[(i - 2) / 2] = telegram->message_data[i - telegram->offset]; // replace ISOLatin1 characters with questionmark
rc->name_[(i - 2) / 2] = telegram->message_data[i - telegram->offset] & 0x80 ? '?' : telegram->message_data[i - telegram->offset];
} }
} }
rc->name_[50] = '\0'; // make sure name is terminated rc->name_[50] = '\0'; // make sure name is terminated
@@ -158,8 +159,8 @@ void Connect::process_roomThermostatSettings(std::shared_ptr<const Telegram> tel
if (rc == nullptr) { if (rc == nullptr) {
return; return;
} }
// has_enumupdate(telegram, rc->mode_, 0, {3, 1, 0}); // modes off, manual auto has_enumupdate(telegram, rc->mode_, 0, {3, 1, 0}); // modes off, manual auto
has_update(telegram, rc->mode_, 0); // has_update(telegram, rc->mode_, 0); // modes: auto, heat, cool, off
// has_update(telegram, rc->tempautotemp_, 1); // FF means off // has_update(telegram, rc->tempautotemp_, 1); // FF means off
// has_update(telegram, rc->manualtemp_, 3); // has_update(telegram, rc->manualtemp_, 3);
has_update(telegram, rc->childlock_, 7); has_update(telegram, rc->childlock_, 7);
@@ -183,9 +184,14 @@ void Connect::process_roomThermostatData(std::shared_ptr<const Telegram> telegra
// schedule for all thermostats // schedule for all thermostats
void Connect::process_roomSchedule(std::shared_ptr<const Telegram> telegram) { void Connect::process_roomSchedule(std::shared_ptr<const Telegram> telegram) {
toggle_fetch(telegram->type_id, false); // fetch only once uint8_t length = ((telegram->offset + telegram->message_length) > 126) ? 126 - telegram->offset : telegram->message_length;
auto length = ((telegram->offset + telegram->message_length) > 126) ? 126 - telegram->offset : telegram->message_length;
memcpy(&schedule_[telegram->offset], telegram->message_data, length); memcpy(&schedule_[telegram->offset], telegram->message_data, length);
for (uint8_t c : schedule_) {
if (c == 0xFE) {
return;
}
}
toggle_fetch(telegram->type_id, false); // fetch only once if all is initialized
} }
// Settings: // Settings:
@@ -196,8 +202,8 @@ bool Connect::set_mode(const char * value, const int8_t id) {
return false; return false;
} }
uint8_t v; uint8_t v;
// if (Helpers::value2enum(value, v, FL_(enum_mode2), {3, 1, 0})) { if (Helpers::value2enum(value, v, FL_(enum_mode2), {3, 1, 0})) {
if (Helpers::value2enum(value, v, FL_(enum_mode8))) { // if (Helpers::value2enum(value, v, FL_(enum_mode8))) {
write_command(0xBB5 + rc->room(), 0, v); // no validate, mode change is broadcasted write_command(0xBB5 + rc->room(), 0, v); // no validate, mode change is broadcasted
return true; return true;
} }
@@ -228,6 +234,9 @@ bool Connect::set_name(const char * value, const int8_t id) {
for (uint8_t i = 0; i < strlen(value) + 1; i++) { // include terminating '\0' for (uint8_t i = 0; i < strlen(value) + 1; i++) { // include terminating '\0'
data[2 * i] = 0; data[2 * i] = 0;
data[2 * i + 1] = value[i]; data[2 * i + 1] = value[i];
if (value[i] & 0x80) { // accept only ascii names
return false;
}
} }
uint8_t ofs = 0; uint8_t ofs = 0;
while (len > 0) { while (len > 0) {

View File

@@ -73,7 +73,7 @@ class Connect : public EMSdevice {
void process_OutdoorTemp(std::shared_ptr<const Telegram> telegram); void process_OutdoorTemp(std::shared_ptr<const Telegram> telegram);
void process_RCTime(std::shared_ptr<const Telegram> telegram); void process_RCTime(std::shared_ptr<const Telegram> telegram);
int16_t outdoorTemp_; int16_t outdoorTemp_;
char dateTime_[30]; // date and time stamp char dateTime_[25]; // date and time stamp
uint8_t schedule_[126]; // telegram copy uint8_t schedule_[126]; // telegram copy
}; };

View File

@@ -1070,7 +1070,7 @@ void Thermostat::process_JunkersWW(std::shared_ptr<const Telegram> telegram) {
// 0x11E // 0x11E
void Thermostat::process_JunkersDisp(std::shared_ptr<const Telegram> telegram) { void Thermostat::process_JunkersDisp(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, ibaMainDisplay_, 1); has_enumupdate(telegram, ibaMainDisplay_, 1, 1);
has_update(telegram, ibaLanguage_, 3); has_update(telegram, ibaLanguage_, 3);
} }
@@ -2029,7 +2029,7 @@ bool Thermostat::set_display(const char * value, const int8_t id) {
uint8_t ds; uint8_t ds;
if (model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) { if (model() == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
if (Helpers::value2enum(value, ds, FL_(enum_ibaMainDisplayJ))) { if (Helpers::value2enum(value, ds, FL_(enum_ibaMainDisplayJ))) {
write_command(0x11E, 1, ds, 0x11E); write_command(0x11E, 1, ds + 1, 0x11E);
return true; return true;
} }
} else { } else {

View File

@@ -318,7 +318,7 @@ const char * run_console_command(const char * command) {
} }
void console_test1() { void console_test1() {
auto expected_response = "Log level: DEBUG"; auto expected_response = "Log level: DEBUG\n";
TEST_ASSERT_EQUAL_STRING(expected_response, run_console_command("log")); TEST_ASSERT_EQUAL_STRING(expected_response, run_console_command("log"));
} }
@@ -329,7 +329,7 @@ void console_test2() {
void console_test3() { void console_test3() {
// test bad command // test bad command
auto expected_response = "Bad syntax. Check arguments."; auto expected_response = "Bad syntax. Check arguments.\n";
TEST_ASSERT_EQUAL_STRING(expected_response, run_console_command("call thermostat mode bad")); TEST_ASSERT_EQUAL_STRING(expected_response, run_console_command("call thermostat mode bad"));
} }

View File

@@ -176,8 +176,8 @@ void test_21() {
"\"maxWebLogBuffer\":25,\"modbusEnabled\":false,\"forceHeatingOff\":false,\"developerMode\":false},\"devices\":[{\"type\":\"boiler\",\"name\":\"My " "\"maxWebLogBuffer\":25,\"modbusEnabled\":false,\"forceHeatingOff\":false,\"developerMode\":false},\"devices\":[{\"type\":\"boiler\",\"name\":\"My "
"Custom " "Custom "
"Boiler\",\"deviceID\":\"0x08\",\"productID\":123,\"brand\":\"\",\"version\":\"01.00\",\"entities\":38,\"handlersReceived\":\"0x18\"," "Boiler\",\"deviceID\":\"0x08\",\"productID\":123,\"brand\":\"\",\"version\":\"01.00\",\"entities\":38,\"handlersReceived\":\"0x18\","
"\"handlersFetched\":\"0x14 0x33\",\"handlersPending\":\"0xBF 0x10 0x11 0xC2 0xC6 0x15 0x1C 0x19 0x1A 0x35 0x34 0x2A 0xD1 0xE3 0xE4 0xE5 0xE9 0x2E " "\"handlersFetched\":\"0x14 0x33\",\"handlersPending\":\"0xBF 0x10 0x11 0xC2 0xC6 0x15 0x1C 0x19 0x1A 0x35 0x34 0x2A 0xD1 0xE3 0xE4 0xE5 0xE9 0x02E0 "
"0x3B\"},{\"type\":\"thermostat\",\"name\":\"FW120\",\"deviceID\":\"0x10\",\"productID\":192,\"brand\":\"\",\"version\":\"01.00\",\"entities\":15," "0x2E 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\":4},{\"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}]}]";
@@ -202,8 +202,8 @@ void test_22() {
"\"maxWebLogBuffer\":25,\"modbusEnabled\":false,\"forceHeatingOff\":false,\"developerMode\":false},\"devices\":[{\"type\":\"boiler\",\"name\":\"My " "\"maxWebLogBuffer\":25,\"modbusEnabled\":false,\"forceHeatingOff\":false,\"developerMode\":false},\"devices\":[{\"type\":\"boiler\",\"name\":\"My "
"Custom " "Custom "
"Boiler\",\"deviceID\":\"0x08\",\"productID\":123,\"brand\":\"\",\"version\":\"01.00\",\"entities\":38,\"handlersReceived\":\"0x18\"," "Boiler\",\"deviceID\":\"0x08\",\"productID\":123,\"brand\":\"\",\"version\":\"01.00\",\"entities\":38,\"handlersReceived\":\"0x18\","
"\"handlersFetched\":\"0x14 0x33\",\"handlersPending\":\"0xBF 0x10 0x11 0xC2 0xC6 0x15 0x1C 0x19 0x1A 0x35 0x34 0x2A 0xD1 0xE3 0xE4 0xE5 0xE9 0x2E " "\"handlersFetched\":\"0x14 0x33\",\"handlersPending\":\"0xBF 0x10 0x11 0xC2 0xC6 0x15 0x1C 0x19 0x1A 0x35 0x34 0x2A 0xD1 0xE3 0xE4 0xE5 0xE9 0x02E0 "
"0x3B\"},{\"type\":\"thermostat\",\"name\":\"FW120\",\"deviceID\":\"0x10\",\"productID\":192,\"brand\":\"\",\"version\":\"01.00\",\"entities\":15," "0x2E 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\":4},{\"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}]}]";