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.

209 lines
6.9 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 MQTT_USE_JSON
  70. #define MQTT_USE_JSON 1 // Thermostat depends on group messages in a JSON body
  71. #undef RELAY_SUPPORT
  72. #define RELAY_SUPPORT 1 // Thermostat depends on switches
  73. #endif
  74. #if SCHEDULER_SUPPORT
  75. #undef NTP_SUPPORT
  76. #define NTP_SUPPORT 1 // Scheduler needs NTP to work
  77. #undef BROKER_SUPPORT
  78. #define BROKER_SUPPORT 1 // Scheduler needs Broker to trigger every minute
  79. #undef RELAY_SUPPORT
  80. #define RELAY_SUPPORT 1 // Scheduler needs relays
  81. #endif
  82. #if LWIP_VERSION_MAJOR != 1
  83. #undef MDNS_CLIENT_SUPPORT
  84. #define MDNS_CLIENT_SUPPORT 0 // default resolver already handles this
  85. #endif
  86. #if not defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  87. #undef TELNET_SERVER_ASYNC_BUFFERED
  88. #define TELNET_SERVER_ASYNC_BUFFERED 1 // enable buffered telnet by default on latest Cores
  89. #endif
  90. #if LIGHT_PROVIDER == LIGHT_PROVIDER_TUYA
  91. #undef TUYA_SUPPORT
  92. #define TUYA_SUPPORT 1 // Need base Tuya module for this to work
  93. #undef LIGHT_USE_TRANSITIONS
  94. #define LIGHT_USE_TRANSITIONS 0 // TODO: temporary, maybe slower step instead?
  95. #endif
  96. #if TUYA_SUPPORT
  97. #undef BROKER_SUPPORT
  98. #define BROKER_SUPPORT 1 // Broker is required to process relay & lights events
  99. #undef RELAY_SUPPORT
  100. #define RELAY_SUPPORT 1 // Most of the time we require it
  101. #endif
  102. //------------------------------------------------------------------------------
  103. // Hint about ESPAsyncTCP options and our internal one
  104. // TODO: clean-up SSL_ENABLED and USE_SSL settings for 1.15.0
  105. #if ASYNC_TCP_SSL_ENABLED && SECURE_CLIENT == SECURE_CLIENT_NONE
  106. #undef SECURE_CLIENT
  107. #define SECURE_CLIENT SECURE_CLIENT_AXTLS
  108. #endif
  109. #if THINGSPEAK_USE_SSL && THINGSPEAK_USE_ASYNC && (!ASYNC_TCP_SSL_ENABLED)
  110. #warning "Thingspeak in ASYNC mode requires a globally defined ASYNC_TCP_SSL_ENABLED=1"
  111. #undef THINGSPEAK_SUPPORT
  112. #define THINGSPEAK_SUPPORT 0 // Thingspeak in ASYNC mode requires ASYNC_TCP_SSL_ENABLED
  113. #endif
  114. #if WEB_SUPPORT && WEB_SSL_ENABLED && (!ASYNC_TCP_SSL_ENABLED)
  115. #warning "WEB_SUPPORT with SSL requires a globally defined ASYNC_TCP_SSL_ENABLED=1"
  116. #undef WEB_SSL_ENABLED
  117. #define WEB_SSL_ENABLED 0 // WEB_SUPPORT mode th SSL requires ASYNC_TCP_SSL_ENABLED
  118. #endif
  119. #if !DEBUG_SUPPORT
  120. #undef DEBUG_LOG_BUFFER_SUPPORT
  121. #define DEBUG_LOG_BUFFER_SUPPORT 0 // Can't buffer if there is no debugging enabled.
  122. // Helps to avoid checking twice for both DEBUG_SUPPORT and BUFFER_LOG_SUPPORT
  123. #endif
  124. //------------------------------------------------------------------------------
  125. // These depend on newest Core libraries
  126. #if LLMNR_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  127. #undef LLMNR_SUPPORT
  128. #define LLMNR_SUPPORT 0
  129. #endif
  130. #if NETBIOS_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  131. #undef NETBIOS_SUPPORT
  132. #define NETBIOS_SUPPORT 0
  133. #endif
  134. #if SSDP_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  135. #undef SSDP_SUPPORT
  136. #define SSDP_SUPPORT 0
  137. #endif
  138. //------------------------------------------------------------------------------
  139. // Change ntp module depending on Core version
  140. #if NTP_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  141. #define NTP_LEGACY_SUPPORT 1
  142. #else
  143. #define NTP_LEGACY_SUPPORT 0
  144. #endif
  145. //------------------------------------------------------------------------------
  146. // When using Dual / Lightfox Dual, notify that Serial should be used
  147. #if (BUTTON_EVENTS_SOURCE == BUTTON_EVENTS_SOURCE_ITEAD_SONOFF_DUAL) || \
  148. (BUTTON_EVENTS_SOURCE == BUTTON_EVENTS_SOURCE_FOXEL_LIGHTFOX_DUAL)
  149. #if DEBUG_SERIAL_SUPPORT
  150. #warning "DEBUG_SERIAL_SUPPORT conflicts with the current BUTTON_EVENTS_SOURCE"
  151. #undef DEBUG_SERIAL_SUPPORT
  152. #define DEBUG_SERIAL_SUPPORT 0
  153. #endif
  154. #endif
  155. //------------------------------------------------------------------------------
  156. // It looks more natural that one click will enable display
  157. // and long click will switch relay
  158. #if THERMOSTAT_DISPLAY_SUPPORT
  159. #undef BUTTON1_CLICK
  160. #define BUTTON1_CLICK BUTTON_ACTION_DISPLAY_ON
  161. #undef BUTTON1_LNGCLICK
  162. #define BUTTON1_LNGCLICK BUTTON_ACTION_TOGGLE
  163. #endif
  164. //------------------------------------------------------------------------------
  165. // We should always set MQTT_MAX_PACKET_SIZE
  166. //
  167. #if MQTT_LIBRARY == MQTT_LIBRARY_PUBSUBCLIENT
  168. #if not defined(MQTT_MAX_PACKET_SIZE)
  169. #warning "MQTT_MAX_PACKET_SIZE should be set in `build_flags = ...` of the environment! Default value is used instead."
  170. #endif
  171. #endif