mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
Add features to SafeMode binary
This commit is contained in:
parent
1b7c182656
commit
d280dc535f
@ -999,6 +999,8 @@
|
||||
|
||||
#define SET_ESP32_STACK_SIZE (8 * 1024) // Set the stack size for Tasmota. The default value is 8192 for Arduino, some builds might need to increase it
|
||||
|
||||
#define USE_ESP32_SENSORS // Add support for ESP32 temperature and optional hall effect sensor
|
||||
|
||||
//#define USE_SONOFF_SPM // Add support for ESP32 based Sonoff Smart Stackable Power Meter (+11k code)
|
||||
|
||||
//#define USE_ETHERNET // Add support for ethernet (+20k code)
|
||||
@ -1084,7 +1086,7 @@
|
||||
#define BE_LV_WIDGET_SPINNER
|
||||
|
||||
#define BE_LV_WIDGET_QRCODE
|
||||
|
||||
|
||||
#endif // ESP32
|
||||
|
||||
/*********************************************************************************************\
|
||||
|
@ -22,7 +22,7 @@ const char kTasmotaCommands[] PROGMEM = "|" // No prefix
|
||||
D_SO_WIFINOSLEEP "|"
|
||||
// Other commands
|
||||
D_CMND_UPGRADE "|" D_CMND_UPLOAD "|" D_CMND_OTAURL "|" D_CMND_SERIALLOG "|" D_CMND_RESTART "|"
|
||||
#ifndef FIRMWARE_MINIMAL
|
||||
#ifndef FIRMWARE_MINIMAL_ONLY
|
||||
D_CMND_BACKLOG "|" D_CMND_DELAY "|" D_CMND_POWER "|" D_CMND_STATUS "|" D_CMND_STATE "|" D_CMND_SLEEP "|"
|
||||
D_CMND_POWERONSTATE "|" D_CMND_PULSETIME "|" D_CMND_BLINKTIME "|" D_CMND_BLINKCOUNT "|" D_CMND_SAVEDATA "|"
|
||||
D_CMND_SO "|" D_CMND_SETOPTION "|" D_CMND_TEMPERATURE_RESOLUTION "|" D_CMND_HUMIDITY_RESOLUTION "|" D_CMND_PRESSURE_RESOLUTION "|" D_CMND_POWER_RESOLUTION "|"
|
||||
@ -48,7 +48,7 @@ const char kTasmotaCommands[] PROGMEM = "|" // No prefix
|
||||
#ifdef ESP32
|
||||
"|Info|" D_CMND_TOUCH_CAL "|" D_CMND_TOUCH_THRES "|" D_CMND_TOUCH_NUM "|" D_CMND_CPU_FREQUENCY
|
||||
#endif // ESP32
|
||||
#endif //FIRMWARE_MINIMAL
|
||||
#endif //FIRMWARE_MINIMAL_ONLY
|
||||
;
|
||||
|
||||
SO_SYNONYMS(kTasmotaSynonyms,
|
||||
@ -57,7 +57,7 @@ SO_SYNONYMS(kTasmotaSynonyms,
|
||||
|
||||
void (* const TasmotaCommand[])(void) PROGMEM = {
|
||||
&CmndUpgrade, &CmndUpgrade, &CmndOtaUrl, &CmndSeriallog, &CmndRestart,
|
||||
#ifndef FIRMWARE_MINIMAL
|
||||
#ifndef FIRMWARE_MINIMAL_ONLY
|
||||
&CmndBacklog, &CmndDelay, &CmndPower, &CmndStatus, &CmndState, &CmndSleep,
|
||||
&CmndPowerOnState, &CmndPulsetime, &CmndBlinktime, &CmndBlinkcount, &CmndSavedata,
|
||||
&CmndSetoption, &CmndSetoption, &CmndTemperatureResolution, &CmndHumidityResolution, &CmndPressureResolution, &CmndPowerResolution,
|
||||
@ -83,7 +83,7 @@ void (* const TasmotaCommand[])(void) PROGMEM = {
|
||||
#ifdef ESP32
|
||||
, &CmndInfo, &CmndTouchCal, &CmndTouchThres, &CmndTouchNum, &CmndCpuFrequency
|
||||
#endif // ESP32
|
||||
#endif //FIRMWARE_MINIMAL
|
||||
#endif //FIRMWARE_MINIMAL_ONLY
|
||||
};
|
||||
|
||||
const char kWifiConfig[] PROGMEM =
|
||||
|
@ -778,6 +778,8 @@
|
||||
#undef CODE_IMAGE_STR
|
||||
#define CODE_IMAGE_STR "minimal"
|
||||
|
||||
#define FIRMWARE_MINIMAL_ONLY
|
||||
|
||||
#undef FIRMWARE_LITE // Disable tasmota-lite with no sensors
|
||||
#undef FIRMWARE_SENSORS // Disable tasmota-sensors with useful sensors enabled
|
||||
#undef FIRMWARE_KNX_NO_EMULATION // Disable tasmota-knx with KNX but without Emulation
|
||||
|
@ -25,26 +25,15 @@
|
||||
/*********************************************************************************************\
|
||||
* [tasmota32x-safemode.bin]
|
||||
* Provide an image with useful supported sensors enabled
|
||||
*
|
||||
* Is a copy of FIRMWARE_MINIMAL with some additional features enabled
|
||||
\*********************************************************************************************/
|
||||
|
||||
#ifdef FIRMWARE_SAFEMODE
|
||||
#define FIRMWARE_MINIMAL
|
||||
|
||||
#undef CODE_IMAGE_STR
|
||||
#define CODE_IMAGE_STR "safemode"
|
||||
|
||||
#define USE_TLS
|
||||
#define USE_WEBSERVER
|
||||
#define USE_WEBCLIENT
|
||||
#define USE_WEBCLIENT_HTTPS
|
||||
|
||||
#undef USE_UFILESYS
|
||||
#undef GUI_TRASH_FILE
|
||||
#undef GUI_EDIT_FILE
|
||||
#undef USE_PING
|
||||
#undef USE_AUTOCONF
|
||||
#undef USE_BERRY
|
||||
|
||||
#undef FIRMWARE_LITE // Disable tasmota-lite with no sensors
|
||||
#undef FIRMWARE_SENSORS // Disable tasmota-sensors with useful sensors enabled
|
||||
#undef FIRMWARE_KNX_NO_EMULATION // Disable tasmota-knx with KNX but without Emulation
|
||||
@ -55,6 +44,10 @@
|
||||
#undef FIRMWARE_LVGL
|
||||
#undef FIRMWARE_TASMOTA32
|
||||
|
||||
/*-------------------------------------------------------------------------------------------*\
|
||||
* Start copy of all undefines from FIRMWARE_MINIMAL
|
||||
\*-------------------------------------------------------------------------------------------*/
|
||||
|
||||
#undef USE_IMPROV // Disable support for IMPROV serial protocol as used by esp-web-tools (+2k code)
|
||||
#undef USE_TASMESH // Disable Tasmota Mesh using ESP-NOW (+11k code)
|
||||
#undef USE_ARDUINO_OTA // Disable support for Arduino OTA
|
||||
@ -164,6 +157,30 @@
|
||||
#undef DEBUG_THEO // Disable debug code
|
||||
#undef USE_DEBUG_DRIVER // Disable debug code
|
||||
#undef USE_AC_ZERO_CROSS_DIMMER // Disable support for AC_ZERO_CROSS_DIMMER
|
||||
|
||||
/*-------------------------------------------------------------------------------------------*\
|
||||
* End copy of all undefines from FIRMWARE_MINIMAL
|
||||
*
|
||||
* Start FIRMWARE_SAFEMODE specific additions
|
||||
\*-------------------------------------------------------------------------------------------*/
|
||||
|
||||
#define FIRMWARE_MINIMAL
|
||||
|
||||
#undef FIRMWARE_MINIMAL_ONLY
|
||||
|
||||
#undef USE_ESP32_SENSORS
|
||||
#undef USE_UFILESYS
|
||||
#undef GUI_TRASH_FILE
|
||||
#undef GUI_EDIT_FILE
|
||||
#undef USE_PING
|
||||
#undef USE_AUTOCONF
|
||||
#undef USE_BERRY
|
||||
|
||||
#define USE_TLS
|
||||
#define USE_WEBSERVER
|
||||
#define USE_WEBCLIENT
|
||||
#define USE_WEBCLIENT_HTTPS
|
||||
|
||||
#endif // FIRMWARE_SAFEMODE
|
||||
|
||||
/*********************************************************************************************\
|
||||
|
@ -244,11 +244,11 @@ const char HTTP_HEAD_STYLE3[] PROGMEM =
|
||||
"<div style='text-align:left;display:inline-block;color:#%06x;min-width:340px;'>" // COLOR_TEXT
|
||||
#ifdef FIRMWARE_MINIMAL
|
||||
#ifdef FIRMWARE_SAFEMODE
|
||||
"<div style='text-align:center;color:#%06x;'><h3>SafeMode</h3></div>" // COLOR_TEXT_SUCCESS
|
||||
"<span style='text-align:center;color:#%06x;'><h3>" D_SAFEMODE "</h3></span>" // COLOR_TEXT_WARNING
|
||||
#else
|
||||
"<div style='text-align:center;color:#%06x;'><h3>" D_MINIMAL_FIRMWARE_PLEASE_UPGRADE "</h3></div>" // COLOR_TEXT_WARNING
|
||||
#endif
|
||||
#endif
|
||||
#endif // FIRMWARE_SAFEMODE
|
||||
#endif // FIRMWARE_MINIMAL
|
||||
"<div style='text-align:center;color:#%06x;'><noscript>" D_NOSCRIPT "<br></noscript>" // COLOR_TITLE
|
||||
/*
|
||||
#ifdef LANGUAGE_MODULE_NAME
|
||||
@ -883,11 +883,7 @@ void WSContentSendStyle_P(const char* formatP, ...) {
|
||||
}
|
||||
WSContentSend_P(HTTP_HEAD_STYLE3, WebColor(COL_TEXT),
|
||||
#ifdef FIRMWARE_MINIMAL
|
||||
#ifdef FIRMWARE_SAFEMODE
|
||||
WebColor(COL_TEXT_SUCCESS),
|
||||
#else
|
||||
WebColor(COL_TEXT_WARNING),
|
||||
#endif
|
||||
#endif
|
||||
WebColor(COL_TITLE),
|
||||
(Web.initial_config) ? "" : ModuleName().c_str(), SettingsText(SET_DEVICENAME));
|
||||
|
@ -45,7 +45,7 @@ WiFiClient EspClient; // Wifi Client - non-TLS
|
||||
#endif // USE_MQTT_AZURE_IOT
|
||||
|
||||
const char kMqttCommands[] PROGMEM = "|" // No prefix
|
||||
#ifndef FIRMWARE_MINIMAL
|
||||
#ifndef FIRMWARE_MINIMAL_ONLY
|
||||
// SetOption synonyms
|
||||
D_SO_MQTTJSONONLY "|"
|
||||
#ifdef USE_MQTT_TLS
|
||||
@ -67,7 +67,7 @@ const char kMqttCommands[] PROGMEM = "|" // No prefix
|
||||
D_CMND_FULLTOPIC "|" D_CMND_PREFIX "|" D_CMND_GROUPTOPIC "|" D_CMND_TOPIC "|" D_CMND_PUBLISH "|" D_CMND_MQTTLOG "|"
|
||||
D_CMND_BUTTONTOPIC "|" D_CMND_SWITCHTOPIC "|" D_CMND_BUTTONRETAIN "|" D_CMND_SWITCHRETAIN "|" D_CMND_POWERRETAIN "|"
|
||||
D_CMND_SENSORRETAIN "|" D_CMND_INFORETAIN "|" D_CMND_STATERETAIN
|
||||
#endif // FIRMWARE_MINIMAL
|
||||
#endif // FIRMWARE_MINIMAL_ONLY
|
||||
;
|
||||
|
||||
SO_SYNONYMS(kMqttSynonyms,
|
||||
@ -79,7 +79,7 @@ SO_SYNONYMS(kMqttSynonyms,
|
||||
);
|
||||
|
||||
void (* const MqttCommand[])(void) PROGMEM = {
|
||||
#ifndef FIRMWARE_MINIMAL
|
||||
#ifndef FIRMWARE_MINIMAL_ONLY
|
||||
#if defined(USE_MQTT_TLS)
|
||||
&CmndMqttFingerprint,
|
||||
#endif
|
||||
@ -94,7 +94,7 @@ void (* const MqttCommand[])(void) PROGMEM = {
|
||||
&CmndFullTopic, &CmndPrefix, &CmndGroupTopic, &CmndTopic, &CmndPublish, &CmndMqttlog,
|
||||
&CmndButtonTopic, &CmndSwitchTopic, &CmndButtonRetain, &CmndSwitchRetain, &CmndPowerRetain, &CmndSensorRetain,
|
||||
&CmndInfoRetain, &CmndStateRetain
|
||||
#endif // FIRMWARE_MINIMAL
|
||||
#endif // FIRMWARE_MINIMAL_ONLY
|
||||
};
|
||||
|
||||
struct MQTT {
|
||||
|
@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#ifdef ESP32
|
||||
#ifdef USE_ESP32_SENSORS
|
||||
#ifndef CONFIG_IDF_TARGET_ESP32S3
|
||||
/*********************************************************************************************\
|
||||
* ESP32 CPU Temperature and optional Hall Effect sensor
|
||||
@ -140,4 +141,5 @@ bool Xsns127(uint8_t function) {
|
||||
}
|
||||
|
||||
#endif // Not CONFIG_IDF_TARGET_ESP32S3
|
||||
#endif // USE_ESP32_SENSORS
|
||||
#endif // ESP32
|
||||
|
Loading…
x
Reference in New Issue
Block a user