From cde3b7541f6397157c67b128f200422dd24bbf2b Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 15 Nov 2021 14:24:21 +0100 Subject: [PATCH] update test for 196 --- src/test/test.cpp | 30 +++++++++++++++++++++++++++++- src/test/test.h | 4 +++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/src/test/test.cpp b/src/test/test.cpp index fda1ada31..9ee938159 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -471,10 +471,38 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) { shell.invoke_command("call boiler entities"); } + if (command == "dv") { + shell.printfln(F("Testing device value rendering")); + + Mqtt::ha_enabled(true); + // Mqtt::ha_enabled(false); + + Mqtt::nested_format(1); + Mqtt::send_response(false); + + run_test("boiler"); + run_test("thermostat"); + + // shell.invoke_command("show"); + + // change a value to null/bogus/dormant + // homeassistant/sensor/ems-esp/boiler_wwseltemp/config + shell.invoke_command("call boiler wwseltemp"); + shell.invoke_command("call system publish"); + + // Boiler -> Me, UBAParameterWW(0x33) + // wwseltemp = goes from 52 degrees (0x34) to void (0xFF) + uart_telegram({0x08, 0x0B, 0x33, 0x00, 0x08, 0xFF, 0xFF, 0xFB, 0x00, 0x28, 0x00, 0x00, 0x46, 0x00, 0xFF, 0xFF, 0x00}); + + shell.invoke_command("call boiler wwseltemp"); + shell.invoke_command("call system publish"); + + // shell.invoke_command("show mqtt"); + } + if (command == "api") { shell.printfln(F("Testing API with MQTT and REST, standalone")); - Mqtt::ha_enabled(true); // Mqtt::ha_enabled(false); diff --git a/src/test/test.h b/src/test/test.h index d9ca69ca7..ba62d7215 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -39,8 +39,10 @@ namespace emsesp { // #define EMSESP_DEBUG_DEFAULT "shower_alert" // #define EMSESP_DEBUG_DEFAULT "310" // #define EMSESP_DEBUG_DEFAULT "render" -#define EMSESP_DEBUG_DEFAULT "api" +// #define EMSESP_DEBUG_DEFAULT "api" // #define EMSESP_DEBUG_DEFAULT "crash" +#define EMSESP_DEBUG_DEFAULT "dv" + class Test { public: