From b3472c3919ce52f889b37554edf97c8e8164e2f4 Mon Sep 17 00:00:00 2001 From: proddy Date: Wed, 20 Oct 2021 09:21:12 +0200 Subject: [PATCH] add test for 'send' command --- src/test/test.cpp | 9 ++++++++- src/test/test.h | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/test/test.cpp b/src/test/test.cpp index efd651587..89d5ccdfc 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -473,7 +473,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) { if (command == "mqtt_individual") { shell.printfln(F("Testing individual MQTT")); - Mqtt::ha_enabled(false); // turn off HA Discovery to stop the chatter + Mqtt::ha_enabled(false); // turn off HA Discovery to stop the chatter Mqtt::subscribe_format(1); // individual topics run_test("boiler"); @@ -1030,6 +1030,13 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd) { request.url("/api"); EMSESP::webAPIService.webAPIService_post(&request, json); + // 4 - system call + char data4[] = "{\"value\":\"0B 88 19 19 02\"}"; + deserializeJson(doc, data4); + json = doc.as(); + request.url("/api/system/send"); + EMSESP::webAPIService.webAPIService_post(&request, json); + #endif } diff --git a/src/test/test.h b/src/test/test.h index c776c21b2..6e3422e53 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -39,9 +39,9 @@ namespace emsesp { // #define EMSESP_DEBUG_DEFAULT "shower_alert" // #define EMSESP_DEBUG_DEFAULT "310" // #define EMSESP_DEBUG_DEFAULT "render" -// #define EMSESP_DEBUG_DEFAULT "api" +#define EMSESP_DEBUG_DEFAULT "api" // #define EMSESP_DEBUG_DEFAULT "crash" -#define EMSESP_DEBUG_DEFAULT "mqtt_individual" +// #define EMSESP_DEBUG_DEFAULT "mqtt_individual" class Test { public: