mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
Call read commands from Web #2116
This commit is contained in:
@@ -973,16 +973,16 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
if (single) {
|
||||
// run dedicated tests only
|
||||
|
||||
EMSESP::webCustomEntityService.test(); // custom entities
|
||||
EMSESP::webCustomizationService.test(); // set customizations - this will overwrite any settings in the FS
|
||||
EMSESP::temperaturesensor_.test(); // add temperature sensors
|
||||
EMSESP::webSchedulerService.test(); // run scheduler tests, and conditions
|
||||
// EMSESP::webCustomEntityService.test(); // custom entities
|
||||
// EMSESP::webCustomizationService.test(); // set customizations - this will overwrite any settings in the FS
|
||||
// EMSESP::temperaturesensor_.test(); // add temperature sensors
|
||||
// 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);
|
||||
// request.url("/rest/dashboardData");
|
||||
// EMSESP::webDataService.dashboard_data(&request);
|
||||
|
||||
// COMMANDS
|
||||
// shell.invoke_command("call system fetch");
|
||||
@@ -999,7 +999,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
// EMSESP::webAPIService.webAPIService(&request);
|
||||
|
||||
// POST COMMANDS
|
||||
// request.method(HTTP_POST);
|
||||
request.method(HTTP_POST);
|
||||
|
||||
// char data1[] = "{\"device\":\"system\", \"cmd\":\"restart\",\"id\":-1}";
|
||||
// deserializeJson(doc, data1);
|
||||
@@ -1021,6 +1021,14 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
// request.url("/rest/action");
|
||||
// EMSESP::webStatusService.action(&request, doc.as<JsonVariant>());
|
||||
|
||||
char data6[] = "{\"device\":\"system\", \"cmd\":\"read\",\"value\":\"8 2 27 1\"}";
|
||||
deserializeJson(doc, data6);
|
||||
json = doc.as<JsonVariant>();
|
||||
request.url("/api");
|
||||
EMSESP::webAPIService.webAPIService(&request, json);
|
||||
|
||||
shell.invoke_command("call system read \"8 2 27 1\"");
|
||||
|
||||
|
||||
} else {
|
||||
EMSESP::webCustomEntityService.test(); // custom entities
|
||||
|
||||
Reference in New Issue
Block a user