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.

168 lines
5.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. #endif
  34. #if RPN_RULES_SUPPORT
  35. #undef BROKER_SUPPORT
  36. #define BROKER_SUPPORT 1 // If RPN Rules enabled enable BROKER
  37. #undef MQTT_SUPPORT
  38. #define MQTT_SUPPORT 1
  39. #endif
  40. #if LED_SUPPORT
  41. #undef BROKER_SUPPORT
  42. #define BROKER_SUPPORT 1 // If LED is enabled enable BROKER to supply status changes
  43. #endif
  44. #if INFLUXDB_SUPPORT
  45. #undef BROKER_SUPPORT
  46. #define BROKER_SUPPORT 1 // If InfluxDB enabled enable BROKER
  47. #endif
  48. #if DOMOTICZ_SUPPORT
  49. #undef BROKER_SUPPORT
  50. #define BROKER_SUPPORT 1 // If Domoticz enabled enable BROKER
  51. #undef MQTT_SUPPORT
  52. #define MQTT_SUPPORT 1 // If Domoticz enabled enable MQTT
  53. #endif
  54. #if HOMEASSISTANT_SUPPORT
  55. #undef MQTT_SUPPORT
  56. #define MQTT_SUPPORT 1 // If Home Assistant enabled enable MQTT
  57. #endif
  58. #if THINGSPEAK_SUPPORT
  59. #undef BROKER_SUPPORT
  60. #define BROKER_SUPPORT 1 // If Thingspeak enabled enable BROKER
  61. #endif
  62. #if SCHEDULER_SUPPORT
  63. #undef NTP_SUPPORT
  64. #define NTP_SUPPORT 1 // Scheduler needs NTP to work
  65. #undef BROKER_SUPPORT
  66. #define BROKER_SUPPORT 1 // Scheduler needs Broker to trigger every minute
  67. #endif
  68. #if LWIP_VERSION_MAJOR != 1
  69. #undef MDNS_CLIENT_SUPPORT
  70. #define MDNS_CLIENT_SUPPORT 0 // default resolver already handles this
  71. #endif
  72. #if not defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  73. #undef TELNET_SERVER_ASYNC_BUFFERED
  74. #define TELNET_SERVER_ASYNC_BUFFERED 1 // enable buffered telnet by default on latest Cores
  75. #endif
  76. #if LIGHT_PROVIDER == LIGHT_PROVIDER_TUYA
  77. #undef TUYA_SUPPORT
  78. #define TUYA_SUPPORT 1 // Need base Tuya module for this to work
  79. #undef LIGHT_USE_TRANSITIONS
  80. #define LIGHT_USE_TRANSITIONS 0 // TODO: temporary, maybe slower step instead?
  81. #endif
  82. #if TUYA_SUPPORT
  83. #undef BROKER_SUPPORT
  84. #define BROKER_SUPPORT 1 // Broker is required to process relay & lights events
  85. #endif
  86. //------------------------------------------------------------------------------
  87. // Hint about ESPAsyncTCP options and our internal one
  88. // TODO: clean-up SSL_ENABLED and USE_SSL settings for 1.15.0
  89. #if ASYNC_TCP_SSL_ENABLED && SECURE_CLIENT == SECURE_CLIENT_NONE
  90. #undef SECURE_CLIENT
  91. #define SECURE_CLIENT SECURE_CLIENT_AXTLS
  92. #endif
  93. #if THINGSPEAK_USE_SSL && THINGSPEAK_USE_ASYNC && (!ASYNC_TCP_SSL_ENABLED)
  94. #warning "Thingspeak in ASYNC mode requires a globally defined ASYNC_TCP_SSL_ENABLED=1"
  95. #undef THINGSPEAK_SUPPORT
  96. #define THINGSPEAK_SUPPORT 0 // Thingspeak in ASYNC mode requires ASYNC_TCP_SSL_ENABLED
  97. #endif
  98. #if WEB_SUPPORT && WEB_SSL_ENABLED && (!ASYNC_TCP_SSL_ENABLED)
  99. #warning "WEB_SUPPORT with SSL requires a globally defined ASYNC_TCP_SSL_ENABLED=1"
  100. #undef WEB_SSL_ENABLED
  101. #define WEB_SSL_ENABLED 0 // WEB_SUPPORT mode th SSL requires ASYNC_TCP_SSL_ENABLED
  102. #endif
  103. #if !DEBUG_SUPPORT
  104. #undef DEBUG_LOG_BUFFER_SUPPORT
  105. #define DEBUG_LOG_BUFFER_SUPPORT 0 // Can't buffer if there is no debugging enabled.
  106. // Helps to avoid checking twice for both DEBUG_SUPPORT and BUFFER_LOG_SUPPORT
  107. #endif
  108. //------------------------------------------------------------------------------
  109. // These depend on newest Core libraries
  110. #if LLMNR_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  111. #undef LLMNR_SUPPORT
  112. #define LLMNR_SUPPORT 0
  113. #endif
  114. #if NETBIOS_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  115. #undef NETBIOS_SUPPORT
  116. #define NETBIOS_SUPPORT 0
  117. #endif
  118. #if SSDP_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  119. #undef SSDP_SUPPORT
  120. #define SSDP_SUPPORT 0
  121. #endif
  122. //------------------------------------------------------------------------------
  123. // Change ntp module depending on Core version
  124. #if NTP_SUPPORT && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
  125. #define NTP_LEGACY_SUPPORT 1
  126. #else
  127. #define NTP_LEGACY_SUPPORT 0
  128. #endif
  129. //------------------------------------------------------------------------------
  130. // It looks more natural that one click will enable display
  131. // and long click will switch relay
  132. #if THERMOSTAT_DISPLAY_SUPPORT
  133. #undef BUTTON1_CLICK
  134. #define BUTTON1_CLICK BUTTON_MODE_DISPLAY_ON
  135. #undef BUTTON1_LNGCLICK
  136. #define BUTTON1_LNGCLICK BUTTON_MODE_TOGGLE
  137. #endif