mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
add test for custom entities
This commit is contained in:
@@ -280,6 +280,21 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
|||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (command == "custom_entities") {
|
||||||
|
shell.printfln("custom entities...");
|
||||||
|
run_test("general");
|
||||||
|
|
||||||
|
#ifdef EMSESP_STANDALONE
|
||||||
|
AsyncWebServerRequest request;
|
||||||
|
request.method(HTTP_GET);
|
||||||
|
request.url("/api/custom");
|
||||||
|
request.url("/api/custom/boiler_flowtemp");
|
||||||
|
request.url("/api/custom/boiler_flowtemp2");
|
||||||
|
EMSESP::webAPIService.webAPIService_get(&request);
|
||||||
|
#endif
|
||||||
|
ok = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (command == "coldshot") {
|
if (command == "coldshot") {
|
||||||
shell.printfln("Testing coldshot...");
|
shell.printfln("Testing coldshot...");
|
||||||
run_test("general");
|
run_test("general");
|
||||||
@@ -734,7 +749,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
|||||||
|
|
||||||
if (emsdevice->unique_id() == 1) { // thermostat
|
if (emsdevice->unique_id() == 1) { // thermostat
|
||||||
std::string a = "00hc1/seltemp|new name>5<52";
|
std::string a = "00hc1/seltemp|new name>5<52";
|
||||||
emsdevice->setCustomEntity(a);
|
emsdevice->setCustomizationEntity(a);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -760,7 +775,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
|||||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||||
if (emsdevice->unique_id() == 1) { // boiler
|
if (emsdevice->unique_id() == 1) { // boiler
|
||||||
std::string a = "07wwseltemp";
|
std::string a = "07wwseltemp";
|
||||||
emsdevice->setCustomEntity(a);
|
emsdevice->setCustomizationEntity(a);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ namespace emsesp {
|
|||||||
// #define EMSESP_DEBUG_DEFAULT "custom"
|
// #define EMSESP_DEBUG_DEFAULT "custom"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "entity_dump"
|
// #define EMSESP_DEBUG_DEFAULT "entity_dump"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "memory"
|
// #define EMSESP_DEBUG_DEFAULT "memory"
|
||||||
#define EMSESP_DEBUG_DEFAULT "coldshot"
|
// #define EMSESP_DEBUG_DEFAULT "coldshot"
|
||||||
|
#define EMSESP_DEBUG_DEFAULT "custom_entities"
|
||||||
|
|
||||||
|
|
||||||
class Test {
|
class Test {
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user