Browse Source

Merge branch 'dev' of github.com:plutec/espurna into dev

alexa
Antonio Sánchez 6 years ago
parent
commit
d53d1ebd4d
4 changed files with 8 additions and 7 deletions
  1. +1
    -1
      README.md
  2. +3
    -5
      code/espurna/api.ino
  3. +1
    -1
      code/espurna/config/version.h
  4. +3
    -0
      code/espurna/utils.ino

+ 1
- 1
README.md View File

@ -3,7 +3,7 @@
ESPurna ("spark" in Catalan) is a custom firmware for ESP8285/ESP8266 based smart switches, lights and sensors. 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. 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/) [![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) [![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) [![travis](https://travis-ci.org/xoseperez/espurna.svg?branch=dev)](https://travis-ci.org/xoseperez/espurna)


+ 3
- 5
code/espurna/api.ino View File

@ -19,7 +19,6 @@ typedef struct {
api_put_callback_f putFn = NULL; api_put_callback_f putFn = NULL;
} web_api_t; } web_api_t;
std::vector<web_api_t> _apis; std::vector<web_api_t> _apis;
bool _api_restful = API_RESTFUL;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -32,14 +31,13 @@ void _apiWebSocketOnSend(JsonObject& root) {
root["apiEnabled"] = getSetting("apiEnabled", API_ENABLED).toInt() == 1; root["apiEnabled"] = getSetting("apiEnabled", API_ENABLED).toInt() == 1;
root["apiKey"] = getSetting("apiKey"); root["apiKey"] = getSetting("apiKey");
root["apiRealTime"] = getSetting("apiRealTime", API_REAL_TIME_VALUES).toInt() == 1; root["apiRealTime"] = getSetting("apiRealTime", API_REAL_TIME_VALUES).toInt() == 1;
root["apiRestFul"] = _api_restful;
root["apiRestFul"] = getSetting("apiRestFul", API_RESTFUL).toInt() == 1;
} }
void _apiConfigure() { void _apiConfigure() {
_api_restful = getSetting("apiRestFul", API_RESTFUL).toInt() == 1;
// Nothing to do
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// API // API
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -165,7 +163,7 @@ bool _apiRequestCallback(AsyncWebServerRequest *request) {
// Check if its a PUT // Check if its a PUT
if (api.putFn != NULL) { 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)) { if (request->hasParam("value", request->method() == HTTP_PUT)) {
AsyncWebParameter* p = request->getParam("value", request->method() == HTTP_PUT); AsyncWebParameter* p = request->getParam("value", request->method() == HTTP_PUT);
(api.putFn)((p->value()).c_str()); (api.putFn)((p->value()).c_str());


+ 1
- 1
code/espurna/config/version.h View File

@ -1,5 +1,5 @@
#define APP_NAME "ESPURNA" #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_AUTHOR "xose.perez@gmail.com"
#define APP_WEBSITE "http://tinkerman.cat" #define APP_WEBSITE "http://tinkerman.cat"
#define CFG_VERSION 3 #define CFG_VERSION 3

+ 3
- 0
code/espurna/utils.ino View File

@ -236,6 +236,9 @@ void heartbeat() {
#if (HEARTBEAT_REPORT_FREEHEAP) #if (HEARTBEAT_REPORT_FREEHEAP)
idbSend(MQTT_TOPIC_FREEHEAP, String(free_heap).c_str()); idbSend(MQTT_TOPIC_FREEHEAP, String(free_heap).c_str());
#endif #endif
#if (HEARTBEAT_REPORT_RSSI)
idbSend(MQTT_TOPIC_RSSI, String(WiFi.RSSI()).c_str());
#endif
#endif #endif
} }


Loading…
Cancel
Save