rename system info -> settings and report -> info

This commit is contained in:
proddy
2020-11-16 21:15:15 +01:00
parent dd9f69e9b6
commit 0cde2918cf
4 changed files with 13 additions and 13 deletions

View File

@@ -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");