From 5b62978d093089e99aba79405710556c08a9968c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Fri, 14 Sep 2018 16:09:12 +0200 Subject: [PATCH] Added config command that outputs the configuration in JSON --- code/espurna/settings.ino | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/code/espurna/settings.ino b/code/espurna/settings.ino index b62f83c9..31d70aa1 100644 --- a/code/espurna/settings.ino +++ b/code/espurna/settings.ino @@ -298,6 +298,16 @@ void _settingsInitCommands() { DEBUG_MSG_P(PSTR("+OK\n")); }); + settingsRegisterCommand(F("CONFIG"), [](Embedis* e) { + DynamicJsonBuffer jsonBuffer; + JsonObject& root = jsonBuffer.createObject(); + settingsGetJson(root); + String output; + root.printTo(output); + DEBUG_MSG(output.c_str()); + DEBUG_MSG_P(PSTR("\n+OK\n")); + }); + } // -----------------------------------------------------------------------------