mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
show ntp in info
This commit is contained in:
@@ -1452,6 +1452,7 @@ bool System::command_service(const char * cmd, const char * value) {
|
|||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int n;
|
int n;
|
||||||
if (!ok && Helpers::value2number(value, n)) {
|
if (!ok && Helpers::value2number(value, n)) {
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
@@ -1671,15 +1672,19 @@ bool System::command_info(const char * value, const int8_t id, JsonObject output
|
|||||||
|
|
||||||
// NTP status
|
// NTP status
|
||||||
node = output["ntp"].to<JsonObject>();
|
node = output["ntp"].to<JsonObject>();
|
||||||
#ifndef EMSESP_STANDALONE
|
|
||||||
node["NTPStatus"] = EMSESP::system_.ntp_connected() ? "connected" : "disconnected";
|
|
||||||
EMSESP::esp32React.getNTPSettingsService()->read([&](const NTPSettings & settings) {
|
EMSESP::esp32React.getNTPSettingsService()->read([&](const NTPSettings & settings) {
|
||||||
|
#ifndef EMSESP_STANDALONE
|
||||||
node["enabled"] = settings.enabled;
|
node["enabled"] = settings.enabled;
|
||||||
|
#else
|
||||||
|
node["enabled"] = true;
|
||||||
|
#endif
|
||||||
node["server"] = settings.server;
|
node["server"] = settings.server;
|
||||||
node["tzLabel"] = settings.tzLabel;
|
node["tzLabel"] = settings.tzLabel;
|
||||||
});
|
});
|
||||||
|
#ifndef EMSESP_STANDALONE
|
||||||
node["timestamp"] = time(nullptr);
|
node["timestamp"] = time(nullptr);
|
||||||
#endif
|
#endif
|
||||||
|
node["NTPStatus"] = EMSESP::system_.ntp_connected() ? "connected" : "disconnected";
|
||||||
|
|
||||||
// AP Status
|
// AP Status
|
||||||
node = output["ap"].to<JsonObject>();
|
node = output["ap"].to<JsonObject>();
|
||||||
|
|||||||
Reference in New Issue
Block a user