Fork of the espurna firmware for `mhsw` switches
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

197 lines
6.5 KiB

  1. //------------------------------------------------------------------------------
  2. // Do not change this file unless you know what you are doing
  3. // Configuration settings are in the general.h file
  4. //------------------------------------------------------------------------------
  5. #pragma once
  6. //------------------------------------------------------------------------------
  7. // Various modules configuration
  8. #if DEBUG_TELNET_SUPPORT
  9. #undef TELNET_SUPPORT
  10. #define TELNET_SUPPORT 1
  11. #endif
  12. #if not WEB_SUPPORT
  13. #undef DEBUG_WEB_SUPPORT
  14. #define DEBUG_WEB_SUPPORT 0
  15. #endif
  16. #if not WEB_SUPPORT
  17. #undef API_SUPPORT
  18. #define API_SUPPORT 0 // API support requires web support
  19. #endif
  20. #if not WEB_SUPPORT
  21. #undef SSDP_SUPPORT
  22. #define SSDP_SUPPORT 0 // SSDP support requires web support
  23. #endif
  24. #if UART_MQTT_SUPPORT
  25. #undef MQTT_SUPPORT
  26. #define MQTT_SUPPORT 1 // UART<->MQTT requires MQTT and no serial debug
  27. #undef DEBUG_SERIAL_SUPPORT
  28. #define DEBUG_SERIAL_SUPPORT 0 // TODO: compare UART_MQTT_PORT with DEBUG_PORT? (as strings)
  29. #endif
  30. #if ALEXA_SUPPORT
  31. #undef BROKER_SUPPORT
  32. #define BROKER_SUPPORT 1 // If Alexa enabled enable BROKER
  33. #undef RELAY_SUPPORT
  34. #define RELAY_SUPPORT 1 // and switches
  35. #endif
  36. #if RPN_RULES_SUPPORT
  37. #undef BROKER_SUPPORT
  38. #define BROKER_SUPPORT 1 // If RPN Rules enabled enable BROKER
  39. #undef MQTT_SUPPORT
  40. #define MQTT_SUPPORT 1
  41. #endif
  42. #if RF_SUPPORT
  43. #undef RELAY_SUPPORT
  44. #define RELAY_SUPPORT 1
  45. #endif
  46. #if LED_SUPPORT
  47. #undef BROKER_SUPPORT
  48. #define BROKER_SUPPORT 1 // If LED is enabled enable BROKER to supply status changes
  49. #endif
  50. #if INFLUXDB_SUPPORT
  51. #undef BROKER_SUPPORT
  52. #define BROKER_SUPPORT 1 // If InfluxDB enabled enable BROKER
  53. #endif
  54. #if DOMOTICZ_SUPPORT
  55. #undef BROKER_SUPPORT
  56. #define BROKER_SUPPORT 1 // If Domoticz enabled enable BROKER
  57. #undef MQTT_SUPPORT
  58. #define MQTT_SUPPORT 1 // If Domoticz enabled enable MQTT
  59. #endif
  60. #if HOMEASSISTANT_SUPPORT
  61. #undef MQTT_SUPPORT
  62. #define MQTT_SUPPORT 1 // If Home Assistant enabled enable MQTT
  63. #endif
  64. #if THINGSPEAK_SUPPORT
  65. #undef BROKER_SUPPORT
  66. #define BROKER_SUPPORT 1 // If Thingspeak enabled enable BROKER
  67. #endif
  68. #if THERMOSTAT_SUPPORT
  69. #undef RELAY_SUPPORT
  70. #define RELAY_SUPPORT 1 // Thermostat depends on switches
  71. #endif
  72. #if SCHEDULER_SUPPORT
  73. #undef NTP_SUPPORT
  74. #define NTP_SUPPORT 1 // Scheduler needs NTP to work
  75. #undef BROKER_SUPPORT
  76. #define BROKER_SUPPORT 1 // Scheduler needs Broker to trigger every minute
  77. #undef RELAY_SUPPORT
  78. #define RELAY_SUPPORT 1 // Scheduler needs relays
  79. #endif
  80. #if LWIP_VERSION_MAJOR != 1
  81. #undef MDNS_CLIENT_SUPPORT
  82. #define MDNS_CLIENT_SUPPORT 0 // default resolver already handles this
  83. #endif
  84. #if not defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  85. #undef TELNET_SERVER_ASYNC_BUFFERED
  86. #define TELNET_SERVER_ASYNC_BUFFERED 1 // enable buffered telnet by default on latest Cores
  87. #endif
  88. #if LIGHT_PROVIDER == LIGHT_PROVIDER_TUYA
  89. #undef TUYA_SUPPORT
  90. #define TUYA_SUPPORT 1 // Need base Tuya module for this to work
  91. #undef LIGHT_USE_TRANSITIONS
  92. #define LIGHT_USE_TRANSITIONS 0 // TODO: temporary, maybe slower step instead?
  93. #endif
  94. #if TUYA_SUPPORT
  95. #undef BROKER_SUPPORT
  96. #define BROKER_SUPPORT 1 // Broker is required to process relay & lights events
  97. #undef RELAY_SUPPORT
  98. #define RELAY_SUPPORT 1 // Most of the time we require it
  99. #endif
  100. //------------------------------------------------------------------------------
  101. // Hint about ESPAsyncTCP options and our internal one
  102. // TODO: clean-up SSL_ENABLED and USE_SSL settings for 1.15.0
  103. #if ASYNC_TCP_SSL_ENABLED && SECURE_CLIENT == SECURE_CLIENT_NONE
  104. #undef SECURE_CLIENT
  105. #define SECURE_CLIENT SECURE_CLIENT_AXTLS
  106. #endif
  107. #if THINGSPEAK_USE_SSL && THINGSPEAK_USE_ASYNC && (!ASYNC_TCP_SSL_ENABLED)
  108. #warning "Thingspeak in ASYNC mode requires a globally defined ASYNC_TCP_SSL_ENABLED=1"
  109. #undef THINGSPEAK_SUPPORT
  110. #define THINGSPEAK_SUPPORT 0 // Thingspeak in ASYNC mode requires ASYNC_TCP_SSL_ENABLED
  111. #endif
  112. #if WEB_SUPPORT && WEB_SSL_ENABLED && (!ASYNC_TCP_SSL_ENABLED)
  113. #warning "WEB_SUPPORT with SSL requires a globally defined ASYNC_TCP_SSL_ENABLED=1"
  114. #undef WEB_SSL_ENABLED
  115. #define WEB_SSL_ENABLED 0 // WEB_SUPPORT mode th SSL requires ASYNC_TCP_SSL_ENABLED
  116. #endif
  117. #if !DEBUG_SUPPORT
  118. #undef DEBUG_LOG_BUFFER_SUPPORT
  119. #define DEBUG_LOG_BUFFER_SUPPORT 0 // Can't buffer if there is no debugging enabled.
  120. // Helps to avoid checking twice for both DEBUG_SUPPORT and BUFFER_LOG_SUPPORT
  121. #endif
  122. //------------------------------------------------------------------------------
  123. // These depend on newest Core libraries
  124. #if LLMNR_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  125. #undef LLMNR_SUPPORT
  126. #define LLMNR_SUPPORT 0
  127. #endif
  128. #if NETBIOS_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  129. #undef NETBIOS_SUPPORT
  130. #define NETBIOS_SUPPORT 0
  131. #endif
  132. #if SSDP_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  133. #undef SSDP_SUPPORT
  134. #define SSDP_SUPPORT 0
  135. #endif
  136. //------------------------------------------------------------------------------
  137. // Change ntp module depending on Core version
  138. #if NTP_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  139. #define NTP_LEGACY_SUPPORT 1
  140. #else
  141. #define NTP_LEGACY_SUPPORT 0
  142. #endif
  143. //------------------------------------------------------------------------------
  144. // When using Dual / Lightfox Dual, notify that Serial should be used
  145. #if (BUTTON_EVENTS_SOURCE == BUTTON_EVENTS_SOURCE_ITEAD_SONOFF_DUAL) || \
  146. (BUTTON_EVENTS_SOURCE == BUTTON_EVENTS_SOURCE_FOXEL_LIGHTFOX_DUAL)
  147. #if DEBUG_SERIAL_SUPPORT
  148. #warning "DEBUG_SERIAL_SUPPORT conflicts with the current BUTTON_EVENTS_SOURCE"
  149. #undef DEBUG_SERIAL_SUPPORT
  150. #define DEBUG_SERIAL_SUPPORT 0
  151. #endif
  152. #endif
  153. //------------------------------------------------------------------------------
  154. // It looks more natural that one click will enable display
  155. // and long click will switch relay
  156. #if THERMOSTAT_DISPLAY_SUPPORT
  157. #undef BUTTON1_CLICK
  158. #define BUTTON1_CLICK BUTTON_ACTION_DISPLAY_ON
  159. #undef BUTTON1_LNGCLICK
  160. #define BUTTON1_LNGCLICK BUTTON_ACTION_TOGGLE
  161. #endif