mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-11 07:01:38 +02:00
channel name can use any character, not limited any more
added `/` to MQTT topic and Inverter name trigger for `calcSunrise` is now using local time #515 fix reconnect timeout for WiFi #509 start AP only after boot, not on WiFi connection loss improved /system `free_heap` value (measured before JSON-tree is built)
This commit is contained in:
parent
75628ad230
commit
73b6ff073c
8 changed files with 30 additions and 19 deletions
|
@ -19,6 +19,7 @@ class RestApi {
|
|||
public:
|
||||
RestApi() {
|
||||
mTimezoneOffset = 0;
|
||||
mFreeHeap = 0;
|
||||
}
|
||||
|
||||
void setup(IApp *app, HMSYSTEM *sys, AsyncWebServer *srv, settings_t *config) {
|
||||
|
@ -51,6 +52,8 @@ class RestApi {
|
|||
|
||||
private:
|
||||
void onApi(AsyncWebServerRequest *request) {
|
||||
mFreeHeap = ESP.getFreeHeap();
|
||||
|
||||
AsyncJsonResponse* response = new AsyncJsonResponse(false, 8192);
|
||||
JsonObject root = response->getRoot();
|
||||
|
||||
|
@ -168,7 +171,7 @@ class RestApi {
|
|||
|
||||
obj[F("sdk")] = ESP.getSdkVersion();
|
||||
obj[F("cpu_freq")] = ESP.getCpuFreqMHz();
|
||||
obj[F("heap_free")] = ESP.getFreeHeap();
|
||||
obj[F("heap_free")] = mFreeHeap;
|
||||
obj[F("sketch_total")] = ESP.getFreeSketchSpace();
|
||||
obj[F("sketch_used")] = ESP.getSketchSize() / 1024; // in kb
|
||||
getGeneric(obj);
|
||||
|
@ -571,6 +574,7 @@ class RestApi {
|
|||
settings_t *mConfig;
|
||||
|
||||
uint32_t mTimezoneOffset;
|
||||
uint32_t mFreeHeap;
|
||||
};
|
||||
|
||||
#endif /*__WEB_API_H__*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue