mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-06 07:05:27 +00:00
BL0937 - implemented energy counter. TODO: save to flash.
http server - buffer size change, added MQTT status information. MQTT - connect event counter for debug purpose. MQTT - debug outputs. MQTT - ERR-ISCONN result bug fix. MQTT - Wifi connection check added. MQTT - connect/reconnect patch Formatting changes. Reading code was sometimes hard. bug fix new device. bug fix http server
This commit is contained in:
@ -15,6 +15,7 @@
|
||||
#include "../devicegroups/deviceGroups_public.h"
|
||||
#include "../mqtt/new_mqtt.h"
|
||||
#include "hass.h"
|
||||
#include "../cJSON/cJSON.h"
|
||||
|
||||
#ifdef WINDOWS
|
||||
// nothing
|
||||
@ -526,6 +527,7 @@ int http_fn_index(http_request_t *request) {
|
||||
|
||||
hprintf128(request,"<h5>Ping watchdog - %i lost, %i ok!</h5>",
|
||||
PingWatchDog_GetTotalLost(),PingWatchDog_GetTotalReceived());
|
||||
hprintf128(request,"<h5>MQTT State: %s</h5>", (Main_HasMQTTConnected()==1)?"connected":"disconnected");
|
||||
|
||||
// for normal page loads, show the rest of the HTML
|
||||
if(!http_getArg(request->url,"state",tmpA,sizeof(tmpA))) {
|
||||
@ -1232,7 +1234,9 @@ int http_fn_ha_discovery(http_request_t *request) {
|
||||
sprintf(topic, "homeassistant"); //default discovery topic is `homeassistant`
|
||||
}
|
||||
|
||||
cJSON_Hooks hooks = {os_malloc, os_free};
|
||||
struct cJSON_Hooks hooks;
|
||||
hooks.malloc_fn = os_malloc;
|
||||
hooks.free_fn = os_free;
|
||||
cJSON_InitHooks(&hooks);
|
||||
|
||||
if(relayCount > 0) {
|
||||
|
||||
Reference in New Issue
Block a user