Skip to content

Commit a17f8db

Browse files
committed
add missing 'yarn webUI'
1 parent 6783d5b commit a17f8db

File tree

7 files changed

+53
-15
lines changed

7 files changed

+53
-15
lines changed

.github/workflows/pre_release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
yarn typesafe-i18n --no-watch
3737
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
3838
yarn build
39+
yarn webUI
3940
4041
- name: Build firmware
4142
run: |

.github/workflows/tagged_release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
yarn typesafe-i18n --no-watch
3232
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
3333
yarn build
34+
yarn webUI
3435
3536
- name: Build firmware
3637
run: |

.github/workflows/test_release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
yarn typesafe-i18n --no-watch
3737
sed -i "s/= 'pl'/= 'en'/" ./src/i18n/i18n-util.ts
3838
yarn build
39+
yarn webUI
3940
4041
- name: Build firmware
4142
run: |

src/emsesp.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,6 @@ std::string EMSESP::pretty_telegram(std::shared_ptr<const Telegram> telegram) {
716716
uint8_t offset = telegram->offset;
717717

718718
// find name for src and dest by looking up known devices
719-
720719
std::string src_name("");
721720
std::string dest_name("");
722721
std::string type_name("");

src/telegram.h

+15-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ class Telegram {
113113
return (val != value);
114114
}
115115

116-
// read a value from a telegram. We always store the value, regardless if its garbage
116+
// read a value from a telegram if its not out of bounds.
117+
// Then we update the value, regardless if its garbage
117118
template <typename Value>
118119
// assuming negative numbers are stored as 2's-complement
119120
// https://medium.com/@LeeJulija/how-integers-are-stored-in-memory-using-twos-complement-5ba04d61a56c
@@ -124,7 +125,20 @@ class Telegram {
124125
uint8_t num_bytes = (!s) ? sizeof(Value) : s;
125126
// check for out of bounds, if so don't modify the value
126127
auto msg_size = (index - this->offset + num_bytes - 1);
128+
// TODO remove
129+
Serial.print(" index: ");
130+
Serial.print(index);
131+
Serial.print(" offset: ");
132+
Serial.print(offset);
133+
Serial.print(" index: ");
134+
Serial.print(" message_length: ");
135+
Serial.print(this->message_length);
136+
Serial.print(" msg_size: ");
137+
Serial.print(msg_size);
138+
Serial.println();
139+
127140
if ((index < this->offset) || (msg_size >= this->message_length) || (msg_size > EMS_MAX_TELEGRAM_MESSAGE_LENGTH)) {
141+
Serial.println("Rejedcting!"); // TODO: remove
128142
return false;
129143
}
130144

src/test/test.cpp

+32-12
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,18 @@ bool Test::run_test(const char * command, int8_t id) {
7474
//
7575
#ifdef EMSESP_STANDALONE
7676

77+
if (strcmp(command, "heat_exchange") == 0) {
78+
EMSESP::logger().info("Testing heating exchange...");
79+
80+
add_device(0x08, 219); // Greenstar HIU/Logamax kompakt WS170
81+
82+
// [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)
83+
uart_telegram({0x08, 0x00, 0xE4, 0x00, //
84+
00, 01, 0x35, 00, 00, 00, 00, 00, 00, 00, 00, 0x80, 00, 00, 00, 00, 00, 00, 00, 0x80, 00});
85+
86+
return true;
87+
}
88+
7789
if (strcmp(command, "2thermostats") == 0) {
7890
EMSESP::logger().info("Testing with multiple thermostats...");
7991

@@ -493,16 +505,24 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
493505
shell.printfln("Testing RC310...");
494506
run_test("310");
495507
shell.invoke_command("show devices");
496-
shell.invoke_command("show");
508+
shell.invoke_command("show values");
497509
shell.invoke_command("call system publish");
498510
shell.invoke_command("show mqtt");
499511
ok = true;
500512
}
501513

514+
if (command == "heat_exchange") {
515+
shell.printfln("Testing heat exchange...");
516+
run_test("heat_exchange");
517+
shell.invoke_command("show devices");
518+
shell.invoke_command("show values");
519+
ok = true;
520+
}
521+
502522
if (command == "2thermostats") {
503523
shell.printfln("Testing multiple thermostats...");
504524
run_test("2thermostats");
505-
shell.invoke_command("show");
525+
shell.invoke_command("show values");
506526
shell.invoke_command("show devices");
507527
ok = true;
508528
}
@@ -571,7 +591,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
571591

572592
run_test("boiler");
573593
shell.invoke_command("show devices");
574-
shell.invoke_command("show");
594+
shell.invoke_command("show values");
575595
shell.invoke_command("call boiler info");
576596
shell.invoke_command("call system publish");
577597

@@ -610,7 +630,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
610630
// HC1
611631
uart_telegram({0x90, 0x00, 0xFF, 0x00, 0x00, 0x6F, 0x01, 0x02, 0x00, 0xCF, 0x00, 0xE6});
612632

613-
shell.invoke_command("show");
633+
shell.invoke_command("show values");
614634
shell.invoke_command("show devices");
615635
ok = true;
616636
}
@@ -653,7 +673,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
653673
uart_telegram(
654674
{0x08, 0x0B, 0xC2, 0, 0x08, 0xAC, 00, 0x10, 0x31, 0x48, 0x30, 0x31, 0x15, 0x80, 0x95, 0x0B, 0x0E, 0x10, 0x38, 00, 0x7F, 0xFF, 0xFF, 0xFF});
655675

656-
// shell.invoke_command("show");
676+
// shell.invoke_command("show values");
657677

658678
ok = true;
659679
}
@@ -686,12 +706,12 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
686706
// Mqtt::nested_format(0);
687707

688708
emsesp::EMSESP::temperaturesensor_.test();
689-
shell.invoke_command("show");
709+
shell.invoke_command("show values");
690710
shell.invoke_command("call system publish");
691711

692712
// rename
693713
EMSESP::temperaturesensor_.update("01-0203-0405-0607", "testtemperature", 2);
694-
shell.invoke_command("show");
714+
shell.invoke_command("show values");
695715
shell.invoke_command("call system publish");
696716
ok = true;
697717
}
@@ -704,14 +724,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
704724
// Mqtt::nested_format(0);
705725

