mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
rename system/info text, added MQTT status
This commit is contained in:
@@ -963,17 +963,27 @@ bool System::command_settings(const char * value, const int8_t id, JsonObject &
|
|||||||
bool System::command_info(const char * value, const int8_t id, JsonObject & output) {
|
bool System::command_info(const char * value, const int8_t id, JsonObject & output) {
|
||||||
JsonObject node;
|
JsonObject node;
|
||||||
|
|
||||||
|
// System
|
||||||
node = output.createNestedObject("System");
|
node = output.createNestedObject("System");
|
||||||
|
|
||||||
node["version"] = EMSESP_APP_VERSION;
|
node["version"] = EMSESP_APP_VERSION;
|
||||||
node["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3);
|
node["uptime"] = uuid::log::format_timestamp_ms(uuid::get_uptime_ms(), 3);
|
||||||
node["uptime_sec"] = uuid::get_uptime_sec();
|
node["uptime (seconds)"] = uuid::get_uptime_sec();
|
||||||
|
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
node["freemem"] = ESP.getFreeHeap() / 1000L; // kilobytes
|
node["freemem"] = ESP.getFreeHeap() / 1000L; // kilobytes
|
||||||
#endif
|
#endif
|
||||||
node["reset_reason"] = EMSESP::system_.reset_reason(0) + " / " + EMSESP::system_.reset_reason(1);
|
node["reset reason"] = EMSESP::system_.reset_reason(0) + " / " + EMSESP::system_.reset_reason(1);
|
||||||
|
|
||||||
|
if (EMSESP::dallas_enabled()) {
|
||||||
|
node["dallas sensors"] = EMSESP::sensor_devices().size();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Mqtt::enabled()) {
|
||||||
|
node["MQTT"] = Mqtt::connected() ? F_(connected) : F_(disconnected);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Status
|
||||||
node = output.createNestedObject("Status");
|
node = output.createNestedObject("Status");
|
||||||
|
|
||||||
switch (EMSESP::bus_status()) {
|
switch (EMSESP::bus_status()) {
|
||||||
@@ -1003,7 +1013,6 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
|
|||||||
node["MQTT publish fails"] = Mqtt::publish_fails();
|
node["MQTT publish fails"] = Mqtt::publish_fails();
|
||||||
}
|
}
|
||||||
if (EMSESP::dallas_enabled()) {
|
if (EMSESP::dallas_enabled()) {
|
||||||
node["dallas sensors"] = EMSESP::sensor_devices().size();
|
|
||||||
node["dallas reads"] = EMSESP::sensor_reads();
|
node["dallas reads"] = EMSESP::sensor_reads();
|
||||||
node["dallas fails"] = EMSESP::sensor_fails();
|
node["dallas fails"] = EMSESP::sensor_fails();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user