diff --git a/.github/workflows/pre_release.yml b/.github/workflows/pre_release.yml index 23b31c353..67f914652 100644 --- a/.github/workflows/pre_release.yml +++ b/.github/workflows/pre_release.yml @@ -36,6 +36,7 @@ jobs: yarn typesafe-i18n --no-watch sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts yarn build + yarn webUI - name: Build firmware run: | diff --git a/.github/workflows/tagged_release.yml b/.github/workflows/tagged_release.yml index 48039c5ed..edca1c8ae 100644 --- a/.github/workflows/tagged_release.yml +++ b/.github/workflows/tagged_release.yml @@ -31,6 +31,7 @@ jobs: yarn typesafe-i18n --no-watch sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts yarn build + yarn webUI - name: Build firmware run: | diff --git a/.github/workflows/test_release.yml b/.github/workflows/test_release.yml index 1ae127f97..69467540e 100644 --- a/.github/workflows/test_release.yml +++ b/.github/workflows/test_release.yml @@ -36,6 +36,7 @@ jobs: yarn typesafe-i18n --no-watch sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts yarn build + yarn webUI - name: Build firmware run: | diff --git a/interface/package.json b/interface/package.json index 1cd151834..d1cf7aa20 100644 --- a/interface/package.json +++ b/interface/package.json @@ -33,7 +33,6 @@ "@types/react-router-dom": "^5.3.3", "alova": "^2.13.1", "async-validator": "^4.2.5", - "dev": "^0.1.3", "history": "^5.3.0", "jwt-decode": "^3.1.2", "lodash-es": "^4.17.21", diff --git a/interface/yarn.lock b/interface/yarn.lock index 32a31e1a5..01024701b 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -1538,7 +1538,6 @@ __metadata: alova: "npm:^2.13.1" async-validator: "npm:^4.2.5" concurrently: "npm:^8.2.1" - dev: "npm:^0.1.3" eslint: "npm:^8.51.0" eslint-config-airbnb: "npm:^19.0.4" eslint-config-airbnb-typescript: "npm:^17.1.0" @@ -2001,15 +2000,6 @@ __metadata: languageName: node linkType: hard -"bindings@npm:^1.3.1": - version: 1.5.0 - resolution: "bindings@npm:1.5.0" - dependencies: - file-uri-to-path: "npm:1.0.0" - checksum: 593d5ae975ffba15fbbb4788fe5abd1e125afbab849ab967ab43691d27d6483751805d98cb92f7ac24a2439a8a8678cd0131c535d5d63de84e383b0ce2786133 - languageName: node - linkType: hard - "bl@npm:^1.0.0": version: 1.2.3 resolution: "bl@npm:1.2.3" @@ -2772,17 +2762,6 @@ __metadata: languageName: node linkType: hard -"dev@npm:^0.1.3": - version: 0.1.3 - resolution: "dev@npm:0.1.3" - dependencies: - inotify: "npm:>= 0.1.6" - bin: - node-dev: ./node-dev.sh - checksum: 48cdddfef366062db728cd2b57b9f2e56a83b1e3e1455a761e1bd4f883f0eaec96953b7296e67415d3002af0a33481c3aca23a1e7cda0fc5882d3809db792d5f - languageName: node - linkType: hard - "dir-glob@npm:^3.0.1": version: 3.0.1 resolution: "dir-glob@npm:3.0.1" @@ -4019,13 +3998,6 @@ __metadata: languageName: node linkType: hard -"file-uri-to-path@npm:1.0.0": - version: 1.0.0 - resolution: "file-uri-to-path@npm:1.0.0" - checksum: b648580bdd893a008c92c7ecc96c3ee57a5e7b6c4c18a9a09b44fb5d36d79146f8e442578bc0e173dc027adf3987e254ba1dfd6e3ec998b7c282873010502144 - languageName: node - linkType: hard - "filename-reserved-regex@npm:^2.0.0": version: 2.0.0 resolution: "filename-reserved-regex@npm:2.0.0" @@ -4911,18 +4883,6 @@ __metadata: languageName: node linkType: hard -"inotify@npm:>= 0.1.6": - version: 1.4.6 - resolution: "inotify@npm:1.4.6" - dependencies: - bindings: "npm:^1.3.1" - nan: "npm:^2.12.1" - node-gyp: "npm:latest" - checksum: 6453def0e3a921562c2a26ed6268028ab96f02c546578b6d25dfc95ef044eeb0f9f30c8e84a67c910c172fb2039a037964c1a06b9e7c3791519b2782541a8c37 - conditions: os=linux - languageName: node - linkType: hard - "internal-slot@npm:^1.0.5": version: 1.0.5 resolution: "internal-slot@npm:1.0.5" @@ -6025,15 +5985,6 @@ __metadata: languageName: node linkType: hard -"nan@npm:^2.12.1": - version: 2.18.0 - resolution: "nan@npm:2.18.0" - dependencies: - node-gyp: "npm:latest" - checksum: 5520e22c64e2b5b495b1d765d6334c989b848bbe1502fec89c5857cabcc7f9f0474563377259e7574bff1c8a041d3b90e9ffa1f5e15502ffddee7b2550cc26a0 - languageName: node - linkType: hard - "nanoid@npm:^3.3.6": version: 3.3.6 resolution: "nanoid@npm:3.3.6" diff --git a/src/emsesp.cpp b/src/emsesp.cpp index 94aff0b98..3e2a8982d 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -716,7 +716,6 @@ std::string EMSESP::pretty_telegram(std::shared_ptr telegram) { uint8_t offset = telegram->offset; // find name for src and dest by looking up known devices - std::string src_name(""); std::string dest_name(""); std::string type_name(""); diff --git a/src/telegram.h b/src/telegram.h index 60805ab2c..2cd0f49d7 100644 --- a/src/telegram.h +++ b/src/telegram.h @@ -113,7 +113,8 @@ class Telegram { return (val != value); } - // read a value from a telegram. We always store the value, regardless if its garbage + // read a value from a telegram if its not out of bounds. + // Then we update the value, regardless if its garbage template // assuming negative numbers are stored as 2's-complement // https://medium.com/@LeeJulija/how-integers-are-stored-in-memory-using-twos-complement-5ba04d61a56c @@ -124,7 +125,20 @@ class Telegram { uint8_t num_bytes = (!s) ? sizeof(Value) : s; // check for out of bounds, if so don't modify the value auto msg_size = (index - this->offset + num_bytes - 1); + // TODO remove + Serial.print(" index: "); + Serial.print(index); + Serial.print(" offset: "); + Serial.print(offset); + Serial.print(" index: "); + Serial.print(" message_length: "); + Serial.print(this->message_length); + Serial.print(" msg_size: "); + Serial.print(msg_size); + Serial.println(); + if ((index < this->offset) || (msg_size >= this->message_length) || (msg_size > EMS_MAX_TELEGRAM_MESSAGE_LENGTH)) { + Serial.println("Rejedcting!"); // TODO: remove return false; } diff --git a/src/test/test.cpp b/src/test/test.cpp index 3b932bc96..0ba654b85 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -74,6 +74,18 @@ bool Test::run_test(const char * command, int8_t id) { // #ifdef EMSESP_STANDALONE + if (strcmp(command, "heat_exchange") == 0) { + EMSESP::logger().info("Testing heating exchange..."); + + add_device(0x08, 219); // Greenstar HIU/Logamax kompakt WS170 + + // [emsesp] boiler(0x08) -W-> Me(0x0B), UBAMonitorFastPlus(0xE4), data: 00 01 35 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 80 00 (offset 6) + uart_telegram({0x08, 0x00, 0xE4, 0x00, // + 00, 01, 0x35, 00, 00, 00, 00, 00, 00, 00, 00, 0x80, 00, 00, 00, 00, 00, 00, 00, 0x80, 00}); + + return true; + } + if (strcmp(command, "2thermostats") == 0) { EMSESP::logger().info("Testing with multiple thermostats..."); @@ -493,16 +505,24 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const shell.printfln("Testing RC310..."); run_test("310"); shell.invoke_command("show devices"); - shell.invoke_command("show"); + shell.invoke_command("show values"); shell.invoke_command("call system publish"); shell.invoke_command("show mqtt"); ok = true; } + if (command == "heat_exchange") { + shell.printfln("Testing heat exchange..."); + run_test("heat_exchange"); + shell.invoke_command("show devices"); + shell.invoke_command("show values"); + ok = true; + } + if (command == "2thermostats") { shell.printfln("Testing multiple thermostats..."); run_test("2thermostats"); - shell.invoke_command("show"); + shell.invoke_command("show values"); shell.invoke_command("show devices"); ok = true; } @@ -571,7 +591,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const run_test("boiler"); shell.invoke_command("show devices"); - shell.invoke_command("show"); + shell.invoke_command("show values"); shell.invoke_command("call boiler info"); shell.invoke_command("call system publish"); @@ -610,7 +630,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // HC1 uart_telegram({0x90, 0x00, 0xFF, 0x00, 0x00, 0x6F, 0x01, 0x02, 0x00, 0xCF, 0x00, 0xE6}); - shell.invoke_command("show"); + shell.invoke_command("show values"); shell.invoke_command("show devices"); ok = true; } @@ -653,7 +673,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const uart_telegram( {0x08, 0x0B, 0xC2, 0, 0x08, 0xAC, 00, 0x10, 0x31, 0x48, 0x30, 0x31, 0x15, 0x80, 0x95, 0x0B, 0x0E, 0x10, 0x38, 00, 0x7F, 0xFF, 0xFF, 0xFF}); - // shell.invoke_command("show"); + // shell.invoke_command("show values"); ok = true; } @@ -686,12 +706,12 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // Mqtt::nested_format(0); emsesp::EMSESP::temperaturesensor_.test(); - shell.invoke_command("show"); + shell.invoke_command("show values"); shell.invoke_command("call system publish"); // rename EMSESP::temperaturesensor_.update("01-0203-0405-0607", "testtemperature", 2); - shell.invoke_command("show"); + shell.invoke_command("show values"); shell.invoke_command("call system publish"); ok = true; } @@ -704,14 +724,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // Mqtt::nested_format(0); emsesp::EMSESP::analogsensor_.test(); - shell.invoke_command("show"); + shell.invoke_command("show values"); // shell.invoke_command("call system publish"); // shell.invoke_command("show mqtt"); // rename // bool update(uint8_t id, const std::string & name, int16_t offset, float factor, uint8_t uom, uint8_t type); EMSESP::analogsensor_.update(36, "analogtest", 2, 0.7, 17, 1); - shell.invoke_command("show"); + shell.invoke_command("show values"); // shell.invoke_command("call system publish"); ok = true; } @@ -1174,7 +1194,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const shell.printfln("Testing adding a thermostat FW120..."); run_test("thermostat"); - shell.invoke_command("show"); + shell.invoke_command("show values"); shell.invoke_command("call system publish"); EMSESP::mqtt_.incoming("ems-esp/thermostat_hc1", "heat"); @@ -1243,7 +1263,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const uart_telegram("30 00 FF 0A 02 6A 03"); // SM100 pump off 0 - shell.invoke_command("show"); + shell.invoke_command("show values"); ok = true; } @@ -1676,7 +1696,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const // check for error "No telegram type handler found for ID 0x255 (src 0x20)" uart_telegram({0xA0, 0x00, 0xFF, 0x00, 0x01, 0x55, 0x00, 0x1A}); - shell.invoke_command("show"); + shell.invoke_command("show values"); shell.invoke_command("call mixer info"); shell.invoke_command("call system publish"); shell.invoke_command("show mqtt"); diff --git a/src/test/test.h b/src/test/test.h index beb9d02ee..c9ba676ca 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -26,7 +26,7 @@ namespace emsesp { -#define EMSESP_DEBUG_DEFAULT "general" +// #define EMSESP_DEBUG_DEFAULT "general" // #define EMSESP_DEBUG_DEFAULT "thermostat" // #define EMSESP_DEBUG_DEFAULT "solar" @@ -56,6 +56,8 @@ namespace emsesp { // #define EMSESP_DEBUG_DEFAULT "memory" // #define EMSESP_DEBUG_DEFAULT "coldshot" // #define EMSESP_DEBUG_DEFAULT "custom_entities" +#define EMSESP_DEBUG_DEFAULT "heat_exchange" + class Test { public: diff --git a/src/version.h b/src/version.h index 0c6f5999a..72d6c2ace 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.6.3-dev.2" +#define EMSESP_APP_VERSION "3.6.3-dev.3"