mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-03-13 10:10:27 +08:00
[Build] Rename USE_SETTINGS_ARCHIVE to FEATURE_SETTINGS_ARCHIVE and use 0/1 state
This commit is contained in:
@@ -867,7 +867,8 @@ The old settings are still active in memory and if something will be saved, only
|
||||
This would corrupt the settings file.
|
||||
|
||||
|
||||
With only ``USE_SETTINGS_ARCHIVE`` defined during build, the URL and credentials cannot be stored.
|
||||
With only ``FEATURE_SETTINGS_ARCHIVE`` defined during build, the URL and credentials cannot be stored.
|
||||
(2022/07/24: Renamed USE_SETTINGS_ARCHIVE to FEATURE_SETTINGS_ARCHIVE)
|
||||
For this the build must be made with ``FEATURE_CUSTOM_PROVISIONING`` defined.
|
||||
|
||||
N.B. ``FEATURE_CUSTOM_PROVISIONING`` is added on 2022/05/13. (2022/07/24: Renamed from USE_CUSTOM_PROVISIONING to FEATURE_CUSTOM_PROVISIONING)
|
||||
@@ -913,7 +914,7 @@ When the build is made with ``FEATURE_CUSTOM_PROVISIONING`` defined, this Settin
|
||||
All Settings on the Settings Archive page can be stored in a file named ``provisioning.dat``.
|
||||
This file also can store the factory default settings like the device model to ease deployment of a large number of nodes.
|
||||
|
||||
N.B. The ``USE_SETTINGS_ARCHIVE`` define is needed to allow to edit the ``provisioning.dat`` file, but it is not needed to use the provisioning feature.
|
||||
N.B. The ``FEATURE_SETTINGS_ARCHIVE`` define is needed to allow to edit the ``provisioning.dat`` file, but it is not needed to use the provisioning feature.
|
||||
|
||||
|
||||
.. image:: images/SettingsArchive_provisioning.png
|
||||
|
||||
@@ -122,7 +122,7 @@ try:
|
||||
plugins.append(buildflag)
|
||||
|
||||
plugins.append('MQTT_ONLY')
|
||||
plugins.append('USE_SETTINGS_ARCHIVE')
|
||||
plugins.append('FEATURE_SETTINGS_ARCHIVE=1')
|
||||
plugins.append('WEBSERVER_RULES_DEBUG=1')
|
||||
plugins.append('WEBSERVER_TIMINGSTATS')
|
||||
plugins.append('WEBSERVER_NEW_UI')
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
|
||||
// Allow for remote provisioning of a node.
|
||||
// This is only allowed for custom builds.
|
||||
// To setup the configuration of the provisioning file, one must also define USE_SETTINGS_ARCHIVE
|
||||
// To setup the configuration of the provisioning file, one must also define FEATURE_SETTINGS_ARCHIVE
|
||||
// Default setting is to not allow to configure a node remotely, unless explicitly enabled.
|
||||
// #define FEATURE_CUSTOM_PROVISIONING 1
|
||||
|
||||
@@ -200,7 +200,7 @@
|
||||
|
||||
|
||||
|
||||
// #define USE_SETTINGS_ARCHIVE
|
||||
// #define FEATURE_SETTINGS_ARCHIVE 1
|
||||
// #define FEATURE_I2CMULTIPLEXER
|
||||
// #define USE_TRIGONOMETRIC_FUNCTIONS_RULES
|
||||
// #define PLUGIN_USES_ADAFRUITGFX // Used by Display plugins using Adafruit GFX library
|
||||
|
||||
@@ -155,14 +155,15 @@ To create/register a plugin, you have to :
|
||||
* Available options **********************************************************
|
||||
\******************************************************************************/
|
||||
#if defined(CORE_POST_2_5_0) && !defined(MEMORY_ANALYSIS) && !defined(USE_CUSTOM_H)
|
||||
#ifndef USE_SETTINGS_ARCHIVE
|
||||
#ifndef FEATURE_SETTINGS_ARCHIVE
|
||||
// FIXME TD-er: Disabled for now, to reduce binary size
|
||||
// #define USE_SETTINGS_ARCHIVE
|
||||
#endif // USE_SETTINGS_ARCHIVE
|
||||
// #define FEATURE_SETTINGS_ARCHIVE 1
|
||||
#endif // ifndef FEATURE_SETTINGS_ARCHIVE
|
||||
#endif
|
||||
|
||||
#if defined(USE_SETTINGS_ARCHIVE) && defined(FORCE_PRE_2_5_0)
|
||||
#undef USE_SETTINGS_ARCHIVE
|
||||
#if FEATURE_SETTINGS_ARCHIVE && defined(FORCE_PRE_2_5_0)
|
||||
#undef FEATURE_SETTINGS_ARCHIVE
|
||||
#define FEATURE_SETTINGS_ARCHIVE 0
|
||||
#endif
|
||||
|
||||
|
||||
@@ -357,9 +358,10 @@ To create/register a plugin, you have to :
|
||||
|
||||
#define PLUGIN_SET_NONE
|
||||
|
||||
#ifdef USE_SETTINGS_ARCHIVE
|
||||
#undef USE_SETTINGS_ARCHIVE
|
||||
#endif // USE_SETTINGS_ARCHIVE
|
||||
#if FEATURE_SETTINGS_ARCHIVE
|
||||
#undef FEATURE_SETTINGS_ARCHIVE
|
||||
#define FEATURE_SETTINGS_ARCHIVE 0
|
||||
#endif // if FEATURE_SETTINGS_ARCHIVE
|
||||
|
||||
#ifdef USES_TIMING_STATS
|
||||
#undef USES_TIMING_STATS
|
||||
@@ -1523,8 +1525,8 @@ To create/register a plugin, you have to :
|
||||
#ifndef USE_RTTTL
|
||||
#define USE_RTTTL
|
||||
#endif
|
||||
#ifndef USE_SETTINGS_ARCHIVE
|
||||
#define USE_SETTINGS_ARCHIVE
|
||||
#ifndef FEATURE_SETTINGS_ARCHIVE
|
||||
#define FEATURE_SETTINGS_ARCHIVE 1
|
||||
#endif
|
||||
#ifndef FEATURE_SD
|
||||
#define FEATURE_SD 1
|
||||
@@ -1822,8 +1824,9 @@ To create/register a plugin, you have to :
|
||||
#ifdef FEATURE_I2CMULTIPLEXER
|
||||
#undef FEATURE_I2CMULTIPLEXER
|
||||
#endif
|
||||
#ifdef USE_SETTINGS_ARCHIVE
|
||||
#undef USE_SETTINGS_ARCHIVE
|
||||
#if FEATURE_SETTINGS_ARCHIVE
|
||||
#undef FEATURE_SETTINGS_ARCHIVE
|
||||
#define FEATURE_SETTINGS_ARCHIVE 0
|
||||
#endif
|
||||
|
||||
#ifdef USE_SERVO
|
||||
@@ -1975,7 +1978,7 @@ To create/register a plugin, you have to :
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(USE_SETTINGS_ARCHIVE) || FEATURE_CUSTOM_PROVISIONING
|
||||
#if FEATURE_SETTINGS_ARCHIVE || FEATURE_CUSTOM_PROVISIONING
|
||||
#ifndef FEATURE_DOWNLOAD
|
||||
#define FEATURE_DOWNLOAD 1
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "../WebServer/SettingsArchive.h"
|
||||
|
||||
#ifdef USE_SETTINGS_ARCHIVE
|
||||
#if FEATURE_SETTINGS_ARCHIVE
|
||||
|
||||
#include "../WebServer/WebServer.h"
|
||||
#include "../WebServer/HTML_wrappers.h"
|
||||
@@ -241,4 +241,4 @@ bool tryDownloadFileType(const String& url, const String& user, const String& pa
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // ifdef USE_SETTINGS_ARCHIVE
|
||||
#endif // if FEATURE_SETTINGS_ARCHIVE
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "../WebServer/common.h"
|
||||
|
||||
#ifdef USE_SETTINGS_ARCHIVE
|
||||
#if FEATURE_SETTINGS_ARCHIVE
|
||||
|
||||
#include "../DataTypes/ESPEasyFileType.h"
|
||||
|
||||
@@ -22,6 +22,6 @@ void storeDownloadFiletypeCheckbox(FileType::Enum filetype, unsigned int filenr
|
||||
|
||||
bool tryDownloadFileType(const String& url, const String& user, const String& pass, FileType::Enum filetype, unsigned int filenr = 0);
|
||||
|
||||
#endif // ifdef USE_SETTINGS_ARCHIVE
|
||||
#endif // if FEATURE_SETTINGS_ARCHIVE
|
||||
|
||||
#endif
|
||||
@@ -166,9 +166,9 @@ void handle_tools() {
|
||||
|
||||
addWideButtonPlusDescription(F("filelist"), F("File browser"), F("Show files on internal flash file system"));
|
||||
addWideButtonPlusDescription(F("/factoryreset"), F("Factory Reset"), F("Select pre-defined configuration or full erase of settings"));
|
||||
# ifdef USE_SETTINGS_ARCHIVE
|
||||
# if FEATURE_SETTINGS_ARCHIVE
|
||||
addWideButtonPlusDescription(F("/settingsarchive"), F("Settings Archive"), F("Download settings from some archive"));
|
||||
# endif // ifdef USE_SETTINGS_ARCHIVE
|
||||
# endif // if FEATURE_SETTINGS_ARCHIVE
|
||||
# if FEATURE_SD
|
||||
addWideButtonPlusDescription(F("SDfilelist"), F("SD Card"), F("Show files on SD-Card"));
|
||||
# endif // if FEATURE_SD
|
||||
|
||||
@@ -228,9 +228,9 @@ void WebServerInit()
|
||||
#ifdef WEBSERVER_FACTORY_RESET
|
||||
web_server.on(F("/factoryreset"), handle_factoryreset);
|
||||
#endif // ifdef WEBSERVER_FACTORY_RESET
|
||||
#ifdef USE_SETTINGS_ARCHIVE
|
||||
#if FEATURE_SETTINGS_ARCHIVE
|
||||
web_server.on(F("/settingsarchive"), handle_settingsarchive);
|
||||
#endif // ifdef USE_SETTINGS_ARCHIVE
|
||||
#endif // if FEATURE_SETTINGS_ARCHIVE
|
||||
web_server.on(F("/favicon.ico"), handle_favicon);
|
||||
#ifdef WEBSERVER_FILELIST
|
||||
web_server.on(F("/filelist"), handle_filelist);
|
||||
|
||||
@@ -65,7 +65,7 @@ else:
|
||||
"-DUSES_PLUGIN_STATS",
|
||||
"-DUSES_CHART_JS",
|
||||
|
||||
"-DUSE_SETTINGS_ARCHIVE",
|
||||
"-DFEATURE_SETTINGS_ARCHIVE=1",
|
||||
"-DFEATURE_ESPEASY_P2P=1",
|
||||
"-DFEATURE_CUSTOM_PROVISIONING=1"
|
||||
]
|
||||
|
||||
@@ -65,7 +65,7 @@ else:
|
||||
|
||||
"-DFEATURE_ESPEASY_P2P=1",
|
||||
|
||||
"-DUSE_SETTINGS_ARCHIVE"
|
||||
"-DFEATURE_SETTINGS_ARCHIVE=1"
|
||||
]
|
||||
|
||||
my_flags = env.ParseFlags(env['BUILD_FLAGS'])
|
||||
|
||||
Reference in New Issue
Block a user