diff --git a/README.md b/README.md index ea71bce3..57c5c9e8 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ESPurna ("spark" in Catalan) is a custom firmware for ESP8285/ESP8266 based smart switches, lights and sensors. It uses the Arduino Core for ESP8266 framework and a number of 3rd party libraries. -[![version](https://img.shields.io/badge/version-1.13.3-brightgreen.svg)](CHANGELOG.md) +[![version](https://img.shields.io/badge/version-1.13.4-DEV-brightgreen.svg)](CHANGELOG.md) [![branch](https://img.shields.io/badge/branch-dev-orange.svg)](https://github.com/xoseperez/espurna/tree/dev/) [![license](https://img.shields.io/github/license/xoseperez/espurna.svg)](LICENSE) [![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=dev)](https://travis-ci.org/xoseperez/espurna) diff --git a/code/espurna/api.ino b/code/espurna/api.ino index f65f03f9..5345def6 100644 --- a/code/espurna/api.ino +++ b/code/espurna/api.ino @@ -19,7 +19,6 @@ typedef struct { api_put_callback_f putFn = NULL; } web_api_t; std::vector _apis; -bool _api_restful = API_RESTFUL; // ----------------------------------------------------------------------------- @@ -32,14 +31,13 @@ void _apiWebSocketOnSend(JsonObject& root) { root["apiEnabled"] = getSetting("apiEnabled", API_ENABLED).toInt() == 1; root["apiKey"] = getSetting("apiKey"); root["apiRealTime"] = getSetting("apiRealTime", API_REAL_TIME_VALUES).toInt() == 1; - root["apiRestFul"] = _api_restful; + root["apiRestFul"] = getSetting("apiRestFul", API_RESTFUL).toInt() == 1; } void _apiConfigure() { - _api_restful = getSetting("apiRestFul", API_RESTFUL).toInt() == 1; + // Nothing to do } - // ----------------------------------------------------------------------------- // API // ----------------------------------------------------------------------------- @@ -165,7 +163,7 @@ bool _apiRequestCallback(AsyncWebServerRequest *request) { // Check if its a PUT if (api.putFn != NULL) { - if (!_api_restful || (request->method() == HTTP_PUT)) { + if ((getSetting("apiRestFul", API_RESTFUL).toInt() != 1) || (request->method() == HTTP_PUT)) { if (request->hasParam("value", request->method() == HTTP_PUT)) { AsyncWebParameter* p = request->getParam("value", request->method() == HTTP_PUT); (api.putFn)((p->value()).c_str()); diff --git a/code/espurna/config/version.h b/code/espurna/config/version.h index c2ba7e00..3a277141 100644 --- a/code/espurna/config/version.h +++ b/code/espurna/config/version.h @@ -1,5 +1,5 @@ #define APP_NAME "ESPURNA" -#define APP_VERSION "1.13.3" +#define APP_VERSION "1.13.4-DEV" #define APP_AUTHOR "xose.perez@gmail.com" #define APP_WEBSITE "http://tinkerman.cat" #define CFG_VERSION 3