Extending the test framework #611

This commit is contained in:
proddy
2020-11-16 14:13:35 +01:00
parent 1307a2e97b
commit 052ee91be5
4 changed files with 25 additions and 17 deletions

View File

@@ -476,9 +476,9 @@ void Console::load_standard_commands(unsigned int context) {
flash_string_vector{F_(name_optional)},
[](Shell & shell, const std::vector<std::string> & arguments) {
if (arguments.size() == 0) {
Test::run_test_shell(shell, "default");
Test::run_test(shell, "default");
} else {
Test::run_test_shell(shell, arguments.front());
Test::run_test(shell, arguments.front());
}
});
#endif

View File

@@ -99,6 +99,25 @@ bool Test::run_test(const char * command, int8_t id) {
return true;
}
if (strcmp(command, "mixer") == 0) {
EMSESP::logger().info(F("Testing mixer..."));
// add controller
add_device(0x09, 114);
add_device(0x28, 160); // MM100, WWC
add_device(0x29, 161); // MM200, WWC
add_device(0x20, 160); // MM100
// WWC1 on 0x29
uart_telegram({0xA9, 0x00, 0xFF, 0x00, 0x02, 0x32, 0x02, 0x6C, 0x00, 0x3C, 0x00, 0x3C, 0x3C, 0x46, 0x02, 0x03, 0x03, 0x00, 0x3C});
// WWC2 on 0x28
uart_telegram({0xA8, 0x00, 0xFF, 0x00, 0x02, 0x31, 0x02, 0x35, 0x00, 0x3C, 0x00, 0x3C, 0x3C, 0x46, 0x02, 0x03, 0x03, 0x00, 0x3C});
return true;
}
if (strcmp(command, "boiler") == 0) {
EMSESP::logger().info(F("Testing boiler..."));
add_device(0x08, 123); // Nefit Trendline
@@ -166,7 +185,7 @@ bool Test::run_test(const char * command, int8_t id) {
}
// used with the 'test' command, under su/admin
void Test::run_test_shell(uuid::console::Shell & shell, const std::string & command) {
void Test::run_test(uuid::console::Shell & shell, const std::string & command) {
// switch to su
shell.add_flags(CommandFlags::ADMIN);
@@ -831,18 +850,7 @@ void Test::run_test_shell(uuid::console::Shell & shell, const std::string & comm
EMSESP::rxservice_.ems_mask(EMSbus::EMS_MASK_BUDERUS);
// add controller
add_device(0x09, 114);
add_device(0x28, 160); // MM100, WWC
add_device(0x29, 161); // MM200, WWC
add_device(0x20, 160); // MM100
// WWC1 on 0x29
uart_telegram({0xA9, 0x00, 0xFF, 0x00, 0x02, 0x32, 0x02, 0x6C, 0x00, 0x3C, 0x00, 0x3C, 0x3C, 0x46, 0x02, 0x03, 0x03, 0x00, 0x3C});
// WWC2 on 0x28
uart_telegram({0xA8, 0x00, 0xFF, 0x00, 0x02, 0x31, 0x02, 0x35, 0x00, 0x3C, 0x00, 0x3C, 0x3C, 0x46, 0x02, 0x03, 0x03, 0x00, 0x3C});
run_test("mixer");
// check for error "No telegram type handler found for ID 0x255 (src 0x20)"
uart_telegram({0xA0, 0x00, 0xFF, 0x00, 0x01, 0x55, 0x00, 0x1A});

View File

@@ -40,7 +40,7 @@ namespace emsesp {
class Test {
public:
static void run_test_shell(uuid::console::Shell & shell, const std::string & command);
static void run_test(uuid::console::Shell & shell, const std::string & command);
static bool run_test(const char * command, int8_t id = 0);
static void dummy_mqtt_commands(const char * message);
static void rx_telegram(const std::vector<uint8_t> & data);

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "2.1.1b2"
#define EMSESP_APP_VERSION "2.1.1b3"