From ecc045b2a81b7434316666a509ee992935e25567 Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 2 Oct 2022 15:51:54 +0200 Subject: [PATCH] add test for min/max --- src/test/test.cpp | 30 ++++++++++++++++++++++++++++++ src/test/test.h | 1 + 2 files changed, 31 insertions(+) diff --git a/src/test/test.cpp b/src/test/test.cpp index 21a41496f..be722d6df 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -601,6 +601,36 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const EMSESP::system_.healthcheck(n); } + if (command == "custom") { + shell.printfln(F("Testing custom entities")); + + Mqtt::ha_enabled(true); + Mqtt::send_response(false); + + run_test("thermostat"); + + // shell.invoke_command("call thermostat seltemp"); + // shell.invoke_command("call system publish"); + + // toggle mode + for (const auto & emsdevice : EMSESP::emsdevices) { + Serial.print("Custom: "); + Serial.print(emsdevice->device_type_name().c_str()); + Serial.print(" uniqueid="); + Serial.println(emsdevice->unique_id()); + + if (emsdevice->unique_id() == 1) { // thermostat + std::string a = "00hc1/seltemp|new name>5<52"; + emsdevice->setCustomEntity(a); + break; + } + } + + shell.invoke_command("call thermostat seltemp"); + shell.invoke_command("call system publish"); + } + + if (command == "masked") { shell.printfln("Testing masked entities"); diff --git a/src/test/test.h b/src/test/test.h index 29c4556a2..af16002f3 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -51,6 +51,7 @@ namespace emsesp { // #define EMSESP_DEBUG_DEFAULT "api_values" // #define EMSESP_DEBUG_DEFAULT "mqtt_post" // #define EMSESP_DEBUG_DEFAULT "api_wwmode" +// #define EMSESP_DEBUG_DEFAULT "custom" class Test { public: