Add compile time control over settings

This commit is contained in:
Theo Arends 2020-01-21 12:36:44 +01:00
parent c1a86af6a8
commit 760f4e49ac
2 changed files with 15 additions and 6 deletions

View File

@ -97,6 +97,7 @@
#define MQTT_BUTTON_RETAIN false // [ButtonRetain] Button may send retain flag (false = off, true = on)
#define MQTT_POWER_RETAIN false // [PowerRetain] Power status message may send retain flag (false = off, true = on)
#define MQTT_SWITCH_RETAIN false // [SwitchRetain] Switch may send retain flag (false = off, true = on)
#define MQTT_SENSOR_RETAIN false // [SensorRetain] Sensor may send retain flag (false = off, true = on)
#define MQTT_BUTTON_SWITCH_FORCE_LOCAL false // [SetOption61] Force local operation when button/switch topic is set (false = off, true = on)
#define MQTT_STATUS_OFF "OFF" // [StateText1] Command or Status result when turned off (needs to be a string like "0" or "Off")
@ -198,6 +199,10 @@
#define COLOR_TIMER_TAB_BACKGROUND "#999" // [WebColor18] Config timer tab background color - Dark gray
#define COLOR_TITLE_TEXT "#eaeaea" // [WebColor19] Title text color - Very light gray
// -- KNX -----------------------------------------
#define KNX_ENABLED false // [Knx_Enabled] Enable KNX protocol
#define KNX_ENHANCED false // [Knx_Enhanced] Enable KNX Enhanced Mode
// -- mDNS ----------------------------------------
#define MDNS_ENABLED false // [SetOption55] Use mDNS (false = Disable, true = Enable)
@ -251,7 +256,6 @@
#define SWITCH_DEBOUNCE_TIME 50 // [SwitchDebounce] Number of mSeconds switch press debounce time
#define SWITCH_MODE TOGGLE // [SwitchMode] TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD, PUSHBUTTONHOLD_INV, PUSHBUTTON_TOGGLE, TOGGLEMULTI, FOLLOWMULTI, FOLLOWMULTI_INV (the wall switch state)
#define WS2812_LEDS 30 // [Pixels] Number of WS2812 LEDs to start with (max is 512)
#define TEMP_CONVERSION false // [SetOption8] Return temperature in (false = Celsius or true = Fahrenheit)
#define PRESSURE_CONVERSION false // [SetOption24] Return pressure in (false = hPa or true = mmHg)
@ -264,9 +268,10 @@
#define APP_FLASH_CYCLE false // [SetOption12] Switch between dynamic or fixed slot flash save location
#define APP_NO_RELAY_SCAN false // [SetOption63] Don't scan relay power state at restart
#define APP_DISABLE_POWERCYCLE false // [SetOption65] Disable fast power cycle detection for device reset
#define DEEPSLEEP_BOOTCOUNT false // [SetOption76] Enable incrementing bootcount when deepsleep is enabled
#define DEEPSLEEP_BOOTCOUNT false // [SetOption76] Enable incrementing bootcount when deepsleep is enabled
// -- Lights --------------------------------------
#define WS2812_LEDS 30 // [Pixels] Number of WS2812 LEDs to start with (max is 512)
#define LIGHT_MODE true // [SetOption15] Switch between commands PWM or COLOR/DIMMER/CT/CHANNEL
#define LIGHT_CLOCK_DIRECTION false // [SetOption16] Switch WS2812 clock between clockwise or counter-clockwise
#define LIGHT_COLOR_RADIX false // [SetOption17] Switch between decimal or hexadecimal color output (false = hexadecimal, true = decimal)
@ -279,9 +284,10 @@
// -- Energy --------------------------------------
#define ENERGY_VOLTAGE_ALWAYS false // [SetOption21] Enable show voltage even if powered off
#define ENERGY_DDS2382_MODE false // [SetOption71] Enable DDS2382 different Modbus registers for Active Energy (#6531)
#define ENERGY_HARDWARE_TOTALS false // [SetOption72] Enable hardware energy total counter as reference (#6561)
#define ENERGY_HARDWARE_TOTALS false // [SetOption72] Enable hardware energy total counter as reference (#6561)
// -- Other Options -------------------------------
#define TIMERS_ENABLED false // [Timers] Enable Timers
#define RF_DATA_RADIX false // [SetOption28] RF receive data format (false = hexadecimal, true = decimal)
#define IR_DATA_RADIX false // [SetOption29] IR receive data format (false = hexadecimal, true = decimal)
#define TUYA_SETOPTION_20 false // [SetOption54] Apply SetOption20 settings to Tuya device

View File

@ -874,7 +874,7 @@ void SettingsDefaultSet2(void)
Settings.flag.mqtt_power_retain = MQTT_POWER_RETAIN;
Settings.flag.mqtt_button_retain = MQTT_BUTTON_RETAIN;
Settings.flag.mqtt_switch_retain = MQTT_SWITCH_RETAIN;
// Settings.flag.mqtt_sensor_retain = 0;
Settings.flag.mqtt_sensor_retain = MQTT_SENSOR_RETAIN;
// Settings.flag.mqtt_serial = 0;
Settings.flag.device_index_enable = MQTT_POWER_FORMAT;
Settings.flag3.time_append_timezone = MQTT_APPEND_TIMEZONE;
@ -987,14 +987,17 @@ void SettingsDefaultSet2(void)
// for (uint32_t i = 1; i < MAX_RULE_SETS; i++) { Settings.rules[i][0] = '\0'; }
Settings.flag2.calc_resolution = CALC_RESOLUTION;
// Timer
Settings.flag3.timers_enable = TIMERS_ENABLED;
// Home Assistant
Settings.flag.hass_light = HASS_AS_LIGHT;
Settings.flag.hass_discovery = HOME_ASSISTANT_DISCOVERY_ENABLE;
Settings.flag3.hass_tele_on_power = TELE_ON_POWER;
// Knx
// Settings.flag.knx_enabled = 0;
// Settings.flag.knx_enable_enhancement = 0;
Settings.flag.knx_enabled = KNX_ENABLED;
Settings.flag.knx_enable_enhancement = KNX_ENHANCED;
// Light
Settings.flag.pwm_control = LIGHT_MODE;