Arduino Core 3 (#407)

* Add and remove libs and components for Arduino Core 3

* Arduino Core 3

* Add back Solo1

* Change ESP32-S3 to 4MB build

* Update README.md

* Fix retain and number of retries

* Fix rolling log

* Fix defaults

* Fix BleScanner on Solo1

* Export settings

* Import settings

* Fix HA Battery voltage

* Change submodule

* Update espMqttClient and AsyncTCP

* Webserial and MQTT/Network reconnecting

* Update nuki_ble

---------

Co-authored-by: iranl <iranl@github.com>
This commit is contained in:
iranl
2024-07-05 18:45:39 +02:00
committed by GitHub
parent 193ebb5f91
commit 6b0100fd61
236 changed files with 16390 additions and 9740 deletions

View File

@@ -2,15 +2,15 @@
#include <Preferences.h>
#include <WebServer.h>
#include "NukiWrapper.h"
#include "NetworkLock.h"
#include "NukiOpenerWrapper.h"
#include "Ota.h"
#ifndef NUKI_HUB_UPDATER
#include "NukiWrapper.h"
#include "NukiNetworkLock.h"
#include "NukiOpenerWrapper.h"
#include "Gpio.h"
extern TaskHandle_t networkTaskHandle;
extern TaskHandle_t nukiTaskHandle;
extern TaskHandle_t presenceDetectionTaskHandle;
enum class TokenType
{
@@ -24,36 +24,44 @@ enum class TokenType
QueryIntervalBattery,
};
#else
#include "NukiNetwork.h"
#endif
extern TaskHandle_t networkTaskHandle;
class WebCfgServer
{
public:
WebCfgServer(NukiWrapper* nuki, NukiOpenerWrapper* nukiOpener, Network* network, Gpio* gpio, EthServer* ethServer, Preferences* preferences, bool allowRestartToPortal);
#ifndef NUKI_HUB_UPDATER
WebCfgServer(NukiWrapper* nuki, NukiOpenerWrapper* nukiOpener, NukiNetwork* network, Gpio* gpio, EthServer* ethServer, Preferences* preferences, bool allowRestartToPortal, uint8_t partitionType);
#else
WebCfgServer(NukiNetwork* network, EthServer* ethServer, Preferences* preferences, bool allowRestartToPortal, uint8_t partitionType);
#endif
~WebCfgServer() = default;
void initialize();
void update();
private:
#ifndef NUKI_HUB_UPDATER
void sendSettings();
bool processArgs(String& message);
bool processImport(String& message);
void processGpioArgs();
void buildHtml(String& response);
void buildAccLvlHtml(String& response);
void buildCredHtml(String& response);
void buildOtaHtml(String& response, bool errored);
void buildOtaCompletedHtml(String& response);
void buildImportExportHtml(String& response);
void buildMqttConfigHtml(String& response);
void buildStatusHtml(String& response);
void buildAdvancedConfigHtml(String& response);
void buildNukiConfigHtml(String& response);
void buildGpioConfigHtml(String& response);
void buildConfirmHtml(String& response, const String &message, uint32_t redirectDelay = 5);
void buildConfigureWifiHtml(String& response);
void buildInfoHtml(String& response);
void sendCss();
void sendFavicon();
void processUnpair(bool opener);
void processFactoryReset();
void buildHtmlHeader(String& response, String additionalHeader = "");
void printInputField(String& response, const char* token, const char* description, const char* value, const size_t& maxLength, const char* id, const bool& isPassword = false, const bool& showLengthRestriction = false);
void printInputField(String& response, const char* token, const char* description, const int value, size_t maxLength, const char* id);
void printCheckBox(String& response, const char* token, const char* description, const bool value, const char* htmlClass);
@@ -70,14 +78,26 @@ private:
void printParameter(String& response, const char* description, const char* value, const char *link = "", const char *id = "");
String generateConfirmCode();
NukiWrapper* _nuki = nullptr;
NukiOpenerWrapper* _nukiOpener = nullptr;
Gpio* _gpio = nullptr;
bool _pinsConfigured = false;
bool _brokerConfigured = false;
String _confirmCode = "----";
#endif
void buildConfirmHtml(String& response, const String &message, uint32_t redirectDelay = 5);
void buildOtaHtml(String& response, bool errored);
void buildOtaCompletedHtml(String& response);
void sendCss();
void sendFavicon();
void buildHtmlHeader(String& response, String additionalHeader = "");
void waitAndProcess(const bool blocking, const uint32_t duration);
void handleOtaUpload();
WebServer _server;
NukiWrapper* _nuki = nullptr;
NukiOpenerWrapper* _nukiOpener = nullptr;
Network* _network = nullptr;
Gpio* _gpio = nullptr;
NukiNetwork* _network = nullptr;
Preferences* _preferences = nullptr;
Ota _ota;
@@ -85,13 +105,9 @@ private:
char _credUser[31] = {0};
char _credPassword[31] = {0};
bool _allowRestartToPortal = false;
bool _pinsConfigured = false;
bool _brokerConfigured = false;
uint8_t _partitionType = 0;
uint32_t _transferredSize = 0;
unsigned long _otaStartTs = 0;
String _hostname;
String _confirmCode = "----";
bool _enabled = true;
};