Merge pull request #4163 from tonhuisman/feature/feature-defines-and-improvements

[Build] Rename more Feature_flag defines and some additions
This commit is contained in:
TD-er
2022-07-29 22:01:04 +02:00
committed by GitHub
80 changed files with 323 additions and 253 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
; **** Frequently used build flags:
; Use custom.h file to override default settings for ESPeasy: -D USE_CUSTOM_H
; Set VCC mode to measure Vcc of ESP chip : -D FEATURE_ADC_VCC=true
; Set VCC mode to measure Vcc of ESP chip : -D FEATURE_ADC_VCC=1
; Build Flags:
; -DUSE_CONFIG_OVERRIDE
+15 -15
View File
@@ -252,7 +252,7 @@ platform = ${regular_platform.platform}
platform_packages = ${regular_platform.platform_packages}
build_flags = ${regular_platform.build_flags}
${esp8266_1M.build_flags}
-D FEATURE_ADC_VCC=true
-D FEATURE_ADC_VCC=1
lib_ignore = ${regular_platform.lib_ignore}
SD(esp8266)
SD
@@ -265,7 +265,7 @@ platform = ${regular_platform_alt_wifi.platform}
platform_packages = ${regular_platform_alt_wifi.platform_packages}
build_flags = ${regular_platform_alt_wifi.build_flags}
${esp8266_1M.build_flags}
-D FEATURE_ADC_VCC=true
-D FEATURE_ADC_VCC=1
lib_ignore = ${regular_platform_alt_wifi.lib_ignore}
SD(esp8266)
SD
@@ -306,7 +306,7 @@ platform = ${regular_platform.platform}
platform_packages = ${regular_platform.platform_packages}
build_flags = ${regular_platform.build_flags}
${esp8266_4M1M.build_flags}
-D FEATURE_ADC_VCC=true
-D FEATURE_ADC_VCC=1
[env:normal_alt_wifi_ESP8266_4M1M]
extends = esp8266_4M1M
@@ -544,63 +544,63 @@ build_flags = ${collection_ESP8266_4M1M.build_flags}
[env:collection_A_ESP8266_4M1M_VCC]
extends = collection_ESP8266_4M1M
build_flags = ${collection_ESP8266_4M1M.build_flags}
-DFEATURE_ADC_VCC=true
-DFEATURE_ADC_VCC=1
-DCOLLECTION_USE_RTTTL
[env:collection_B_ESP8266_4M1M_VCC]
extends = collection_ESP8266_4M1M
build_flags = ${collection_ESP8266_4M1M.build_flags}
-DFEATURE_ADC_VCC=true
-DFEATURE_ADC_VCC=1
-DPLUGIN_BUILD_COLLECTION_B
[env:collection_C_ESP8266_4M1M_VCC]
extends = collection_ESP8266_4M1M
build_flags = ${collection_ESP8266_4M1M.build_flags}
-DFEATURE_ADC_VCC=true
-DFEATURE_ADC_VCC=1
-DPLUGIN_BUILD_COLLECTION_C
-DCOLLECTION_USE_RTTTL
[env:collection_D_ESP8266_4M1M_VCC]
extends = collection_ESP8266_4M1M
build_flags = ${collection_ESP8266_4M1M.build_flags}
-DFEATURE_ADC_VCC=true
-DFEATURE_ADC_VCC=1
-DPLUGIN_BUILD_COLLECTION_D
-DCOLLECTION_USE_RTTTL
[env:collection_E_ESP8266_4M1M_VCC]
extends = collection_ESP8266_4M1M
build_flags = ${collection_ESP8266_4M1M.build_flags}
-DFEATURE_ADC_VCC=true
-DFEATURE_ADC_VCC=1
-DPLUGIN_BUILD_COLLECTION_E
-DCOLLECTION_USE_RTTTL
;[env:collection_A_alt_wifi_ESP8266_4M1M_VCC]
;extends = collection_alt_wifi_ESP8266_4M1M
;build_flags = ${collection_alt_wifi_ESP8266_4M1M.build_flags}
; -DFEATURE_ADC_VCC=true
; -DFEATURE_ADC_VCC=1
;[env:collection_B_alt_wifi_ESP8266_4M1M_VCC]
;extends = collection_alt_wifi_ESP8266_4M1M
;build_flags = ${collection_alt_wifi_ESP8266_4M1M.build_flags}
; -DFEATURE_ADC_VCC=true
; -DFEATURE_ADC_VCC=1
; -DPLUGIN_BUILD_COLLECTION_B
;[env:collection_C_alt_wifi_ESP8266_4M1M_VCC]
;extends = collection_alt_wifi_ESP8266_4M1M
;build_flags = ${collection_alt_wifi_ESP8266_4M1M.build_flags}
; -DFEATURE_ADC_VCC=true
; -DFEATURE_ADC_VCC=1
; -DPLUGIN_BUILD_COLLECTION_C
;[env:collection_D_alt_wifi_ESP8266_4M1M_VCC]
;extends = collection_alt_wifi_ESP8266_4M1M
;build_flags = ${collection_alt_wifi_ESP8266_4M1M.build_flags}
; -DFEATURE_ADC_VCC=true
; -DFEATURE_ADC_VCC=1
; -DPLUGIN_BUILD_COLLECTION_D
;[env:collection_E_alt_wifi_ESP8266_4M1M_VCC]
;extends = collection_alt_wifi_ESP8266_4M1M
;build_flags = ${collection_alt_wifi_ESP8266_4M1M.build_flags}
; -DFEATURE_ADC_VCC=true
; -DFEATURE_ADC_VCC=1
; -DPLUGIN_BUILD_COLLECTION_E
@@ -612,8 +612,8 @@ build_flags = ${collection_ESP8266_4M1M.build_flags}
;platform_packages = ${collection.platform_packages}
;build_flags = ${collection.build_flags}
; ${esp8266_4M1M.build_flags}
; -DFEATURE_ADC_VCC=true
; -DFEATURE_MDNS
; -DFEATURE_ADC_VCC=1
; -DFEATURE_MDNS=1
; -DFEATURE_SD=1
; -DLIMIT_BUILD_SIZE
;lib_ignore = ESP32_ping
+1 -1
View File
@@ -121,6 +121,6 @@ extends = esp8266_4M1M
platform = ${regular_platform.platform}
platform_packages = ${regular_platform.platform_packages}
lib_ignore = ${regular_platform.lib_ignore}
build_flags = ${esp8266_4M1M.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DUSE_NON_STANDARD_24_TASKS -DTASKS_MAX=24
build_flags = ${esp8266_4M1M.build_flags} -DMEMORY_ANALYSIS -DPLUGIN_BUILD_CUSTOM -w -DFEATURE_NON_STANDARD_24_TASKS=1 -DTASKS_MAX=24
extra_scripts = pre:tools/pio/pre_memanalyze.py
pre:tools/pio/generate-compiletime-defines.py
+1 -1
View File
@@ -293,7 +293,7 @@ static const char DATA_ESPEASY_DEFAULT_MIN_CSS[] PROGMEM = {
#######################################################################################################
*/
// #define USE_NON_STANDARD_24_TASKS
// #define FEATURE_NON_STANDARD_24_TASKS 1
/*
#######################################################################################################
+1 -1
View File
@@ -13,7 +13,7 @@
//enable reporting status to ESPEasy developers.
//this informs us of crashes and stability issues.
// not finished yet!
// #define FEATURE_REPORTING
// #define FEATURE_REPORTING 1
//Select which plugin sets you want to build.
//These are normally automaticly set via the Platformio build environment.
+1 -1
View File
@@ -237,7 +237,7 @@ extern const String EMPTY_STRING;
// Please note that the TOUT pin has to be disconnected in this mode
// Use the "System Info" device to read the VCC value
#ifndef FEATURE_ADC_VCC
#define FEATURE_ADC_VCC false
#define FEATURE_ADC_VCC 0
#endif
#ifndef ARDUINO_OTA_PORT
+2 -2
View File
@@ -182,7 +182,7 @@ boolean Plugin_026(uint8_t function, struct EventStruct *event, String& string)
success = true;
break;
}
#ifdef USES_PACKED_RAW_DATA
#if FEATURE_PACKED_RAW_DATA
case PLUGIN_GET_PACKED_RAW_DATA:
{
// Matching JS code:
@@ -205,7 +205,7 @@ boolean Plugin_026(uint8_t function, struct EventStruct *event, String& string)
success = true;
break;
}
#endif // USES_PACKED_RAW_DATA
#endif // if FEATURE_PACKED_RAW_DATA
}
return success;
}
+2 -2
View File
@@ -521,7 +521,7 @@ boolean Plugin_082(uint8_t function, struct EventStruct *event, String& string)
break;
}
# ifdef USES_PACKED_RAW_DATA
# if FEATURE_PACKED_RAW_DATA
case PLUGIN_GET_PACKED_RAW_DATA:
{
P082_data_struct *P082_data =
@@ -550,7 +550,7 @@ boolean Plugin_082(uint8_t function, struct EventStruct *event, String& string)
}
break;
}
# endif // USES_PACKED_RAW_DATA
# endif // if FEATURE_PACKED_RAW_DATA
}
return success;
}
+2 -2
View File
@@ -295,7 +295,7 @@ boolean Plugin_085(uint8_t function, struct EventStruct *event, String& string)
}
break;
}
# ifdef USES_PACKED_RAW_DATA
# if FEATURE_PACKED_RAW_DATA
case PLUGIN_GET_PACKED_RAW_DATA:
{
// FIXME TD-er: Same code as in P102, share in LoRa code.
@@ -318,7 +318,7 @@ boolean Plugin_085(uint8_t function, struct EventStruct *event, String& string)
}
break;
}
# endif // USES_PACKED_RAW_DATA
# endif // if FEATURE_PACKED_RAW_DATA
}
return success;
}
+2 -2
View File
@@ -309,7 +309,7 @@ boolean Plugin_102(uint8_t function, struct EventStruct *event, String& string)
break;
}
#ifdef USES_PACKED_RAW_DATA
#if FEATURE_PACKED_RAW_DATA
case PLUGIN_GET_PACKED_RAW_DATA:
{
// Matching JS code:
@@ -337,7 +337,7 @@ boolean Plugin_102(uint8_t function, struct EventStruct *event, String& string)
success = true;
break;
}
#endif // USES_PACKED_RAW_DATA
#endif // if FEATURE_PACKED_RAW_DATA
+4 -4
View File
@@ -16,9 +16,9 @@
// Written by José Araújo (josemariaaraujo@gmail.com),
// with most code copied from plugin 085: _P085_AcuDC243.ino
# ifndef USES_MODBUS
# if !FEATURE_MODBUS
# error This code needs MODBUS library, it should be enabled in 'define_plugin_sets.h', or your 'custom.h'
# endif // ifndef USES_MODBUS
# endif // if !FEATURE_MODBUS
/*
DF - Below doesn't look right; needs a RS485 to TTL(3.3v) level converter (see https://github.com/reaper7/SDM_Energy_Meter)
@@ -255,7 +255,7 @@ boolean Plugin_108(uint8_t function, struct EventStruct *event, String& string)
break;
}
# ifdef USES_PACKED_RAW_DATA
# if FEATURE_PACKED_RAW_DATA
case PLUGIN_GET_PACKED_RAW_DATA:
{
// FIXME TD-er: Same code as in P102, share in LoRa code.
@@ -278,7 +278,7 @@ boolean Plugin_108(uint8_t function, struct EventStruct *event, String& string)
}
break;
}
# endif // USES_PACKED_RAW_DATA
# endif // if FEATURE_PACKED_RAW_DATA
}
return success;
}
+3 -3
View File
@@ -1,6 +1,6 @@
// not finished yet
#ifdef FEATURE_REPORTING
#if defined(FEATURE_REPORTING) && FEATURE_REPORTING
#include <ArduinoJson.h>
@@ -8,7 +8,7 @@
// NO, too big: #include <ESP8266HTTPClient.h>
#define REPORT_HOST "espeasy.datux.nl"
#define FEATURE_REPORTING
#define FEATURE_REPORTING 1
void ReportStatus()
{
@@ -94,4 +94,4 @@ void ReportStatus()
}
*/
#endif // ifdef FEATURE_REPORTING
#endif // if defined(FEATURE_REPORTING) && FEATURE_REPORTING
+11 -11
View File
@@ -5,10 +5,10 @@
#include "../../_Plugin_Helper.h"
#include "../Globals/Settings.h"
#ifdef USES_BLYNK
#if FEATURE_BLYNK
# include "../Commands/Blynk.h"
# include "../Commands/Blynk_c015.h"
#endif // ifdef USES_BLYNK
#endif // if FEATURE_BLYNK
#include "../Commands/Common.h"
#include "../Commands/Controller.h"
@@ -17,12 +17,12 @@
#include "../Commands/HTTP.h"
#include "../Commands/i2c.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
# include "../Commands/MQTT.h"
#endif // USES_MQTT
#endif // if FEATURE_MQTT
#include "../Commands/Networks.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
#include "../Commands/Notifications.h"
#endif
#include "../Commands/Provisioning.h"
@@ -367,7 +367,7 @@ bool executeInternalCommand(command_case_data & data)
case 'n': {
COMMAND_CASE_R( "name", Command_Settings_Name, 1); // Settings.h
COMMAND_CASE_R("nosleep", Command_System_NoSleep, 1); // System.h
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
COMMAND_CASE_R( "notify", Command_Notifications_Notify, 2); // Notifications.h
#endif
COMMAND_CASE_R("ntphost", Command_NTPHost, 1); // Time.h
@@ -390,7 +390,7 @@ bool executeInternalCommand(command_case_data & data)
#if FEATURE_CUSTOM_PROVISIONING
COMMAND_CASE_A( "provisionconfig", Command_Provisioning_Config, 0); // Provisioning.h
COMMAND_CASE_A( "provisionsecurity", Command_Provisioning_Security, 0); // Provisioning.h
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
COMMAND_CASE_A( "provisionnotification", Command_Provisioning_Notification, 0); // Provisioning.h
#endif
COMMAND_CASE_A( "provisionprovision", Command_Provisioning_Provision, 0); // Provisioning.h
@@ -398,9 +398,9 @@ bool executeInternalCommand(command_case_data & data)
COMMAND_CASE_A( "provisionfirmware", Command_Provisioning_Firmware, 1); // Provisioning.h
#endif
COMMAND_CASE_A( "pulse", Command_GPIO_Pulse, 3); // GPIO.h
#ifdef USES_MQTT
#if FEATURE_MQTT
COMMAND_CASE_A( "publish", Command_MQTT_Publish, 2); // MQTT.h
#endif // USES_MQTT
#endif // if FEATURE_MQTT
COMMAND_CASE_A( "pwm", Command_GPIO_PWM, 4); // GPIO.h
break;
}
@@ -436,9 +436,9 @@ bool executeInternalCommand(command_case_data & data)
}
COMMAND_CASE_A("status", Command_GPIO_Status, 2); // GPIO.h
COMMAND_CASE_R("subnet", Command_Subnet, 1); // Network Command
#ifdef USES_MQTT
#if FEATURE_MQTT
COMMAND_CASE_A("subscribe", Command_MQTT_Subscribe, 1); // MQTT.h
#endif // USES_MQTT
#endif // if FEATURE_MQTT
#ifndef BUILD_NO_DIAGNOSTIC_COMMANDS
COMMAND_CASE_A( "sysload", Command_SysLoad, 0); // Diagnostic.h
#endif // ifndef BUILD_NO_DIAGNOSTIC_COMMANDS
+2 -2
View File
@@ -1,7 +1,7 @@
#include "../../ESPEasy_common.h"
#include "../Globals/MQTT.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
@@ -117,4 +117,4 @@ const __FlashStringHelper * Command_MQTT_Subscribe(struct EventStruct *event, co
}
#endif // ifdef USES_MQTT
#endif // if FEATURE_MQTT
+2 -2
View File
@@ -3,7 +3,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
#include <Arduino.h>
@@ -13,6 +13,6 @@ const __FlashStringHelper * Command_MQTT_Publish(struct EventStruct *event,
const __FlashStringHelper * Command_MQTT_Subscribe(struct EventStruct *event,
const char* Line);
#endif // ifdef USES_MQTT
#endif // if FEATURE_MQTT
#endif // COMMAND_MQTT_H
+1 -1
View File
@@ -1,6 +1,6 @@
#include "../Commands/Notifications.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
#include "../Commands/Common.h"
+1 -1
View File
@@ -3,7 +3,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
const __FlashStringHelper * Command_Notifications_Notify(struct EventStruct *event, const char* Line);
+1 -1
View File
@@ -19,7 +19,7 @@ String Command_Provisioning_Security(struct EventStruct *event, const char *Line
return downloadFileType(FileType::SECURITY_DAT);
}
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
String Command_Provisioning_Notification(struct EventStruct *event, const char *Line)
{
return downloadFileType(FileType::NOTIFICATION_DAT);
+1 -1
View File
@@ -11,7 +11,7 @@ String Command_Provisioning_Config(struct EventStruct *event,
const char *Line);
String Command_Provisioning_Security(struct EventStruct *event,
const char *Line);
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
String Command_Provisioning_Notification(struct EventStruct *event,
const char *Line);
#endif
@@ -12,7 +12,7 @@ C018_queue_element::C018_queue_element(struct EventStruct *event, uint8_t sample
TaskIndex(event->TaskIndex),
controller_idx(event->ControllerIndex)
{
# ifdef USES_PACKED_RAW_DATA
# if FEATURE_PACKED_RAW_DATA
#ifdef USE_SECOND_HEAP
// HeapSelectIram ephemeral;
#endif
@@ -24,7 +24,7 @@ C018_queue_element::C018_queue_element(struct EventStruct *event, uint8_t sample
log += packed;
addLogMove(LOG_LEVEL_INFO, log);
}
# endif // USES_PACKED_RAW_DATA
# endif // if FEATURE_PACKED_RAW_DATA
}
size_t C018_queue_element::getSize() const {
@@ -5,7 +5,7 @@
#include "../Globals/ESPEasy_Scheduler.h"
#include "../Helpers/PeriodicalActions.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
ControllerDelayHandlerStruct<MQTT_queue_element> *MQTTDelayHandler = nullptr;
bool init_mqtt_delay_queue(controllerIndex_t ControllerIndex, String& pubname, bool& retainFlag) {
@@ -39,7 +39,7 @@ void exit_mqtt_delay_queue() {
}
}
#endif // USES_MQTT
#endif // if FEATURE_MQTT
/*********************************************************************************************\
+2 -2
View File
@@ -26,13 +26,13 @@
//
#ifdef USES_MQTT
#if FEATURE_MQTT
# include "../ControllerQueue/MQTT_queue_element.h"
extern ControllerDelayHandlerStruct<MQTT_queue_element> *MQTTDelayHandler;
bool init_mqtt_delay_queue(controllerIndex_t ControllerIndex, String& pubname, bool& retainFlag);
void exit_mqtt_delay_queue();
#endif // USES_MQTT
#endif // if FEATURE_MQTT
/*********************************************************************************************\
@@ -1,6 +1,6 @@
#include "../ControllerQueue/MQTT_queue_element.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
MQTT_queue_element::MQTT_queue_element(int ctrl_idx,
taskIndex_t TaskIndex,
@@ -67,4 +67,4 @@ void MQTT_queue_element::removeEmptyTopics() {
_topic.replace(F("//"), F("/"));
}
}
#endif // USES_MQTT
#endif // if FEATURE_MQTT
+2 -2
View File
@@ -3,7 +3,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
#include "../DataStructs/UnitMessageCount.h"
#include "../Globals/CPlugins.h"
@@ -54,6 +54,6 @@ public:
UnitMessageCount_t UnitMessageCount;
};
#endif // USES_MQTT
#endif // if FEATURE_MQTT
#endif // CONTROLLERQUEUE_MQTT_QUEUE_ELEMENT_H
+1 -1
View File
@@ -13,7 +13,7 @@
// Performing a 2-stage define assignment using the _TMP defines
// See: https://github.com/letscontrolit/ESPEasy/issues/2621
#ifdef USE_NON_STANDARD_24_TASKS
#if FEATURE_NON_STANDARD_24_TASKS
#define TASKS_MAX_TMP 24
#else
#define TASKS_MAX_TMP 12
+3 -3
View File
@@ -118,7 +118,7 @@
#if defined(ESP8266)
# ifdef USE_NON_STANDARD_24_TASKS
# if FEATURE_NON_STANDARD_24_TASKS
# ifndef DAT_OFFSET_TASKS
# define DAT_OFFSET_TASKS 4096 // 0x1000 each task = 2k, (1024 basic + 1024 bytes custom)
# endif // ifndef DAT_OFFSET_TASKS
@@ -132,7 +132,7 @@
# define CONFIG_FILE_SIZE 65536
# endif // ifndef CONFIG_FILE_SIZE
# else // ifdef USE_NON_STANDARD_24_TASKS
# else // if FEATURE_NON_STANDARD_24_TASKS
# ifndef DAT_OFFSET_TASKS
# define DAT_OFFSET_TASKS 4096 // each task = 2k, (1024 basic + 1024 bytes custom), 12 max
@@ -153,7 +153,7 @@
# define CONFIG_FILE_SIZE 65536
# endif // ifndef CONFIG_FILE_SIZE
# endif
# endif // ifdef USE_NON_STANDARD_24_TASKS
# endif // if FEATURE_NON_STANDARD_24_TASKS
#endif // if defined(ESP8266)
#if defined(ESP32)
@@ -120,6 +120,54 @@
# undef USE_I2C_DEVICE_SCAN
#endif // if USE_I2C_DEVICE_SCAN
#if defined(FEATURE_MDNS) && (2 - FEATURE_MDNS - 2 == 4) // 'Defined but empty' check
# warning "Custom.h has '#define FEATURE_MDNS' to be replaced with '#define FEATURE_MDNS 1', see https://github.com/letscontrolit/ESPEasy/pull/4153"
# undef FEATURE_MDNS
# define FEATURE_MDNS 1
#endif // if defined(FEATURE_MDNS) && (2-FEATURE_MDNS-2 == 4)
#if FEATURE_NOTIFIER
# warning "Custom.h has '#define USES_NOTIFIER' to be replaced with '#define FEATURE_NOTIFIER 1', see https://github.com/letscontrolit/ESPEasy/pull/4153"
# define FEATURE_NOTIFIER 1
# undef USES_NOTIFIER
#endif // if FEATURE_NOTIFIER
#ifdef USES_MODBUS
# warning "Custom.h has '#define USES_MODBUS' to be replaced with '#define FEATURE_MODBUS 1', see https://github.com/letscontrolit/ESPEasy/pull/4153"
# define FEATURE_MODBUS 1
# undef USES_MODBUS
#endif // ifdef USES_MODBUS
#ifdef USE_NON_STANDARD_24_TASKS
# warning "Custom.h has '#define USE_NON_STANDARD_24_TASKS' to be replaced with '#define FEATURE_NON_STANDARD_24_TASKS 1', see https://github.com/letscontrolit/ESPEasy/pull/4153"
# define FEATURE_NON_STANDARD_24_TASKS 1
# undef USE_NON_STANDARD_24_TASKS
#endif // ifdef USE_NON_STANDARD_24_TASKS
#ifdef USES_PACKED_RAW_DATA
# warning "Custom.h has '#define USES_PACKED_RAW_DATA' to be replaced with '#define FEATURE_PACKED_RAW_DATA 1', see https://github.com/letscontrolit/ESPEasy/pull/4153"
# define FEATURE_PACKED_RAW_DATA 1
# undef USES_PACKED_RAW_DATA
#endif // ifdef USES_PACKED_RAW_DATA
#ifdef USES_BLYNK
# warning "Custom.h has '#define USES_BLYNK' to be replaced with '#define FEATURE_BLYNK 1', see https://github.com/letscontrolit/ESPEasy/pull/4153"
# define FEATURE_BLYNK 1
# undef USES_BLYNK
#endif // ifdef USES_BLYNK
#if defined(FEATURE_REPORTING) && (2 - FEATURE_REPORTING - 2 == 4) // 'Defined but empty' check
# warning "Custom.h has '#define FEATURE_REPORTING' to be replaced with '#define FEATURE_REPORTING 1', see https://github.com/letscontrolit/ESPEasy/pull/4153"
# undef FEATURE_REPORTING
# define FEATURE_REPORTING 1
#endif // if defined(FEATURE_REPORTING) && (2-FEATURE_REPORTING-2 == 4)
#if defined(FEATURE_DNS_SERVER) && (2 - FEATURE_DNS_SERVER - 2 == 4) // 'Defined but empty' check
# warning "Custom.h has '#define FEATURE_DNS_SERVER' to be replaced with '#define FEATURE_DNS_SERVER 1', see https://github.com/letscontrolit/ESPEasy/pull/4153"
# undef FEATURE_DNS_SERVER
# define FEATURE_DNS_SERVER 1
#endif // if defined(FEATURE_DNS_SERVER) && (2-FEATURE_DNS_SERVER-2 == 4)
/* *INDENT-ON* */
#endif // ifndef CUSTOMBUILD_CHECK_DEFINES_CUSTOM_H
+29 -19
View File
@@ -318,17 +318,17 @@ To create/register a plugin, you have to :
#endif
#endif
#ifdef FEATURE_FHEM
#if FEATURE_FHEM
#define USES_C009 // FHEM HTTP
#endif
#ifdef FEATURE_HOMEASSISTANT_OPENHAB
#if FEATURE_HOMEASSISTANT_OPENHAB
#define USES_C005 // Home Assistant (openHAB) MQTT
#endif
#ifdef PLUGIN_BUILD_MINIMAL_OTA
// Disable ESPEasy p2p for minimal OTA builds.
#ifdef FEATURE_ESPEASY_P2P
#if FEATURE_ESPEASY_P2P
#undef FEATURE_ESPEASY_P2P
#define FEATURE_ESPEASY_P2P 0
#endif
@@ -390,9 +390,11 @@ To create/register a plugin, you have to :
#if FEATURE_SERVO
#undef FEATURE_SERVO
#define FEATURE_SERVO 0
#endif
#if FEATURE_RTTTL
#undef FEATURE_RTTTL
#define FEATURE_RTTTL 0
#endif
#endif
@@ -1412,10 +1414,12 @@ To create/register a plugin, you have to :
#if FEATURE_PLUGIN_STATS && defined(ESP8266)
// Does not fit in build
#undef FEATURE_PLUGIN_STATS
#define FEATURE_PLUGIN_STATS 0
#endif
#if FEATURE_CHART_JS && defined(ESP8266)
// Does not fit in build
#undef FEATURE_CHART_JS
#define FEATURE_CHART_JS 0
#endif
#endif
@@ -1743,12 +1747,12 @@ To create/register a plugin, you have to :
#if defined(USES_C018)
#define USES_PACKED_RAW_DATA
#define FEATURE_PACKED_RAW_DATA 1
#endif
#if defined(USES_P085) || defined (USES_P052) || defined(USES_P078) || defined(USES_P108)
// FIXME TD-er: Is this correct? Those plugins use Modbus_RTU.
#define USES_MODBUS
#define FEATURE_MODBUS 1
#endif
#if defined(USES_C001) || defined (USES_C002) || defined(USES_P029)
@@ -1777,7 +1781,7 @@ To create/register a plugin, you have to :
// VCC builds need a bit more, disable timing stats to make it fit.
#ifndef PLUGIN_BUILD_CUSTOM
#if defined(FEATURE_ADC_VCC) && !defined(PLUGIN_SET_MAX)
#if FEATURE_ADC_VCC && !defined(PLUGIN_SET_MAX)
#ifndef LIMIT_BUILD_SIZE
#define LIMIT_BUILD_SIZE
#endif
@@ -1838,16 +1842,19 @@ To create/register a plugin, you have to :
#if FEATURE_SERVO
#undef FEATURE_SERVO
#define FEATURE_SERVO 0
#endif
#if FEATURE_RTTTL
#undef FEATURE_RTTTL
#define FEATURE_RTTTL 0
#endif
#if FEATURE_TOOLTIPS
#undef FEATURE_TOOLTIPS
#define FEATURE_TOOLTIPS 0
#endif
#ifdef USES_BLYNK
#undef USES_BLYNK
#if FEATURE_BLYNK
#undef FEATURE_BLYNK
#define FEATURE_BLYNK 0
#endif
#if !defined(PLUGIN_SET_COLLECTION) && !defined(PLUGIN_SET_SONOFF_POW)
#ifdef USES_P076
@@ -1877,6 +1884,7 @@ To create/register a plugin, you have to :
#endif
#if FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES && !defined(KEEP_TRIGONOMETRIC_FUNCTIONS_RULES)
#undef FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES
#define FEATURE_TRIGONOMETRIC_FUNCTIONS_RULES 0
#endif
#if FEATURE_SSDP
#undef FEATURE_SSDP
@@ -1884,9 +1892,11 @@ To create/register a plugin, you have to :
#endif
#if FEATURE_PLUGIN_STATS
#undef FEATURE_PLUGIN_STATS
#define FEATURE_PLUGIN_STATS 0
#endif
#if FEATURE_CHART_JS
#undef FEATURE_CHART_JS
#define FEATURE_CHART_JS 0
#endif
#endif
@@ -1927,18 +1937,18 @@ To create/register a plugin, you have to :
#endif
#if defined(USES_C002) || defined (USES_C005) || defined(USES_C006) || defined(USES_C014) || defined(USES_P037)
#define USES_MQTT
#define FEATURE_MQTT 1
#endif
#if defined(USES_C012) || defined (USES_C015)
#define USES_BLYNK
#define FEATURE_BLYNK 1
#endif
// Specific notifier plugins may be enabled via Custom.h, regardless
// whether NOTIFIER_SET_NONE is defined
#if defined(USES_N001) || defined(USES_N002)
#ifndef USES_NOTIFIER
#define USES_NOTIFIER
#ifndef FEATURE_NOTIFIER
#define FEATURE_NOTIFIER 1
#endif
#endif
@@ -1950,16 +1960,16 @@ To create/register a plugin, you have to :
#endif
#endif
#ifdef USES_MQTT
#if FEATURE_MQTT
// MQTT_MAX_PACKET_SIZE : Maximum packet size
#ifndef MQTT_MAX_PACKET_SIZE
#define MQTT_MAX_PACKET_SIZE 1024 // Is also used in PubSubClient
#endif
#endif //USES_MQTT
#endif //if FEATURE_MQTT
// It may have gotten undefined to fit a build. Make sure the Blynk controllers are not defined
#ifndef USES_BLYNK
#if !FEATURE_BLYNK
#ifdef USES_C012
#undef USES_C012
#endif
@@ -1970,20 +1980,20 @@ To create/register a plugin, you have to :
#if FEATURE_ARDUINO_OTA
#ifndef FEATURE_MDNS
#define FEATURE_MDNS
#define FEATURE_MDNS 1
#endif
#endif
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
#ifndef FEATURE_DNS_SERVER
#define FEATURE_DNS_SERVER
#define FEATURE_DNS_SERVER 1
#endif
#endif
#ifdef WEBSERVER_SETUP
#ifndef PLUGIN_BUILD_MINIMAL_OTA
#ifndef FEATURE_DNS_SERVER
#define FEATURE_DNS_SERVER
#define FEATURE_DNS_SERVER 1
#endif
#endif
#endif
+1 -1
View File
@@ -65,7 +65,7 @@ public:
EventValueSource::Enum Source = EventValueSource::Enum::VALUE_SOURCE_NOT_SET;
taskIndex_t TaskIndex = INVALID_TASK_INDEX; // index position in TaskSettings array, 0-11
controllerIndex_t ControllerIndex = INVALID_CONTROLLER_INDEX; // index position in Settings.Controller, 0-3
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
notifierIndex_t NotificationIndex = INVALID_NOTIFIER_INDEX; // index position in Settings.Notification, 0-3
#endif
uint8_t BaseVarIndex = 0;
+3 -2
View File
@@ -1,10 +1,11 @@
#include "../DataStructs/Modbus.h"
#ifdef USES_MODBUS
#if FEATURE_MODBUS
#include "../DataStructs/ControllerSettingsStruct.h"
#include "../ESPEasyCore/ESPEasy_Log.h"
Modbus::Modbus() : ModbusClient(nullptr), errcnt(0), timeout(0),
TXRXstate(MODBUS_IDLE), RXavailable(0), payLoad(0) {}
@@ -242,4 +243,4 @@ bool Modbus::tryRead(uint8_t ModbusID, uint16_t M_register, MODBUS_registerType
return false;
}
#endif // USES_MODBUS
#endif // FEATURE_MODBUS
+2 -2
View File
@@ -3,7 +3,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_MODBUS
#if FEATURE_MODBUS
enum MODBUS_states_t { MODBUS_IDLE, MODBUS_RECEIVE, MODBUS_RECEIVE_PAYLOAD };
enum MODBUS_registerTypes_t { signed16, unsigned16, signed32, unsigned32, signed64, unsigned64 };
@@ -79,6 +79,6 @@ private:
};
#endif // ifdef USES_MODBUS
#endif // if FEATURE_MODBUS
#endif // ifndef DATASTRUCTS_MODBUS_H
@@ -1,6 +1,6 @@
#include "../DataStructs/NotificationSettingsStruct.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
NotificationSettingsStruct::NotificationSettingsStruct() : Port(0), Pin1(-1), Pin2(-1) {
ZERO_FILL(Server);
@@ -3,7 +3,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
#include <Arduino.h>
#include <memory> // For std::shared_ptr
+1 -1
View File
@@ -3,7 +3,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
/*********************************************************************************************\
* NotificationStruct
+1 -1
View File
@@ -39,7 +39,7 @@
#define PLUGIN_MONITOR 30 // Replaces PLUGIN_UNCONDITIONAL_POLL
#define PLUGIN_SET_DEFAULTS 31 // Called when assigning a plugin to a task, to set some default config.
#define PLUGIN_GET_PACKED_RAW_DATA 32 // Return all data in a compact binary format specific for that plugin.
// Needs USES_PACKED_RAW_DATA
// Needs FEATURE_PACKED_RAW_DATA
#define PLUGIN_ONLY_TIMER_IN 33 // Similar to PLUGIN_TIMER_IN, addressed to a plugin instead of a task.
#define PLUGIN_WEBFORM_SHOW_I2C_PARAMS 34 // Show I2C parameters like address.
#define PLUGIN_WEBFORM_SHOW_SERIAL_PARAMS 35 // When needed, show additional parameters like baudrate or specific serial config
+2 -2
View File
@@ -16,7 +16,7 @@ const __FlashStringHelper * SettingsType::getSettingsTypeString(Enum settingsTyp
case Enum::ControllerSettings_Type: return F("ControllerSettings");
case Enum::CustomControllerSettings_Type: return F("CustomControllerSettings");
case Enum::NotificationSettings_Type:
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
return F("NotificationSettings");
#else
break;
@@ -83,7 +83,7 @@ bool SettingsType::getSettingsParameters(Enum settingsType, int index, int& max_
}
case Enum::NotificationSettings_Type:
{
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
max_index = NOTIFICATION_MAX;
offset = index * (DAT_NOTIFICATION_SIZE);
max_size = DAT_NOTIFICATION_SIZE;
+6 -6
View File
@@ -106,7 +106,7 @@ bool validUserVar(struct EventStruct *event) {
return true;
}
#ifdef USES_MQTT
#if FEATURE_MQTT
/*********************************************************************************************\
* Handle incoming MQTT messages
@@ -433,7 +433,7 @@ String getLWT_messageDisconnect(const ControllerSettingsStruct& ControllerSettin
return LWTMessageDisconnect;
}
#endif // USES_MQTT
#endif // if FEATURE_MQTT
/*********************************************************************************************\
* Send status info to request source
@@ -473,11 +473,11 @@ void SendStatus(struct EventStruct *event, const String& status)
printWebString += status;
}
break;
#ifdef USES_MQTT
#if FEATURE_MQTT
case EventValueSource::Enum::VALUE_SOURCE_MQTT:
MQTTStatus(event, status);
break;
#endif // USES_MQTT
#endif // if FEATURE_MQTT
case EventValueSource::Enum::VALUE_SOURCE_SERIAL:
serialPrintln(status);
break;
@@ -487,7 +487,7 @@ void SendStatus(struct EventStruct *event, const String& status)
}
}
#ifdef USES_MQTT
#if FEATURE_MQTT
bool MQTT_queueFull(controllerIndex_t controller_idx) {
if (MQTTDelayHandler == nullptr) {
return true;
@@ -579,7 +579,7 @@ void MQTTStatus(struct EventStruct *event, const String& status)
}
}
#endif // USES_MQTT
#endif // if FEATURE_MQTT
/*********************************************************************************************\
+4 -4
View File
@@ -13,7 +13,7 @@ void sendData(struct EventStruct *event);
bool validUserVar(struct EventStruct *event);
#ifdef USES_MQTT
#if FEATURE_MQTT
/*********************************************************************************************\
* Handle incoming MQTT messages
\*********************************************************************************************/
@@ -45,7 +45,7 @@ String getLWT_messageConnect(const ControllerSettingsStruct& ControllerSettings)
String getLWT_messageDisconnect(const ControllerSettingsStruct& ControllerSettings);
#endif // USES_MQTT
#endif // if FEATURE_MQTT
/*********************************************************************************************\
* Send status info to request source
@@ -56,7 +56,7 @@ bool SourceNeedsStatusUpdate(EventValueSource::Enum eventSource);
void SendStatus(struct EventStruct *event, const String& status);
#ifdef USES_MQTT
#if FEATURE_MQTT
bool MQTT_queueFull(controllerIndex_t controller_idx);
bool MQTTpublish(controllerIndex_t controller_idx, taskIndex_t taskIndex, const char *topic, const char *payload, bool retained);
@@ -69,7 +69,7 @@ bool MQTTpublish(controllerIndex_t controller_idx, taskIndex_t taskIndex, Strin
* Send status info back to channel where request came from
\*********************************************************************************************/
void MQTTStatus(struct EventStruct *event, const String& status);
#endif //USES_MQTT
#endif //if FEATURE_MQTT
+3 -3
View File
@@ -1086,12 +1086,12 @@ void setAPinternal(bool enable)
#endif // ifdef ESP32
WiFiEventData.timerAPoff.setMillisFromNow(WIFI_AP_OFF_TIMER_DURATION);
} else {
#ifdef FEATURE_DNS_SERVER
#if FEATURE_DNS_SERVER
if (dnsServerActive) {
dnsServerActive = false;
dnsServer.stop();
}
#endif
#endif // if FEATURE_DNS_SERVER
}
}
@@ -1215,7 +1215,7 @@ void setWifiMode(WiFiMode_t wifimode) {
// Mode has changed
setAPinternal(new_mode_AP_enabled);
}
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
#ifdef ESP8266
// notifyAPChange() is not present in the ESP32 MDNSResponder
MDNS.notifyAPChange();
@@ -428,13 +428,13 @@ void processGotIP() {
if (node_time.systemTimePresent()) {
node_time.initTime();
}
#ifdef USES_MQTT
#if FEATURE_MQTT
mqtt_reconnect_count = 0;
MQTTclient_should_reconnect = true;
timermqtt_interval = 100;
Scheduler.setIntervalTimer(ESPEasy_Scheduler::IntervalTimer_e::TIMER_MQTT);
scheduleNextMQTTdelayQueue();
#endif // USES_MQTT
#endif // if FEATURE_MQTT
Scheduler.sendGratuitousARP_now();
if (Settings.UseRules)
@@ -491,7 +491,7 @@ void processConnectAPmode() {
addLogMove(LOG_LEVEL_INFO, log);
}
#ifdef FEATURE_DNS_SERVER
#if FEATURE_DNS_SERVER
// Start DNS, only used if the ESP has no valid WiFi config
// It will reply with it's own address on all DNS requests
// (captive portal concept)
@@ -499,7 +499,7 @@ void processConnectAPmode() {
dnsServerActive = true;
dnsServer.start(DNS_PORT, "*", apIP);
}
#endif
#endif // if FEATURE_DNS_SERVER
}
// Switch of AP mode when timeout reached and no client connected anymore.
@@ -664,13 +664,13 @@ void processEthernetGotIP() {
if (node_time.systemTimePresent()) {
node_time.initTime();
}
#ifdef USES_MQTT
#if FEATURE_MQTT
mqtt_reconnect_count = 0;
MQTTclient_should_reconnect = true;
timermqtt_interval = 100;
Scheduler.setIntervalTimer(ESPEasy_Scheduler::IntervalTimer_e::TIMER_MQTT);
scheduleNextMQTTdelayQueue();
#endif // USES_MQTT
#endif // if FEATURE_MQTT
Scheduler.sendGratuitousARP_now();
if (Settings.UseRules)
@@ -53,7 +53,7 @@ void backgroundtasks()
lastRunBackgroundTasks = millis();
START_TIMER
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
const bool networkConnected = NetworkConnected();
#else
NetworkConnected();
@@ -83,13 +83,13 @@ void backgroundtasks()
#endif
}
#ifdef FEATURE_DNS_SERVER
#if FEATURE_DNS_SERVER
// process DNS, only used if the ESP has no valid WiFi config
if (dnsServerActive) {
dnsServer.processNextRequest();
}
#endif // ifdef FEATURE_DNS_SERVER
#endif // if FEATURE_DNS_SERVER
#if FEATURE_ARDUINO_OTA
@@ -107,7 +107,7 @@ void backgroundtasks()
#endif // if FEATURE_ARDUINO_OTA
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
// Allow MDNS processing
if (networkConnected) {
@@ -117,7 +117,7 @@ void backgroundtasks()
MDNS.update();
# endif // ifdef ESP8266
}
#endif // ifdef FEATURE_MDNS
#endif // if FEATURE_MDNS
delay(0);
+2 -2
View File
@@ -138,9 +138,9 @@ void ESPEasy_loop()
// Deep sleep mode, just run all tasks one (more) time and go back to sleep as fast as possible
if ((firstLoopConnectionsEstablished || readyForSleep()) && isDeepSleepEnabled())
{
#ifdef USES_MQTT
#if FEATURE_MQTT
runPeriodicalMQTT();
#endif // USES_MQTT
#endif // if FEATURE_MQTT
// Now run all frequent tasks
run50TimesPerSecond();
run10TimesPerSecond();
+6 -6
View File
@@ -280,7 +280,7 @@ void ESPEasy_setup()
if (toDisable != 0) {
toDisable = disableController(toDisable);
}
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
if (toDisable != 0) {
toDisable = disableNotification(toDisable);
}
@@ -297,7 +297,7 @@ void ESPEasy_setup()
if (toDisable != 0) {
toDisable = disableAllControllers(toDisable);
}
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
if (toDisable != 0) {
toDisable = disableAllNotifications(toDisable);
}
@@ -380,12 +380,12 @@ void ESPEasy_setup()
#ifndef BUILD_NO_RAM_TRACKER
logMemUsageAfter(F("CPluginInit()"));
#endif
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
NPluginInit();
#ifndef BUILD_NO_RAM_TRACKER
logMemUsageAfter(F("NPluginInit()"));
#endif
#endif // ifdef USES_NOTIFIER
#endif // if FEATURE_NOTIFIER
PluginInit();
#ifndef BUILD_NO_RAM_TRACKER
@@ -453,9 +453,9 @@ void ESPEasy_setup()
#endif
#ifdef FEATURE_REPORTING
#if FEATURE_REPORTING
ReportStatus();
#endif // ifdef FEATURE_REPORTING
#endif // if FEATURE_REPORTING
#if FEATURE_ARDUINO_OTA
ArduinoOTAInit();
+2 -2
View File
@@ -2,7 +2,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
// MQTT client
@@ -13,7 +13,7 @@ bool MQTTclient_must_send_LWT_connected = false;
bool MQTTclient_connected = false;
int mqtt_reconnect_count = 0;
LongTermTimer MQTTclient_next_connect_attempt;
#endif // USES_MQTT
#endif // if FEATURE_MQTT
#ifdef USES_P037
+2 -2
View File
@@ -4,7 +4,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
# include <WiFiClient.h>
# include <PubSubClient.h>
@@ -19,7 +19,7 @@ extern bool MQTTclient_must_send_LWT_connected;
extern bool MQTTclient_connected;
extern int mqtt_reconnect_count;
extern LongTermTimer MQTTclient_next_connect_attempt;
#endif // USES_MQTT
#endif // if FEATURE_MQTT
#ifdef USES_P037
+1 -1
View File
@@ -1,6 +1,6 @@
#include "../Globals/NPlugins.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
#include "../DataStructs/ESPEasy_EventStruct.h"
#include "../DataStructs/NotificationStruct.h"
+1 -1
View File
@@ -3,7 +3,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
#include "../CustomBuild/ESPEasyLimits.h"
#include "../DataStructs/NotificationStruct.h"
+2 -2
View File
@@ -22,8 +22,8 @@
#endif
#ifdef FEATURE_DNS_SERVER
#if FEATURE_DNS_SERVER
#include <DNSServer.h>
DNSServer dnsServer;
bool dnsServerActive = false;
#endif
#endif // if FEATURE_DNS_SERVER
+3 -3
View File
@@ -4,7 +4,7 @@
#include "../../ESPEasy_common.h"
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
//enable mDNS mode (adds about 6kb ram and some bytes IRAM)
#ifdef ESP8266
#include <ESP8266mDNS.h>
@@ -49,11 +49,11 @@
#endif
#ifdef FEATURE_DNS_SERVER
#if FEATURE_DNS_SERVER
#include <DNSServer.h>
extern DNSServer dnsServer;
extern bool dnsServerActive;
#endif
#endif // if FEATURE_DNS_SERVER
#endif // GLOBALS_SERVICES_H
+2 -2
View File
@@ -109,9 +109,9 @@ void ResetFactory()
// pad files with extra zeros for future extensions
InitFile(SettingsType::SettingsFileEnum::FILE_CONFIG_type);
InitFile(SettingsType::SettingsFileEnum::FILE_SECURITY_type);
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
InitFile(SettingsType::SettingsFileEnum::FILE_NOTIFICATION_type);
#endif
#endif // if FEATURE_NOTIFIER
InitFile(getRulesFileName(0), 0);
+4 -4
View File
@@ -223,7 +223,7 @@ String BuildFixes()
}
if (Settings.Build <= 20106) {
// ClientID is now defined in the controller settings.
#ifdef USES_MQTT
#if FEATURE_MQTT
controllerIndex_t controller_idx = firstEnabledMQTT_ControllerIndex();
if (validControllerIndex(controller_idx)) {
MakeControllerSettings(ControllerSettings); //-V522
@@ -247,7 +247,7 @@ String BuildFixes()
SaveControllerSettings(controller_idx, ControllerSettings);
}
}
#endif // USES_MQTT
#endif // if FEATURE_MQTT
}
if (Settings.Build < 20107) {
Settings.WebserverPort = 80;
@@ -660,7 +660,7 @@ uint8_t disableAllControllers(uint8_t bootFailedCount) {
/********************************************************************************************\
Disable Notification, based on bootFailedCount
\*********************************************************************************************/
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
uint8_t disableNotification(uint8_t bootFailedCount) {
for (uint8_t i = 0; i < NOTIFICATION_MAX && bootFailedCount > 0; ++i) {
if (Settings.NotificationEnabled[i]) {
@@ -1159,7 +1159,7 @@ String loadProvisioningSettings(ProvisioningStruct& ProvisioningSettings)
#endif
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
/********************************************************************************************\
Save Controller settings to file system
\*********************************************************************************************/
+2 -2
View File
@@ -89,7 +89,7 @@ uint8_t disableAllControllers(uint8_t bootFailedCount);
/********************************************************************************************\
Disable Notification, based on bootFailedCount
\*********************************************************************************************/
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
uint8_t disableNotification(uint8_t bootFailedCount);
uint8_t disableAllNotifications(uint8_t bootFailedCount);
#endif
@@ -195,7 +195,7 @@ String loadProvisioningSettings(ProvisioningStruct& ProvisioningSettings);
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
/********************************************************************************************\
Save Controller settings to file system
\*********************************************************************************************/
+7 -7
View File
@@ -38,10 +38,10 @@
#include "../ControllerQueue/C016_queue_element.h"
#endif
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
#include "../DataStructs/NotificationStruct.h"
#include "../DataStructs/NotificationSettingsStruct.h"
#endif
#endif // if FEATURE_NOTIFIER
// ********************************************************************************
@@ -83,9 +83,9 @@ void run_compiletime_checks() {
#endif
check_size<SettingsStruct, SettingsStructSize>();
check_size<ControllerSettingsStruct, 820u>();
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
check_size<NotificationSettingsStruct, 996u>();
#endif
#endif // if FEATURE_NOTIFIER
check_size<ExtraTaskSettingsStruct, 536u>();
#if ESP_IDF_VERSION_MAJOR > 3
// String class has increased with 4 bytes
@@ -106,9 +106,9 @@ void run_compiletime_checks() {
check_size<LogStruct, LogStructSize>(); // Is not stored
check_size<DeviceStruct, 8u>(); // Is not stored
check_size<ProtocolStruct, 6u>();
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
check_size<NotificationStruct, 3u>();
#endif
#endif // if FEATURE_NOTIFIER
#if FEATURE_ESPEASY_P2P
#if ESP_IDF_VERSION_MAJOR > 3
// String class has increased with 4 bytes
@@ -131,7 +131,7 @@ void run_compiletime_checks() {
#endif
#if defined(USE_NON_STANDARD_24_TASKS) && defined(ESP8266)
#if FEATURE_NON_STANDARD_24_TASKS && defined(ESP8266)
static_assert(TASKS_MAX == 24, "TASKS_MAX invalid size");
#endif
+2 -2
View File
@@ -12,7 +12,7 @@
#include "../Helpers/StringProvider.h"
void set_mDNS() {
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
if (!WiFiEventData.WiFiServicesInitialized()) { return; }
@@ -46,5 +46,5 @@ void set_mDNS() {
mDNS_init = false;
#endif
}
#endif // ifdef FEATURE_MDNS
#endif // if FEATURE_MDNS
}
+1 -1
View File
@@ -100,7 +100,7 @@ void ArduinoOTAInit()
reboot(ESPEasy_Scheduler::IntendedRebootReason_e::OTA_error);
});
#if defined(ESP8266) && defined(FEATURE_MDNS)
#if defined(ESP8266) && FEATURE_MDNS
ArduinoOTA.begin(true);
#else
ArduinoOTA.begin();
+12 -12
View File
@@ -245,13 +245,13 @@ void runEach30Seconds()
}
#endif
#ifdef FEATURE_REPORTING
#if FEATURE_REPORTING
ReportStatus();
#endif
#endif // if FEATURE_REPORTING
}
#ifdef USES_MQTT
#if FEATURE_MQTT
void scheduleNextMQTTdelayQueue() {
@@ -387,7 +387,7 @@ controllerIndex_t firstEnabledMQTT_ControllerIndex() {
}
#endif //USES_MQTT
#endif //if FEATURE_MQTT
@@ -437,25 +437,25 @@ void updateLoopStats_30sec(uint8_t loglevel) {
\*********************************************************************************************/
void flushAndDisconnectAllClients() {
if (anyControllerEnabled()) {
#ifdef USES_MQTT
#if FEATURE_MQTT
bool mqttControllerEnabled = validControllerIndex(firstEnabledMQTT_ControllerIndex());
#endif //USES_MQTT
#endif //if FEATURE_MQTT
unsigned long timer = millis() + 1000;
while (!timeOutReached(timer)) {
// call to all controllers (delay queue) to flush all data.
CPluginCall(CPlugin::Function::CPLUGIN_FLUSH, 0);
#ifdef USES_MQTT
#if FEATURE_MQTT
if (mqttControllerEnabled && MQTTclient.connected()) {
MQTTclient.loop();
}
#endif //USES_MQTT
#endif //if FEATURE_MQTT
}
#ifdef USES_MQTT
#if FEATURE_MQTT
if (mqttControllerEnabled && MQTTclient.connected()) {
MQTTclient.disconnect();
updateMQTTclient_connected();
}
#endif //USES_MQTT
#endif //if FEATURE_MQTT
saveToRTC();
delay(100); // Flush anything in the network buffers.
}
@@ -465,9 +465,9 @@ void flushAndDisconnectAllClients() {
void prepareShutdown(ESPEasy_Scheduler::IntendedRebootReason_e reason)
{
#ifdef USES_MQTT
#if FEATURE_MQTT
runPeriodicalMQTT(); // Flush outstanding MQTT messages
#endif // USES_MQTT
#endif // if FEATURE_MQTT
process_serialWriteBuffer();
flushAndDisconnectAllClients();
saveUserVarToRTC();
+2 -2
View File
@@ -28,7 +28,7 @@ void runOncePerSecond();
\*********************************************************************************************/
void runEach30Seconds();
#ifdef USES_MQTT
#if FEATURE_MQTT
void scheduleNextMQTTdelayQueue();
void schedule_all_MQTTimport_tasks();
@@ -42,7 +42,7 @@ void runPeriodicalMQTT();
controllerIndex_t firstEnabledMQTT_ControllerIndex();
#endif //USES_MQTT
#endif //if FEATURE_MQTT
void logTimerStatistics();
+9 -9
View File
@@ -79,7 +79,7 @@ const __FlashStringHelper * ESPEasy_Scheduler::toString(ESPEasy_Scheduler::Plugi
switch (pluginType) {
case PluginPtrType::TaskPlugin: return F("Plugin");
case PluginPtrType::ControllerPlugin: return F("Controller");
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
case PluginPtrType::NotificationPlugin: return F("Notification");
#endif
}
@@ -427,9 +427,9 @@ void ESPEasy_Scheduler::process_interval_timer(IntervalTimer_e id, unsigned long
case IntervalTimer_e::TIMER_1SEC: runOncePerSecond(); break;
case IntervalTimer_e::TIMER_30SEC: runEach30Seconds(); break;
case IntervalTimer_e::TIMER_MQTT:
#ifdef USES_MQTT
#if FEATURE_MQTT
runPeriodicalMQTT();
#endif // USES_MQTT
#endif // if FEATURE_MQTT
break;
case IntervalTimer_e::TIMER_STATISTICS: logTimerStatistics(); break;
case IntervalTimer_e::TIMER_GRATUITOUS_ARP:
@@ -446,9 +446,9 @@ void ESPEasy_Scheduler::process_interval_timer(IntervalTimer_e id, unsigned long
}
break;
case IntervalTimer_e::TIMER_MQTT_DELAY_QUEUE:
#ifdef USES_MQTT
#if FEATURE_MQTT
processMQTTdelayQueue();
#endif // USES_MQTT
#endif // if FEATURE_MQTT
break;
case IntervalTimer_e::TIMER_C001_DELAY_QUEUE:
#ifdef USES_C001
@@ -1055,7 +1055,7 @@ void ESPEasy_Scheduler::schedule_plugin_task_event_timer(deviceIndex_t DeviceInd
}
}
#ifdef USES_MQTT
#if FEATURE_MQTT
void ESPEasy_Scheduler::schedule_mqtt_plugin_import_event_timer(deviceIndex_t DeviceIndex,
taskIndex_t TaskIndex,
uint8_t Function,
@@ -1102,7 +1102,7 @@ unsigned long ESPEasy_Scheduler::createSystemEventMixedId(PluginPtrType ptr_type
return getMixedId(SchedulerTimerType_e::SystemEventQueue, subId);
}
#ifdef USES_MQTT
#if FEATURE_MQTT
void ESPEasy_Scheduler::schedule_mqtt_controller_event_timer(protocolIndex_t ProtocolIndex,
CPlugin::Function Function,
char *c_topic,
@@ -1129,7 +1129,7 @@ void ESPEasy_Scheduler::schedule_mqtt_controller_event_timer(protocolIndex_t P
}
#endif
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
void ESPEasy_Scheduler::schedule_notification_event_timer(uint8_t NotificationProtocolIndex,
NPlugin::Function Function,
struct EventStruct&& event) {
@@ -1184,7 +1184,7 @@ void ESPEasy_Scheduler::process_system_event_queue() {
case PluginPtrType::ControllerPlugin:
CPluginCall(Index, static_cast<CPlugin::Function>(Function), &ScheduledEventQueue.front().event, tmpString);
break;
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
case PluginPtrType::NotificationPlugin:
NPlugin_ptr[Index](static_cast<NPlugin::Function>(Function), &ScheduledEventQueue.front().event, tmpString);
break;
+4 -4
View File
@@ -75,7 +75,7 @@ public:
enum class PluginPtrType {
TaskPlugin,
ControllerPlugin
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
,NotificationPlugin
#endif
};
@@ -254,7 +254,7 @@ public:
uint8_t Function,
struct EventStruct&& event);
#ifdef USES_MQTT
#if FEATURE_MQTT
void schedule_mqtt_plugin_import_event_timer(deviceIndex_t DeviceIndex,
taskIndex_t TaskIndex,
uint8_t Function,
@@ -269,7 +269,7 @@ public:
uint8_t Function,
struct EventStruct&& event);
#ifdef USES_MQTT
#if FEATURE_MQTT
void schedule_mqtt_controller_event_timer(protocolIndex_t ProtocolIndex,
CPlugin::Function Function,
char *c_topic,
@@ -278,7 +278,7 @@ public:
#endif
// Note: The event will be moved
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
void schedule_notification_event_timer(uint8_t NotificationProtocolIndex,
NPlugin::Function Function,
struct EventStruct&& event);
+4 -4
View File
@@ -6,7 +6,7 @@
\*********************************************************************************************/
#ifdef USES_MQTT
#if FEATURE_MQTT
#include <PubSubClient.h>
#include "../Globals/MQTT.h"
@@ -28,7 +28,7 @@ const __FlashStringHelper * getMQTT_state() {
return F("");
}
#endif // USES_MQTT
#endif // if FEATURE_MQTT
/********************************************************************************************\
Get system information
@@ -183,9 +183,9 @@ String getPluginDescriptionString() {
result += F(PLUGIN_DESCR);
result += ']';
#endif // ifdef PLUGIN_DESCR
#ifdef USE_NON_STANDARD_24_TASKS
#if FEATURE_NON_STANDARD_24_TASKS && defined(ESP8266)
result += F(" 24tasks");
#endif // ifdef USE_NON_STANDARD_24_TASKS
#endif // if FEATURE_NON_STANDARD_24_TASKS && defined(ESP8266)
result.trim();
return result;
}
+2 -2
View File
@@ -10,9 +10,9 @@
ESPEasy specific strings
\*********************************************************************************************/
#ifdef USES_MQTT
#if FEATURE_MQTT
const __FlashStringHelper * getMQTT_state();
#endif // USES_MQTT
#endif // if FEATURE_MQTT
/********************************************************************************************\
Get system information
+4 -4
View File
@@ -119,9 +119,9 @@ const __FlashStringHelper * getLabel(LabelType::Enum label) {
case LabelType::IP_ADDRESS_SUBNET: return F("IP / Subnet");
case LabelType::GATEWAY: return F("Gateway");
case LabelType::CLIENT_IP: return F("Client IP");
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
case LabelType::M_DNS: return F("mDNS");
#endif // ifdef FEATURE_MDNS
#endif // if FEATURE_MDNS
case LabelType::DNS: return F("DNS");
case LabelType::DNS_1: return F("DNS 1");
case LabelType::DNS_2: return F("DNS 2");
@@ -318,9 +318,9 @@ String getValue(LabelType::Enum label) {
case LabelType::GATEWAY: return NetworkGatewayIP().toString();
case LabelType::CLIENT_IP: return formatIP(web_server.client().remoteIP());
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
case LabelType::M_DNS: return String(NetworkGetHostname()) + F(".local");
#endif // ifdef FEATURE_MDNS
#endif // if FEATURE_MDNS
case LabelType::DNS: return String(getValue(LabelType::DNS_1) + F(" / ") + getValue(LabelType::DNS_2));
case LabelType::DNS_1: return NetworkDnsIP(0).toString();
case LabelType::DNS_2: return NetworkDnsIP(1).toString();
+2 -2
View File
@@ -80,9 +80,9 @@ struct LabelType {
IP_ADDRESS_SUBNET, // 192.168.1.123 / 255.255.255.0
GATEWAY, // 192.168.1.1
CLIENT_IP, // 192.168.1.67
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
M_DNS, // breadboard.local
#endif // ifdef FEATURE_MDNS
#endif // if FEATURE_MDNS
DNS, // 192.168.1.1 / (IP unset)
DNS_1,
DNS_2,
+5 -5
View File
@@ -15,9 +15,9 @@
#include "../Globals/CRCValues.h"
#include "../Globals/ESPEasy_time.h"
#include "../Globals/ESPEasyWiFiEvent.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
# include "../Globals/MQTT.h"
#endif // ifdef USES_MQTT
#endif // if FEATURE_MQTT
#include "../Globals/NetworkState.h"
#include "../Globals/RuntimeData.h"
#include "../Globals/Settings.h"
@@ -138,11 +138,11 @@ String SystemVariables::getSystemVariable(SystemVariables::Enum enumval) {
case BSSID: return String((WiFiEventData.WiFiDisconnected()) ? MAC_address().toString() : WiFi.BSSIDstr());
case CR: return String('\r');
case IP4: return String(static_cast<int>(NetworkLocalIP()[3])); // 4th IP octet
#ifdef USES_MQTT
#if FEATURE_MQTT
case ISMQTT: return String(MQTTclient_connected ? 1 : 0);
#else // ifdef USES_MQTT
#else // if FEATURE_MQTT
case ISMQTT: return String('0');
#endif // ifdef USES_MQTT
#endif // if FEATURE_MQTT
#ifdef USES_P037
case ISMQTTIMP: return String(P037_MQTTImport_connected ? 1 : 0);
+2 -2
View File
@@ -10,7 +10,7 @@
// # Helper functions to encode data for use on LoRa/TTN network.
// #######################################################################################################
#if defined(USES_PACKED_RAW_DATA)
#if FEATURE_PACKED_RAW_DATA
String getPackedFromPlugin(struct EventStruct *event, uint8_t sampleSetCount)
@@ -104,4 +104,4 @@ float getLoRaAirTime(uint8_t pl, uint8_t sf, uint16_t bw, uint8_t cr, uint8_t n_
return t_air;
}
#endif // USES_PACKED_RAW_DATA
#endif // if FEATURE_PACKED_RAW_DATA
+2 -2
View File
@@ -8,7 +8,7 @@
// # Helper functions to encode data for use on LoRa/TTN network.
// #######################################################################################################
#if defined(USES_PACKED_RAW_DATA)
#if FEATURE_PACKED_RAW_DATA
#include "../DataStructs/ESPEasy_packed_raw_data.h"
@@ -32,7 +32,7 @@ float getLoRaAirTime(uint8_t pl,
bool header = true,
bool crc = true);
#endif // USES_PACKED_RAW_DATA
#endif // if FEATURE_PACKED_RAW_DATA
+1 -1
View File
@@ -1,6 +1,6 @@
#include "../Helpers/_NPlugin_init.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
#include "../DataStructs/ESPEasy_EventStruct.h"
#include "../DataStructs/TimingStats.h"
+1 -1
View File
@@ -3,7 +3,7 @@
#include "../../ESPEasy_common.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
#include "../DataTypes/ESPEasy_plugin_functions.h"
+20 -16
View File
@@ -36,9 +36,9 @@ bool P037_data_struct::loadSettings() {
String tmp[1];
LoadCustomTaskSettings(_taskIndex, tmp,
1, 41, offset);
globalTopicPrefix = std::move(tmp[0]);
offset += 41;
1, 41, offset);
globalTopicPrefix = std::move(tmp[0]);
offset += 41;
}
@@ -51,34 +51,36 @@ bool P037_data_struct::loadSettings() {
String P037_data_struct::saveSettings() {
String res;
if (_taskIndex < TASKS_MAX) {
size_t offset = 0;
res += SaveCustomTaskSettings(_taskIndex, mqttTopics,
VARS_PER_TASK, 41, offset);
VARS_PER_TASK, 41, offset);
offset += VARS_PER_TASK * 41;
res += SaveCustomTaskSettings(_taskIndex, jsonAttributes,
VARS_PER_TASK, 21, offset);
VARS_PER_TASK, 21, offset);
offset += VARS_PER_TASK * 21;
{
String tmp[1];
tmp[0] = globalTopicPrefix;
res += SaveCustomTaskSettings(_taskIndex, tmp,
1, 41, offset);
res += SaveCustomTaskSettings(_taskIndex, tmp,
1, 41, offset);
offset += 41;
}
res += SaveCustomTaskSettings(_taskIndex, valueArray,
P037_ARRAY_SIZE, 0, offset + 1);
P037_ARRAY_SIZE, 0, offset + 1);
}
return res;
}
String P037_data_struct::getFullMQTTTopic(uint8_t taskValueIndex) const {
String topic;
if (taskValueIndex < VARS_PER_TASK && mqttTopics[taskValueIndex].length() > 0) {
if ((taskValueIndex < VARS_PER_TASK) && (mqttTopics[taskValueIndex].length() > 0)) {
topic.reserve(globalTopicPrefix.length() + mqttTopics[taskValueIndex].length());
topic = globalTopicPrefix;
topic.trim();
@@ -88,9 +90,9 @@ String P037_data_struct::getFullMQTTTopic(uint8_t taskValueIndex) const {
return topic;
}
bool P037_data_struct::shouldSubscribeToMQTTtopic(const String& topic) const {
if (topic.length() == 0) return false;
if (topic.length() == 0) { return false; }
for (uint8_t x = 0; x < VARS_PER_TASK; x++)
{
if (topic.equalsIgnoreCase(getFullMQTTTopic(x))) {
@@ -124,8 +126,11 @@ void P037_data_struct::parseMappings() {
_maxFilter = 0; // Initialize to empty
# endif // if P037_FILTER_SUPPORT
# if P037_MAPPING_SUPPORT || P037_FILTER_SUPPORT
int8_t idx;
# endif // if P037_MAPPING_SUPPORT || P037_FILTER_SUPPORT
# if P037_MAPPING_SUPPORT
int8_t idx = P037_MAX_MAPPINGS;
idx = P037_MAX_MAPPINGS;
for (uint8_t mappingOffset = P037_END_MAPPINGS; mappingOffset >= P037_START_MAPPINGS && _maxIdx == 0; mappingOffset--) {
if (!valueArray[mappingOffset].isEmpty()) {
@@ -475,7 +480,6 @@ bool P037_data_struct::webform_load(
return success;
} // webform_load
bool P037_data_struct::webform_save(
# if P037_FILTER_SUPPORT
bool filterEnabled
@@ -503,8 +507,8 @@ bool P037_data_struct::webform_save(
# ifdef P037_JSON_SUPPORT
if (jsonEnabled) {
argName = F("attribute");
argName += (varNr + 1);
argName = F("attribute");
argName += (varNr + 1);
jsonAttributes[varNr] = web_server.arg(argName);
}
# endif // P037_JSON_SUPPORT
@@ -515,6 +519,7 @@ bool P037_data_struct::webform_save(
# if P037_MAPPING_SUPPORT || P037_FILTER_SUPPORT
String left, right;
bool firstError;
int8_t idx = 0;
# endif // if P037_MAPPING_SUPPORT || P037_FILTER_SUPPORT
// Mappings are processed first
@@ -522,7 +527,6 @@ bool P037_data_struct::webform_save(
firstError = true;
String operands = P037_OPERAND_LIST;
uint8_t mapNr = 1;
int8_t idx = 0;
left.reserve(32);
right.reserve(32);
+7 -2
View File
@@ -39,22 +39,27 @@
# endif // ifdef PLUGIN_037_DEBUG
# if P037_MAPPING_SUPPORT
# undef P037_MAPPING_SUPPORT
# define P037_MAPPING_SUPPORT 0
# endif // if P037_MAPPING_SUPPORT
# if defined(FEATURE_ADC_VCC) && P037_FILTER_SUPPORT
# if FEATURE_ADC_VCC && P037_FILTER_SUPPORT
# undef P037_FILTER_SUPPORT
# endif // if defined(FEATURE_ADC_VCC) && P037_FILTER_SUPPORT
# define P037_FILTER_SUPPORT 0
# endif // if FEATURE_ADC_VCC && P037_FILTER_SUPPORT
// #if P037_JSON_SUPPORT
// #undef P037_JSON_SUPPORT
// #define P037_JSON_SUPPORT 0
// #endif
# endif // if defined(LIMIT_BUILD_SIZE) && !defined(P037_OVERRIDE)
# ifdef PLUGIN_DISPLAY_COLLECTION
# if P037_FILTER_SUPPORT
# undef P037_FILTER_SUPPORT
# define P037_FILTER_SUPPORT 0
# endif // if P037_FILTER_SUPPORT
# if P037_REPLACE_BY_COMMA_SUPPORT
# undef P037_REPLACE_BY_COMMA_SUPPORT
# define P037_REPLACE_BY_COMMA_SUPPORT 0
# endif // if P037_REPLACE_BY_COMMA_SUPPORT
# endif // ifdef PLUGIN_DISPLAY_COLLECTION
# endif // ifndef PLUGIN_BUILD_MAX_ESP32
+4 -4
View File
@@ -52,13 +52,13 @@ void handle_config() {
addLog(LOG_LEVEL_INFO, F("Unit Name changed."));
if (CPluginCall(CPlugin::Function::CPLUGIN_GOT_INVALID, 0)) { // inform controllers that the old name will be invalid from now on.
#ifdef USES_MQTT
#if FEATURE_MQTT
MQTTDisconnect(); // disconnect form MQTT Server if invalid message was sent succesfull.
#endif // USES_MQTT
#endif // if FEATURE_MQTT
}
#ifdef USES_MQTT
#if FEATURE_MQTT
MQTTclient_should_reconnect = true;
#endif // USES_MQTT
#endif // if FEATURE_MQTT
}
// Unit name
+4 -4
View File
@@ -362,7 +362,7 @@ void handle_controllers_ControllerSettingsPage(controllerIndex_t controllerindex
{
addControllerParameterForm(ControllerSettings, controllerindex, ControllerSettingsStruct::CONTROLLER_PASS);
}
#ifdef USES_MQTT
#if FEATURE_MQTT
if (Protocol[ProtocolIndex].usesMQTT) {
addTableSeparator(F("MQTT"), 2, 3);
@@ -373,7 +373,7 @@ void handle_controllers_ControllerSettingsPage(controllerIndex_t controllerindex
addFormNote(F("Updated on load of this page"));
addControllerParameterForm(ControllerSettings, controllerindex, ControllerSettingsStruct::CONTROLLER_RETAINFLAG);
}
#endif // USES_MQTT
#endif // if FEATURE_MQTT
if (Protocol[ProtocolIndex].usesTemplate || Protocol[ProtocolIndex].usesMQTT)
@@ -381,7 +381,7 @@ void handle_controllers_ControllerSettingsPage(controllerIndex_t controllerindex
addControllerParameterForm(ControllerSettings, controllerindex, ControllerSettingsStruct::CONTROLLER_SUBSCRIBE);
addControllerParameterForm(ControllerSettings, controllerindex, ControllerSettingsStruct::CONTROLLER_PUBLISH);
}
#ifdef USES_MQTT
#if FEATURE_MQTT
if (Protocol[ProtocolIndex].usesMQTT)
{
addControllerParameterForm(ControllerSettings, controllerindex, ControllerSettingsStruct::CONTROLLER_LWT_TOPIC);
@@ -391,7 +391,7 @@ void handle_controllers_ControllerSettingsPage(controllerIndex_t controllerindex
addControllerParameterForm(ControllerSettings, controllerindex, ControllerSettingsStruct::CONTROLLER_WILL_RETAIN);
addControllerParameterForm(ControllerSettings, controllerindex, ControllerSettingsStruct::CONTROLLER_CLEAN_SESSION);
}
#endif // USES_MQTT
#endif // if FEATURE_MQTT
}
}
// End of scope for ControllerSettings, destruct it to save memory.
+3 -3
View File
@@ -212,9 +212,9 @@ void handle_json()
static const LabelType::Enum labels[] PROGMEM =
{
LabelType::HOST_NAME,
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
LabelType::M_DNS,
#endif // ifdef FEATURE_MDNS
#endif // if FEATURE_MDNS
LabelType::IP_CONFIG,
LabelType::IP_ADDRESS,
LabelType::IP_SUBNET,
@@ -556,7 +556,7 @@ void handle_buildinfo() {
}
json_close(true);
}
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
{
json_open(true, F("notifications"));
+4 -2
View File
@@ -1,6 +1,6 @@
#include "../WebServer/NotificationPage.h"
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
#include "../WebServer/WebServer.h"
#include "../WebServer/HTML_wrappers.h"
@@ -21,6 +21,8 @@
// ********************************************************************************
// Web Interface notifcations page
// ********************************************************************************
#include "../Globals/NPlugins.h"
@@ -242,4 +244,4 @@ void handle_notifications() {
TXBuffer.endStream();
}
#endif // USES_NOTIFIER
#endif // FEATURE_NOTIFIER
+2 -2
View File
@@ -7,11 +7,11 @@
// Web Interface notifcations page
// ********************************************************************************
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
void handle_notifications();
#endif // USES_NOTIFIER
#endif // FEATURE_NOTIFIER
#endif
+4 -4
View File
@@ -26,7 +26,7 @@
#include "../../ESPEasy-Globals.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
# include "../Globals/MQTT.h"
# include "../Helpers/PeriodicalActions.h" // For finding enabled MQTT controller
#endif
@@ -205,7 +205,7 @@ void handle_root() {
}
#endif // if FEATURE_ETHERNET
#ifdef FEATURE_MDNS
#if FEATURE_MDNS
{
addRowLabel(LabelType::M_DNS);
addHtml(F("<a href='http://"));
@@ -214,9 +214,9 @@ void handle_root() {
addHtml(getValue(LabelType::M_DNS));
addHtml(F("</a>"));
}
#endif // ifdef FEATURE_MDNS
#endif // if FEATURE_MDNS
#ifdef USES_MQTT
#if FEATURE_MQTT
{
if (validControllerIndex(firstEnabledMQTT_ControllerIndex())) {
addRowLabel(F("MQTT Client Connected"));
+2 -2
View File
@@ -39,7 +39,7 @@
#include "../Static/WebStaticData.h"
#ifdef USES_MQTT
#if FEATURE_MQTT
# include "../Globals/MQTT.h"
# include "../Helpers/PeriodicalActions.h" // For finding enabled MQTT controller
#endif
@@ -543,7 +543,7 @@ void handle_sysinfo_NetworkServices() {
addRowLabel(F("NTP Initialized"));
addEnabled(statusNTPInitialized);
#ifdef USES_MQTT
#if FEATURE_MQTT
if (validControllerIndex(firstEnabledMQTT_ControllerIndex())) {
addRowLabel(F("MQTT Client Connected"));
addEnabled(MQTTclient_connected);
+2 -2
View File
@@ -245,9 +245,9 @@ void WebServerInit()
web_server.on(F("/csv"), handle_csvval);
web_server.on(F("/log"), handle_log);
web_server.on(F("/logjson"), handle_log_JSON); // Also part of WEBSERVER_NEW_UI
#ifdef USES_NOTIFIER
#if FEATURE_NOTIFIER
web_server.on(F("/notifications"), handle_notifications);
#endif // ifdef USES_NOTIFIER
#endif // if FEATURE_NOTIFIER
#ifdef WEBSERVER_PINSTATES
web_server.on(F("/pinstates"), handle_pinstates);
#endif // ifdef WEBSERVER_PINSTATES
+2 -2
View File
@@ -293,12 +293,12 @@ void WebTemplateParser::getWebPageTemplateVar(const String& varName)
if ((i == MENU_INDEX_RULES) && !Settings.UseRules) { // hide rules menu item
continue;
}
#ifndef USES_NOTIFIER
#ifndef FEATURE_NOTIFIER
if (i == MENU_INDEX_NOTIFICATIONS) { // hide notifications menu item
continue;
}
#endif // ifndef USES_NOTIFIER
#endif // ifndef FEATURE_NOTIFIER
addHtml(F("<a "));
+1 -1
View File
@@ -56,7 +56,7 @@ else:
"-DUSES_C018", # TTN/RN2483
# "-DUSES_C015", # Blynk
# "-DFEATURE_MDNS",
# "-DFEATURE_MDNS=1",
# "-DFEATURE_SD=1",
"-DFEATURE_EXT_RTC=1",
"-DFEATURE_I2CMULTIPLEXER=1",