706726
emsesp::EMSESP::analogsensor_.test();
707-
shell.invoke_command("show");
727+
shell.invoke_command("show values");
708728
// shell.invoke_command("call system publish");
709729
// shell.invoke_command("show mqtt");
710730

711731
// rename
712732
// bool update(uint8_t id, const std::string & name, int16_t offset, float factor, uint8_t uom, uint8_t type);
713733
EMSESP::analogsensor_.update(36, "analogtest", 2, 0.7, 17, 1);
714-
shell.invoke_command("show");
734+
shell.invoke_command("show values");
715735
// shell.invoke_command("call system publish");
716736
ok = true;
717737
}
@@ -1174,7 +1194,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
11741194
shell.printfln("Testing adding a thermostat FW120...");
11751195

11761196
run_test("thermostat");
1177-
shell.invoke_command("show");
1197+
shell.invoke_command("show values");
11781198
shell.invoke_command("call system publish");
11791199

11801200
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
12431263

12441264
uart_telegram("30 00 FF 0A 02 6A 03"); // SM100 pump off 0
12451265

1246-
shell.invoke_command("show");
1266+
shell.invoke_command("show values");
12471267
ok = true;
12481268
}
12491269

@@ -1676,7 +1696,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
16761696
// check for error "No telegram type handler found for ID 0x255 (src 0x20)"
16771697
uart_telegram({0xA0, 0x00, 0xFF, 0x00, 0x01, 0x55, 0x00, 0x1A});
16781698

1679-
shell.invoke_command("show");
1699+
shell.invoke_command("show values");
16801700
shell.invoke_command("call mixer info");
16811701
shell.invoke_command("call system publish");
16821702
shell.invoke_command("show mqtt");

src/test/test.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
namespace emsesp {
2828

29-
#define EMSESP_DEBUG_DEFAULT "general"
29+
// #define EMSESP_DEBUG_DEFAULT "general"
3030

3131
// #define EMSESP_DEBUG_DEFAULT "thermostat"
3232
// #define EMSESP_DEBUG_DEFAULT "solar"
@@ -56,6 +56,8 @@ namespace emsesp {
5656
// #define EMSESP_DEBUG_DEFAULT "memory"
5757
// #define EMSESP_DEBUG_DEFAULT "coldshot"
5858
// #define EMSESP_DEBUG_DEFAULT "custom_entities"
59+
#define EMSESP_DEBUG_DEFAULT "heat_exchange"
60+
5961

6062
class Test {
6163
public:

0 commit comments

Comments
 (0)