diff --git a/src/test/test.cpp b/src/test/test.cpp index d3fe0bfb1..8ba43900a 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -921,6 +921,27 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const ok = true; } + if (command == "hpmode") { + shell.printfln("Testing MQTT with hpmode..."); + + Mqtt::ha_enabled(false); + Mqtt::enabled(true); + + Mqtt::entity_format(Mqtt::entityFormat::SINGLE_LONG); // SINGLE_LONG, SINGLE_SHORT, MULTI_SHORT + System::test_set_all_active(true); // include all entities and give them fake values + add_device(10, 158); + + // EMSESP::mqtt_.incoming("ems-esp/thermostat/hc1/hpmode", "cooling"); + EMSESP::mqtt_.incoming("ems-esp/thermostat/hc1/hpmode", "heating & cooling"); + + EMSESP::publish_all(true); + + Mqtt::resubscribe(); + Mqtt::show_mqtt(shell); // show queue + + ok = true; + } + if (command == "healthcheck") { // n=1 = EMSESP::system_.HEALTHCHECK_NO_BUS // n=2 = EMSESP::system_.HEALTHCHECK_NO_NETWORK diff --git a/src/test/test.h b/src/test/test.h index 92170f7cc..67fd370dc 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -56,11 +56,12 @@ namespace emsesp { // #define EMSESP_DEBUG_DEFAULT "telegram_dump" // #define EMSESP_DEBUG_DEFAULT "memory" // #define EMSESP_DEBUG_DEFAULT "coldshot" -#define EMSESP_DEBUG_DEFAULT "custom" +// #define EMSESP_DEBUG_DEFAULT "custom" // #define EMSESP_DEBUG_DEFAULT "scheduler" // #define EMSESP_DEBUG_DEFAULT "heat_exchange" // #define EMSESP_DEBUG_DEFAULT "ls" // #define EMSESP_DEBUG_DEFAULT "upload" +#define EMSESP_DEBUG_DEFAULT "hpmode" #ifndef EMSESP_DEBUG_DEFAULT #define EMSESP_DEBUG_DEFAULT "general"