mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
add test for #541
This commit is contained in:
@@ -692,6 +692,25 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
EMSESP::mqtt_.incoming("ems-esp/boiler/wwseltemp", "59");
|
||||
}
|
||||
|
||||
// https://github.com/emsesp/EMS-ESP32/issues/541
|
||||
if (command == "api_wwmode") {
|
||||
shell.printfln(F("Testing API wwmode"));
|
||||
Mqtt::ha_enabled(false);
|
||||
Mqtt::nested_format(1);
|
||||
run_test("310");
|
||||
|
||||
AsyncWebServerRequest request;
|
||||
request.method(HTTP_POST);
|
||||
DynamicJsonDocument doc(2000);
|
||||
JsonVariant json;
|
||||
|
||||
char data[] = "{\"value\":\"off\"}";
|
||||
deserializeJson(doc, data);
|
||||
json = doc.as<JsonVariant>();
|
||||
request.url("/api/thermostat/wwmode");
|
||||
EMSESP::webAPIService.webAPIService_post(&request, json);
|
||||
}
|
||||
|
||||
if (command == "api") {
|
||||
shell.printfln(F("Testing API with MQTT and REST, standalone"));
|
||||
|
||||
|
||||
@@ -48,8 +48,9 @@ namespace emsesp {
|
||||
// #define EMSESP_DEBUG_DEFAULT "2thermostats"
|
||||
// #define EMSESP_DEBUG_DEFAULT "dallas"
|
||||
// #define EMSESP_DEBUG_DEFAULT "analog"
|
||||
#define EMSESP_DEBUG_DEFAULT "api_values"
|
||||
// #define EMSESP_DEBUG_DEFAULT "api_values"
|
||||
// #define EMSESP_DEBUG_DEFAULT "mqtt_post"
|
||||
#define EMSESP_DEBUG_DEFAULT "api_wwmode"
|
||||
|
||||
class Test {
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user