mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
make it compile standalone
This commit is contained in:
@@ -276,7 +276,7 @@ uint8_t Command::call(const uint8_t device_type, const char * cmd, const char *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// call the function baesed on type
|
// call the function based on type
|
||||||
if (cf->cmdfunction_json_) {
|
if (cf->cmdfunction_json_) {
|
||||||
return_code = ((cf->cmdfunction_json_)(value, id, output)) ? CommandRet::OK : CommandRet::ERROR;
|
return_code = ((cf->cmdfunction_json_)(value, id, output)) ? CommandRet::OK : CommandRet::ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ class System {
|
|||||||
return syslog_enabled_;
|
return syslog_enabled_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef EMSESP_STANDALONE
|
||||||
unsigned long syslog_count() {
|
unsigned long syslog_count() {
|
||||||
return syslog_.message_count();
|
return syslog_.message_count();
|
||||||
}
|
}
|
||||||
@@ -88,6 +89,7 @@ class System {
|
|||||||
unsigned long syslog_fails() {
|
unsigned long syslog_fails() {
|
||||||
return syslog_.message_fails();
|
return syslog_.message_fails();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void led_init(bool refresh);
|
void led_init(bool refresh);
|
||||||
void network_init(bool refresh);
|
void network_init(bool refresh);
|
||||||
@@ -189,7 +191,7 @@ class System {
|
|||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
return (ethernet_connected() || WiFi.isConnected());
|
return (ethernet_connected() || WiFi.isConnected());
|
||||||
#else
|
#else
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -187,6 +187,7 @@ void WebStatusService::webStatusService(AsyncWebServerRequest * request) {
|
|||||||
statJson["q"] =
|
statJson["q"] =
|
||||||
WebAPIService::api_count() == 0 ? 100 : 100 - (uint8_t)((100 * WebAPIService::api_fails()) / (WebAPIService::api_count() + WebAPIService::api_fails()));
|
WebAPIService::api_count() == 0 ? 100 : 100 - (uint8_t)((100 * WebAPIService::api_fails()) / (WebAPIService::api_count() + WebAPIService::api_fails()));
|
||||||
|
|
||||||
|
#ifndef EMSESP_STANDALONE
|
||||||
if (EMSESP::system_.syslog_enabled()) {
|
if (EMSESP::system_.syslog_enabled()) {
|
||||||
statJson = statsJson.createNestedObject();
|
statJson = statsJson.createNestedObject();
|
||||||
statJson["id"] = "Syslog Messages";
|
statJson["id"] = "Syslog Messages";
|
||||||
@@ -196,6 +197,7 @@ void WebStatusService::webStatusService(AsyncWebServerRequest * request) {
|
|||||||
? 100
|
? 100
|
||||||
: 100 - (uint8_t)((100 * EMSESP::system_.syslog_fails()) / (EMSESP::system_.syslog_count() + EMSESP::system_.syslog_fails()));
|
: 100 - (uint8_t)((100 * EMSESP::system_.syslog_fails()) / (EMSESP::system_.syslog_count() + EMSESP::system_.syslog_fails()));
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
response->setLength();
|
response->setLength();
|
||||||
request->send(response);
|
request->send(response);
|
||||||
|
|||||||
Reference in New Issue
Block a user