From 0cde2918cf6fbd1846fa1c324f3421c680efe951 Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 16 Nov 2020 21:15:15 +0100 Subject: [PATCH] rename system info -> settings and report -> info --- interface/src/project/EMSESPHelp.tsx | 6 +++--- src/locale_EN.h | 3 +-- src/system.cpp | 15 ++++++++------- src/system.h | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/interface/src/project/EMSESPHelp.tsx b/interface/src/project/EMSESPHelp.tsx index 4e3fcebc7..5dbef581a 100644 --- a/interface/src/project/EMSESPHelp.tsx +++ b/interface/src/project/EMSESPHelp.tsx @@ -9,8 +9,8 @@ import StarIcon from "@material-ui/icons/Star"; import ImportExportIcon from "@material-ui/icons/ImportExport"; import BugReportIcon from "@material-ui/icons/BugReportTwoTone"; +export const WebAPISystemSettings = window.location.origin + "/api?device=system&cmd=settings"; export const WebAPISystemInfo = window.location.origin + "/api?device=system&cmd=info"; -export const WebAPISystemReport = window.location.origin + "/api?device=system&cmd=report"; class EMSESPHelp extends Component { @@ -52,7 +52,7 @@ class EMSESPHelp extends Component { - To export your system settings {'click here'} + To list your system settings {'click here'} @@ -62,7 +62,7 @@ class EMSESPHelp extends Component { - To create a report of the current EMS-ESP status (for troubleshooting) {'click here'} + To create a report of the current EMS-ESP status {'click here'} diff --git a/src/locale_EN.h b/src/locale_EN.h index 128809a94..e1ef6911d 100644 --- a/src/locale_EN.h +++ b/src/locale_EN.h @@ -19,7 +19,6 @@ // common words MAKE_PSTR_WORD(exit) MAKE_PSTR_WORD(help) -MAKE_PSTR_WORD(settings) MAKE_PSTR_WORD(log) MAKE_PSTR_WORD(logout) MAKE_PSTR_WORD(enabled) @@ -77,8 +76,8 @@ MAKE_PSTR_WORD(data) MAKE_PSTR_WORD(command) MAKE_PSTR_WORD(commands) MAKE_PSTR_WORD(info) -MAKE_PSTR_WORD(report) MAKE_PSTR_WORD(test) +MAKE_PSTR_WORD(settings) // devices MAKE_PSTR_WORD(boiler) diff --git a/src/system.cpp b/src/system.cpp index 0c0e54361..df907a2d0 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -200,7 +200,7 @@ void System::start() { Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F_(publish), System::command_publish); Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F_(fetch), System::command_fetch); Command::add_with_json(EMSdevice::DeviceType::SYSTEM, F_(info), System::command_info); - Command::add_with_json(EMSdevice::DeviceType::SYSTEM, F_(report), System::command_report); + Command::add_with_json(EMSdevice::DeviceType::SYSTEM, F_(settings), System::command_settings); #if defined(EMSESP_TEST) Command::add(EMSdevice::DeviceType::SYSTEM, settings.ems_bus_id, F_(test), System::command_test); @@ -902,9 +902,9 @@ bool System::check_upgrade() { } // export all settings to JSON text -// http://ems-esp/api?device=system&cmd=info +// http://ems-esp/api?device=system&cmd=settings // value and id are ignored -bool System::command_info(const char * value, const int8_t id, JsonObject & json) { +bool System::command_settings(const char * value, const int8_t id, JsonObject & json) { #ifdef EMSESP_STANDALONE json["test"] = "testing system info command"; #else @@ -977,7 +977,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & json JsonObject node = json.createNestedObject("Settings"); node["tx_mode"] = settings.tx_mode; node["ems_bus_id"] = settings.ems_bus_id; - node["syslog_enabled"] = settings.syslog_enabled; + node["syslog_enabled"] = Helpers::render_boolean(s, settings.syslog_enabled); node["syslog_level"] = settings.syslog_level; node["syslog_mark_interval"] = settings.syslog_mark_interval; node["syslog_host"] = settings.syslog_host; @@ -999,9 +999,9 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & json return true; } -// export debug information -// http://ems-esp/api?device=system&cmd=report -bool System::command_report(const char * value, const int8_t id, JsonObject & json) { +// export status information including some basic settings +// http://ems-esp/api?device=system&cmd=info +bool System::command_info(const char * value, const int8_t id, JsonObject & json) { JsonObject node; node = json.createNestedObject("System"); @@ -1043,6 +1043,7 @@ bool System::command_report(const char * value, const int8_t id, JsonObject & js node["api_enabled"] = Helpers::render_boolean(s, settings.api_enabled); node["bool_format"] = settings.bool_format; node["analog_enabled"] = Helpers::render_boolean(s, settings.analog_enabled); + // node["mqtt_enabled"] = Helpers::render_boolean(s, settings.; // TODO }); node = json.createNestedObject("Status"); diff --git a/src/system.h b/src/system.h index ffdeb48a0..040def674 100644 --- a/src/system.h +++ b/src/system.h @@ -53,7 +53,7 @@ class System { static bool command_publish(const char * value, const int8_t id); static bool command_fetch(const char * value, const int8_t id); static bool command_info(const char * value, const int8_t id, JsonObject & json); - static bool command_report(const char * value, const int8_t id, JsonObject & json); + static bool command_settings(const char * value, const int8_t id, JsonObject & json); #if defined(EMSESP_TEST) static bool command_test(const char * value, const int8_t id);