WebUI - First Release (#1586)

* WebUI - First Release

* Lint / Build Issues

* Add WebUI as a default module

* Fix ESP8266 builds
This commit is contained in:
Northern Man authored and GitHub committed 2023-04-05 14:17:08 -05:00
1 parent bf004b078b
commit 9b6133ff03
12 files changed
+1937 -612

No files matched your search

+21 -1
View File
@@ -70,6 +70,9 @@ struct GfSun2000Data {};
#endif
// Modules config inclusion
#if defined(ZwebUI) && defined(ESP32)
# include "config_WebUI.h"
#endif
#if defined(ZgatewayRF) || defined(ZgatewayRF2) || defined(ZgatewayPilight) || defined(ZactuatorSomfy) || defined(ZgatewayRTL_433)
# include "config_RF.h"
#endif
@@ -396,6 +399,7 @@ void pub(const char* topicori, JsonObject& data) {
#if jsonPublishing
Log.trace(F("jsonPubl - ON" CR));
pubMQTT(topic, dataAsString.c_str());
pubWebUI(topicori, data);
#endif
#if simplePublishing
@@ -811,6 +815,11 @@ void setup() {
setup_ethernet();
#endif
#if defined(ZwebUI) && defined(ESP32)
WebUISetup();
modules.add(ZwebUI);
#endif
#if defined(ESP8266) || defined(ESP32)
if (mqtt_secure) {
eClient = new WiFiClientSecure;
@@ -1184,6 +1193,7 @@ void setup_wifi() {
# endif
}
Log.notice(F("WiFi ok with manual config credentials" CR));
displayPrint("Wifi connected");
}
#elif defined(ESP8266) || defined(ESP32)
@@ -1610,6 +1620,9 @@ void loop() {
# endif
# ifdef ZdisplaySSD1306
stateSSD1306Display();
# endif
# if defined(ZwebUI) && defined(ESP32)
stateWebUIStatus();
# endif
}
if (now > (timer_sys_checks + (TimeBetweenCheckingSYS * 1000)) || !timer_sys_checks) {
@@ -1729,6 +1742,9 @@ void loop() {
if (disc)
launchRTL_433Discovery(publishDiscovery);
# endif
#endif
#if defined(ZwebUI) && defined(ESP32)
WebUILoop();
#endif
} else {
// MQTT disconnected
@@ -1827,7 +1843,7 @@ String UTCtimestamp() {
#endif
#if defined(ESP8266) || defined(ESP32) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__)
void stateMeasures() {
String stateMeasures() {
StaticJsonDocument<JSON_MSG_BUFFER> jsonBuffer;
JsonObject SYSdata = jsonBuffer.to<JsonObject>();
SYSdata["uptime"] = uptime();
@@ -1919,8 +1935,12 @@ void stateMeasures() {
}
# endif
SYSdata["modules"] = modules;
String output;
serializeJson(SYSdata, output);
pub(subjectSYStoMQTT, SYSdata);
pubOled(subjectSYStoMQTT, SYSdata);
return output;
}
#endif