mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
update test for different mqtt base paths
This commit is contained in:
@@ -484,12 +484,6 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
|
|||||||
run_test("thermostat");
|
run_test("thermostat");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
AsyncWebServerRequest request2;
|
|
||||||
request2.method(HTTP_GET);
|
|
||||||
request2.url("/system/sensors"); // check if defaults to info
|
|
||||||
EMSESP::webAPIService.webAPIService_get(&request2);
|
|
||||||
|
|
||||||
EMSESP::mqtt_.incoming("ems-esp/thermostat/mode"); // empty payload, sends reponse
|
EMSESP::mqtt_.incoming("ems-esp/thermostat/mode"); // empty payload, sends reponse
|
||||||
EMSESP::mqtt_.incoming("ems-esp/boiler/syspress"); // empty payload, sends reponse
|
EMSESP::mqtt_.incoming("ems-esp/boiler/syspress"); // empty payload, sends reponse
|
||||||
EMSESP::mqtt_.incoming("ems-esp/thermostat/mode", "auto"); // set mode
|
EMSESP::mqtt_.incoming("ems-esp/thermostat/mode", "auto"); // set mode
|
||||||
@@ -498,7 +492,10 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
|
|||||||
EMSESP::mqtt_.incoming("ems-esp/system/publish");
|
EMSESP::mqtt_.incoming("ems-esp/system/publish");
|
||||||
EMSESP::mqtt_.incoming("ems-esp/thermostat/seltemp"); // empty payload, sends reponse
|
EMSESP::mqtt_.incoming("ems-esp/thermostat/seltemp"); // empty payload, sends reponse
|
||||||
EMSESP::mqtt_.incoming("ems-esp/system/send", "11 12 13");
|
EMSESP::mqtt_.incoming("ems-esp/system/send", "11 12 13");
|
||||||
|
return;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
AsyncWebServerRequest request2;
|
AsyncWebServerRequest request2;
|
||||||
request2.method(HTTP_GET);
|
request2.method(HTTP_GET);
|
||||||
request2.url("/api/thermostat"); // check if defaults to info
|
request2.url("/api/thermostat"); // check if defaults to info
|
||||||
@@ -509,14 +506,20 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
|
|||||||
EMSESP::webAPIService.webAPIService_get(&request2);
|
EMSESP::webAPIService.webAPIService_get(&request2);
|
||||||
request2.url("/api/thermostat/mode");
|
request2.url("/api/thermostat/mode");
|
||||||
EMSESP::webAPIService.webAPIService_get(&request2);
|
EMSESP::webAPIService.webAPIService_get(&request2);
|
||||||
|
return;
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
AsyncWebServerRequest request2;
|
||||||
request2.method(HTTP_POST);
|
request2.method(HTTP_POST);
|
||||||
DynamicJsonDocument docX(2000);
|
DynamicJsonDocument docX(2000);
|
||||||
JsonVariant jsonX;
|
JsonVariant jsonX;
|
||||||
char dataX[] = "{\"value\":\"0B 88 19 19 02\"}";
|
// char dataX[] = "{\"value\":\"0B 88 19 19 02\"}";
|
||||||
|
char dataX[] = "{\"name\":\"temp\",\"value\":11}";
|
||||||
deserializeJson(docX, dataX);
|
deserializeJson(docX, dataX);
|
||||||
jsonX = docX.as<JsonVariant>();
|
jsonX = docX.as<JsonVariant>();
|
||||||
request2.url("/api/system/send");
|
// request2.url("/api/system/send");
|
||||||
|
request2.url("/api/thermostat");
|
||||||
EMSESP::webAPIService.webAPIService_post(&request2, jsonX);
|
EMSESP::webAPIService.webAPIService_post(&request2, jsonX);
|
||||||
return;
|
return;
|
||||||
*/
|
*/
|
||||||
@@ -564,6 +567,11 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) {
|
|||||||
EMSESP::mqtt_.incoming("ems-esp/thermostate/mode", "auto"); // unknown device
|
EMSESP::mqtt_.incoming("ems-esp/thermostate/mode", "auto"); // unknown device
|
||||||
EMSESP::mqtt_.incoming("ems-esp/thermostat/modee", "auto"); // unknown command
|
EMSESP::mqtt_.incoming("ems-esp/thermostat/modee", "auto"); // unknown command
|
||||||
|
|
||||||
|
// check long base
|
||||||
|
Mqtt::base("home/cellar/heating");
|
||||||
|
EMSESP::mqtt_.incoming("home/cellar/heating/thermostat/mode"); // empty payload, sends reponse
|
||||||
|
|
||||||
|
|
||||||
#if defined(EMSESP_STANDALONE)
|
#if defined(EMSESP_STANDALONE)
|
||||||
// Web API TESTS
|
// Web API TESTS
|
||||||
AsyncWebServerRequest request;
|
AsyncWebServerRequest request;
|
||||||
|
|||||||
Reference in New Issue
Block a user