mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
add Dashboard test in api3
This commit is contained in:
@@ -973,48 +973,56 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
|||||||
if (single) {
|
if (single) {
|
||||||
// run dedicated tests only
|
// run dedicated tests only
|
||||||
|
|
||||||
// EMSESP::webCustomEntityService.test(); // custom entities
|
EMSESP::webCustomEntityService.test(); // custom entities
|
||||||
// EMSESP::webCustomizationService.test(); // set customizations - this will overwrite any settings in the FS
|
EMSESP::webCustomizationService.test(); // set customizations - this will overwrite any settings in the FS
|
||||||
// EMSESP::temperaturesensor_.test(); // add temperature sensors
|
EMSESP::temperaturesensor_.test(); // add temperature sensors
|
||||||
|
|
||||||
// EMSESP::webSchedulerService.test(); // run scheduler tests, and conditions
|
// EMSESP::webSchedulerService.test(); // run scheduler tests, and conditions
|
||||||
|
|
||||||
|
// request.url("/rest/deviceEntities");
|
||||||
|
// EMSESP::webCustomizationService.device_entities(&request);
|
||||||
|
|
||||||
|
request.url("/rest/dashboardData");
|
||||||
|
EMSESP::webDataService.dashboard_data(&request);
|
||||||
|
|
||||||
|
// COMMANDS
|
||||||
// shell.invoke_command("call system fetch");
|
// shell.invoke_command("call system fetch");
|
||||||
// request.url("/api/system/fetch");
|
// request.url("/api/system/fetch");
|
||||||
// EMSESP::webAPIService.webAPIService(&request);
|
// EMSESP::webAPIService.webAPIService(&request);
|
||||||
|
|
||||||
// request.url("/api/system/restart");
|
// request.url("/api/system/restart");
|
||||||
// EMSESP::webAPIService.webAPIService(&request);
|
// EMSESP::webAPIService.webAPIService(&request);
|
||||||
|
|
||||||
// request.url("/api/system/format");
|
// request.url("/api/system/format");
|
||||||
// EMSESP::webAPIService.webAPIService(&request);
|
// EMSESP::webAPIService.webAPIService(&request);
|
||||||
|
|
||||||
request.method(HTTP_POST);
|
|
||||||
|
|
||||||
char data1[] = "{\"device\":\"system\", \"cmd\":\"restart\",\"id\":-1}";
|
|
||||||
deserializeJson(doc, data1);
|
|
||||||
request.url("/api");
|
|
||||||
EMSESP::webAPIService.webAPIService(&request, doc.as<JsonVariant>());
|
|
||||||
|
|
||||||
char data2[] = "{\"action\":\"customSupport\", \"param\":\"hello\"}";
|
|
||||||
deserializeJson(doc, data2);
|
|
||||||
request.url("/rest/action");
|
|
||||||
EMSESP::webStatusService.action(&request, doc.as<JsonVariant>());
|
|
||||||
|
|
||||||
char data3[] = "{\"action\":\"export\", \"param\":\"schedule\"}";
|
|
||||||
deserializeJson(doc, data3);
|
|
||||||
request.url("/rest/action");
|
|
||||||
EMSESP::webStatusService.action(&request, doc.as<JsonVariant>());
|
|
||||||
|
|
||||||
char data4[] = "{\"action\":\"export\", \"param\":\"allvalues\"}";
|
|
||||||
deserializeJson(doc, data4);
|
|
||||||
request.url("/rest/action");
|
|
||||||
EMSESP::webStatusService.action(&request, doc.as<JsonVariant>());
|
|
||||||
|
|
||||||
// request.url("/api/thermostat");
|
// request.url("/api/thermostat");
|
||||||
// EMSESP::webAPIService.webAPIService(&request);
|
// EMSESP::webAPIService.webAPIService(&request);
|
||||||
// request.url("/api/thermostat/hc1");
|
// request.url("/api/thermostat/hc1");
|
||||||
// EMSESP::webAPIService.webAPIService(&request);
|
// EMSESP::webAPIService.webAPIService(&request);
|
||||||
|
|
||||||
|
// POST COMMANDS
|
||||||
|
// request.method(HTTP_POST);
|
||||||
|
|
||||||
|
// char data1[] = "{\"device\":\"system\", \"cmd\":\"restart\",\"id\":-1}";
|
||||||
|
// deserializeJson(doc, data1);
|
||||||
|
// request.url("/api");
|
||||||
|
// EMSESP::webAPIService.webAPIService(&request, doc.as<JsonVariant>());
|
||||||
|
|
||||||
|
// char data2[] = "{\"action\":\"customSupport\", \"param\":\"hello\"}";
|
||||||
|
// deserializeJson(doc, data2);
|
||||||
|
// request.url("/rest/action");
|
||||||
|
// EMSESP::webStatusService.action(&request, doc.as<JsonVariant>());
|
||||||
|
|
||||||
|
// char data3[] = "{\"action\":\"export\", \"param\":\"schedule\"}";
|
||||||
|
// deserializeJson(doc, data3);
|
||||||
|
// request.url("/rest/action");
|
||||||
|
// EMSESP::webStatusService.action(&request, doc.as<JsonVariant>());
|
||||||
|
|
||||||
|
// char data4[] = "{\"action\":\"export\", \"param\":\"allvalues\"}";
|
||||||
|
// deserializeJson(doc, data4);
|
||||||
|
// request.url("/rest/action");
|
||||||
|
// EMSESP::webStatusService.action(&request, doc.as<JsonVariant>());
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
EMSESP::webCustomEntityService.test(); // custom entities
|
EMSESP::webCustomEntityService.test(); // custom entities
|
||||||
EMSESP::webCustomizationService.test(); // set customizations - this will overwrite any settings in the FS
|
EMSESP::webCustomizationService.test(); // set customizations - this will overwrite any settings in the FS
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ namespace emsesp {
|
|||||||
// #define EMSESP_DEBUG_DEFAULT "310"
|
// #define EMSESP_DEBUG_DEFAULT "310"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "render"
|
// #define EMSESP_DEBUG_DEFAULT "render"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "api"
|
// #define EMSESP_DEBUG_DEFAULT "api"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "api3"
|
#define EMSESP_DEBUG_DEFAULT "api3"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "crash"
|
// #define EMSESP_DEBUG_DEFAULT "crash"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "dv"
|
// #define EMSESP_DEBUG_DEFAULT "dv"
|
||||||
// #define EMSESP_DEBUG_DEFAULT "lastcode"
|
// #define EMSESP_DEBUG_DEFAULT "lastcode"
|
||||||
|
|||||||
Reference in New Issue
Block a user