Skip to content

Commit 8f12438

Browse files
committed
more tests
1 parent b931e28 commit 8f12438

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/test/test.cpp

+15
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,15 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
364364
return;
365365
}
366366

367+
if (command == "board_profile") {
368+
shell.printfln(F("Testing board profile..."));
369+
370+
shell.invoke_command("system");
371+
shell.invoke_command("set board_profile wemos");
372+
shell.invoke_command("exit");
373+
shell.invoke_command("call system settings");
374+
}
375+
367376
if (command == "boiler") {
368377
shell.printfln(F("Testing boiler..."));
369378
Mqtt::ha_enabled(false);
@@ -375,11 +384,17 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
375384
shell.invoke_command("call boiler info");
376385
shell.invoke_command("call system publish");
377386

387+
// test all permutations
378388
EMSESP::mqtt_.incoming("ems-esp/boiler/wwonetime", "1");
379389
EMSESP::mqtt_.incoming("ems-esp/boiler/wwonetime", "0");
390+
EMSESP::mqtt_.incoming("ems-esp/boiler/wwonetime", "on");
380391
EMSESP::mqtt_.incoming("ems-esp/boiler/heatingtemp", "24");
381392
EMSESP::mqtt_.incoming("ems-esp/boiler/wwonetime", "test"); // should fail
382393
EMSESP::mqtt_.incoming("ems-esp/boiler", "{\"cmd\":\"flowtemp\",\"id\":0,\"data\":22}");
394+
EMSESP::mqtt_.incoming("ems-esp/boiler", "{\"cmd\":\"wwonetime\",\"id\":0,\"data\":1}");
395+
EMSESP::mqtt_.incoming("ems-esp/boiler", "{\"cmd\":\"wwonetime\",\"id\":0,\"data\":\"off\"}");
396+
EMSESP::mqtt_.incoming("ems-esp/boiler", "{\"cmd\":\"wwonetime\",\"hc\":1,\"data\":\"on\"}");
397+
EMSESP::mqtt_.incoming("ems-esp/boiler", "{\"cmd\":\"wwonetime\",\"data\":\"on\",\"hc\":1}");
383398

384399
shell.invoke_command("show mqtt");
385400
}

src/test/test.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ namespace emsesp {
3030
// #define EMSESP_TEST_DEFAULT "mixer"
3131
// #define EMSESP_TEST_DEFAULT "web"
3232
// #define EMSESP_TEST_DEFAULT "general"
33-
#define EMSESP_TEST_DEFAULT "boiler"
33+
// #define EMSESP_TEST_DEFAULT "boiler"
3434
// #define EMSESP_TEST_DEFAULT "mqtt2"
3535
// #define EMSESP_TEST_DEFAULT "mqtt_nested"
3636
// #define EMSESP_TEST_DEFAULT "ha"
37+
#define EMSESP_TEST_DEFAULT "board_profile"
3738

3839
class Test {
3940
public:

0 commit comments

Comments
 (0)