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.

1007 lines
24 KiB

providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
providers: relays, lights and buttons refactoring (#2414) - gpio module now tracks the known providers (right now, hardware and mcp expander) - refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions - refactored button module to use gpio provider instead of referencing types itself - removed dual & stm code from buttons, migrate both to relay module - added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did) - relays runtime configuration keys - relay command now shows configured relays and current & target statuses - refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead - remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT - allow to bind rf codes to real relays - drop tuya-specific lights provider, remove tuya code from relays and lights modules - integrate tuya via relay listeners and providers, use lights custom provider - implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle) - lights custom provider (global, not per-pin) and state listeners - remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT - lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT - refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing - transition time + step parameter for the lightUpdate - report mask parameter for the lightUpdate - minor fixes across the board resolve #2222
3 years ago
  1. // -----------------------------------------------------------------------------
  2. // DEFAULTS PER MODULE
  3. // -----------------------------------------------------------------------------
  4. #pragma once
  5. // -----------------------------------------------------------------------------
  6. // Buttons
  7. // -----------------------------------------------------------------------------
  8. #ifndef BUTTON1_PIN
  9. #define BUTTON1_PIN GPIO_NONE
  10. #endif
  11. #ifndef BUTTON2_PIN
  12. #define BUTTON2_PIN GPIO_NONE
  13. #endif
  14. #ifndef BUTTON3_PIN
  15. #define BUTTON3_PIN GPIO_NONE
  16. #endif
  17. #ifndef BUTTON4_PIN
  18. #define BUTTON4_PIN GPIO_NONE
  19. #endif
  20. #ifndef BUTTON5_PIN
  21. #define BUTTON5_PIN GPIO_NONE
  22. #endif
  23. #ifndef BUTTON6_PIN
  24. #define BUTTON6_PIN GPIO_NONE
  25. #endif
  26. #ifndef BUTTON7_PIN
  27. #define BUTTON7_PIN GPIO_NONE
  28. #endif
  29. #ifndef BUTTON8_PIN
  30. #define BUTTON8_PIN GPIO_NONE
  31. #endif
  32. #ifndef BUTTON1_PIN_TYPE
  33. #define BUTTON1_PIN_TYPE GPIO_TYPE_HARDWARE
  34. #endif
  35. #ifndef BUTTON2_PIN_TYPE
  36. #define BUTTON2_PIN_TYPE GPIO_TYPE_HARDWARE
  37. #endif
  38. #ifndef BUTTON3_PIN_TYPE
  39. #define BUTTON3_PIN_TYPE GPIO_TYPE_HARDWARE
  40. #endif
  41. #ifndef BUTTON4_PIN_TYPE
  42. #define BUTTON4_PIN_TYPE GPIO_TYPE_HARDWARE
  43. #endif
  44. #ifndef BUTTON5_PIN_TYPE
  45. #define BUTTON5_PIN_TYPE GPIO_TYPE_HARDWARE
  46. #endif
  47. #ifndef BUTTON6_PIN_TYPE
  48. #define BUTTON6_PIN_TYPE GPIO_TYPE_HARDWARE
  49. #endif
  50. #ifndef BUTTON7_PIN_TYPE
  51. #define BUTTON7_PIN_TYPE GPIO_TYPE_HARDWARE
  52. #endif
  53. #ifndef BUTTON8_PIN_TYPE
  54. #define BUTTON8_PIN_TYPE GPIO_TYPE_HARDWARE
  55. #endif
  56. #ifndef BUTTON1_CONFIG
  57. #define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  58. #endif
  59. #ifndef BUTTON2_CONFIG
  60. #define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  61. #endif
  62. #ifndef BUTTON3_CONFIG
  63. #define BUTTON3_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  64. #endif
  65. #ifndef BUTTON4_CONFIG
  66. #define BUTTON4_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  67. #endif
  68. #ifndef BUTTON5_CONFIG
  69. #define BUTTON5_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  70. #endif
  71. #ifndef BUTTON6_CONFIG
  72. #define BUTTON6_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  73. #endif
  74. #ifndef BUTTON7_CONFIG
  75. #define BUTTON7_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  76. #endif
  77. #ifndef BUTTON8_CONFIG
  78. #define BUTTON8_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
  79. #endif
  80. #ifndef BUTTON1_PRESS
  81. #define BUTTON1_PRESS BUTTON_ACTION_NONE
  82. #endif
  83. #ifndef BUTTON2_PRESS
  84. #define BUTTON2_PRESS BUTTON_ACTION_NONE
  85. #endif
  86. #ifndef BUTTON3_PRESS
  87. #define BUTTON3_PRESS BUTTON_ACTION_NONE
  88. #endif
  89. #ifndef BUTTON4_PRESS
  90. #define BUTTON4_PRESS BUTTON_ACTION_NONE
  91. #endif
  92. #ifndef BUTTON5_PRESS
  93. #define BUTTON5_PRESS BUTTON_ACTION_NONE
  94. #endif
  95. #ifndef BUTTON6_PRESS
  96. #define BUTTON6_PRESS BUTTON_ACTION_NONE
  97. #endif
  98. #ifndef BUTTON7_PRESS
  99. #define BUTTON7_PRESS BUTTON_ACTION_NONE
  100. #endif
  101. #ifndef BUTTON8_PRESS
  102. #define BUTTON8_PRESS BUTTON_ACTION_NONE
  103. #endif
  104. #ifndef BUTTON1_RELEASE
  105. #define BUTTON1_RELEASE BUTTON_ACTION_NONE
  106. #endif
  107. #ifndef BUTTON2_RELEASE
  108. #define BUTTON2_RELEASE BUTTON_ACTION_NONE
  109. #endif
  110. #ifndef BUTTON3_RELEASE
  111. #define BUTTON3_RELEASE BUTTON_ACTION_NONE
  112. #endif
  113. #ifndef BUTTON4_RELEASE
  114. #define BUTTON4_RELEASE BUTTON_ACTION_NONE
  115. #endif
  116. #ifndef BUTTON5_RELEASE
  117. #define BUTTON5_RELEASE BUTTON_ACTION_NONE
  118. #endif
  119. #ifndef BUTTON6_RELEASE
  120. #define BUTTON6_RELEASE BUTTON_ACTION_NONE
  121. #endif
  122. #ifndef BUTTON7_RELEASE
  123. #define BUTTON7_RELEASE BUTTON_ACTION_NONE
  124. #endif
  125. #ifndef BUTTON8_RELEASE
  126. #define BUTTON8_RELEASE BUTTON_ACTION_NONE
  127. #endif
  128. #ifndef BUTTON1_CLICK
  129. #define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
  130. #endif
  131. #ifndef BUTTON2_CLICK
  132. #define BUTTON2_CLICK BUTTON_ACTION_TOGGLE
  133. #endif
  134. #ifndef BUTTON3_CLICK
  135. #define BUTTON3_CLICK BUTTON_ACTION_TOGGLE
  136. #endif
  137. #ifndef BUTTON4_CLICK
  138. #define BUTTON4_CLICK BUTTON_ACTION_TOGGLE
  139. #endif
  140. #ifndef BUTTON5_CLICK
  141. #define BUTTON5_CLICK BUTTON_ACTION_TOGGLE
  142. #endif
  143. #ifndef BUTTON6_CLICK
  144. #define BUTTON6_CLICK BUTTON_ACTION_TOGGLE
  145. #endif
  146. #ifndef BUTTON7_CLICK
  147. #define BUTTON7_CLICK BUTTON_ACTION_TOGGLE
  148. #endif
  149. #ifndef BUTTON8_CLICK
  150. #define BUTTON8_CLICK BUTTON_ACTION_TOGGLE
  151. #endif
  152. #ifndef BUTTON1_DBLCLICK
  153. #define BUTTON1_DBLCLICK BUTTON_ACTION_AP
  154. #endif
  155. #ifndef BUTTON2_DBLCLICK
  156. #define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
  157. #endif
  158. #ifndef BUTTON3_DBLCLICK
  159. #define BUTTON3_DBLCLICK BUTTON_ACTION_NONE
  160. #endif
  161. #ifndef BUTTON4_DBLCLICK
  162. #define BUTTON4_DBLCLICK BUTTON_ACTION_NONE
  163. #endif
  164. #ifndef BUTTON5_DBLCLICK
  165. #define BUTTON5_DBLCLICK BUTTON_ACTION_NONE
  166. #endif
  167. #ifndef BUTTON6_DBLCLICK
  168. #define BUTTON6_DBLCLICK BUTTON_ACTION_NONE
  169. #endif
  170. #ifndef BUTTON7_DBLCLICK
  171. #define BUTTON7_DBLCLICK BUTTON_ACTION_NONE
  172. #endif
  173. #ifndef BUTTON8_DBLCLICK
  174. #define BUTTON8_DBLCLICK BUTTON_ACTION_NONE
  175. #endif
  176. #ifndef BUTTON1_TRIPLECLICK
  177. #define BUTTON1_TRIPLECLICK BUTTON_ACTION_SMART_CONFIG
  178. #endif
  179. #ifndef BUTTON2_TRIPLECLICK
  180. #define BUTTON2_TRIPLECLICK BUTTON_ACTION_NONE
  181. #endif
  182. #ifndef BUTTON3_TRIPLECLICK
  183. #define BUTTON3_TRIPLECLICK BUTTON_ACTION_NONE
  184. #endif
  185. #ifndef BUTTON4_TRIPLECLICK
  186. #define BUTTON4_TRIPLECLICK BUTTON_ACTION_NONE
  187. #endif
  188. #ifndef BUTTON5_TRIPLECLICK
  189. #define BUTTON5_TRIPLECLICK BUTTON_ACTION_NONE
  190. #endif
  191. #ifndef BUTTON6_TRIPLECLICK
  192. #define BUTTON6_TRIPLECLICK BUTTON_ACTION_NONE
  193. #endif
  194. #ifndef BUTTON7_TRIPLECLICK
  195. #define BUTTON7_TRIPLECLICK BUTTON_ACTION_NONE
  196. #endif
  197. #ifndef BUTTON8_TRIPLECLICK
  198. #define BUTTON8_TRIPLECLICK BUTTON_ACTION_NONE
  199. #endif
  200. #ifndef BUTTON1_LNGCLICK
  201. #define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
  202. #endif
  203. #ifndef BUTTON2_LNGCLICK
  204. #define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
  205. #endif
  206. #ifndef BUTTON3_LNGCLICK
  207. #define BUTTON3_LNGCLICK BUTTON_ACTION_NONE
  208. #endif
  209. #ifndef BUTTON4_LNGCLICK
  210. #define BUTTON4_LNGCLICK BUTTON_ACTION_NONE
  211. #endif
  212. #ifndef BUTTON5_LNGCLICK
  213. #define BUTTON5_LNGCLICK BUTTON_ACTION_NONE
  214. #endif
  215. #ifndef BUTTON6_LNGCLICK
  216. #define BUTTON6_LNGCLICK BUTTON_ACTION_NONE
  217. #endif
  218. #ifndef BUTTON7_LNGCLICK
  219. #define BUTTON7_LNGCLICK BUTTON_ACTION_NONE
  220. #endif
  221. #ifndef BUTTON8_LNGCLICK
  222. #define BUTTON8_LNGCLICK BUTTON_ACTION_NONE
  223. #endif
  224. #ifndef BUTTON1_LNGLNGCLICK
  225. #define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY
  226. #endif
  227. #ifndef BUTTON2_LNGLNGCLICK
  228. #define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE
  229. #endif
  230. #ifndef BUTTON3_LNGLNGCLICK
  231. #define BUTTON3_LNGLNGCLICK BUTTON_ACTION_NONE
  232. #endif
  233. #ifndef BUTTON4_LNGLNGCLICK
  234. #define BUTTON4_LNGLNGCLICK BUTTON_ACTION_NONE
  235. #endif
  236. #ifndef BUTTON5_LNGLNGCLICK
  237. #define BUTTON5_LNGLNGCLICK BUTTON_ACTION_NONE
  238. #endif
  239. #ifndef BUTTON6_LNGLNGCLICK
  240. #define BUTTON6_LNGLNGCLICK BUTTON_ACTION_NONE
  241. #endif
  242. #ifndef BUTTON7_LNGLNGCLICK
  243. #define BUTTON7_LNGLNGCLICK BUTTON_ACTION_NONE
  244. #endif
  245. #ifndef BUTTON8_LNGLNGCLICK
  246. #define BUTTON8_LNGLNGCLICK BUTTON_ACTION_NONE
  247. #endif
  248. #ifndef BUTTON1_RELAY
  249. #define BUTTON1_RELAY RELAY_NONE
  250. #endif
  251. #ifndef BUTTON2_RELAY
  252. #define BUTTON2_RELAY RELAY_NONE
  253. #endif
  254. #ifndef BUTTON3_RELAY
  255. #define BUTTON3_RELAY RELAY_NONE
  256. #endif
  257. #ifndef BUTTON4_RELAY
  258. #define BUTTON4_RELAY RELAY_NONE
  259. #endif
  260. #ifndef BUTTON5_RELAY
  261. #define BUTTON5_RELAY RELAY_NONE
  262. #endif
  263. #ifndef BUTTON6_RELAY
  264. #define BUTTON6_RELAY RELAY_NONE
  265. #endif
  266. #ifndef BUTTON7_RELAY
  267. #define BUTTON7_RELAY RELAY_NONE
  268. #endif
  269. #ifndef BUTTON8_RELAY
  270. #define BUTTON8_RELAY RELAY_NONE
  271. #endif
  272. #ifndef BUTTON1_DEBOUNCE_DELAY
  273. #define BUTTON1_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  274. #endif
  275. #ifndef BUTTON2_DEBOUNCE_DELAY
  276. #define BUTTON2_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  277. #endif
  278. #ifndef BUTTON3_DEBOUNCE_DELAY
  279. #define BUTTON3_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  280. #endif
  281. #ifndef BUTTON4_DEBOUNCE_DELAY
  282. #define BUTTON4_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  283. #endif
  284. #ifndef BUTTON5_DEBOUNCE_DELAY
  285. #define BUTTON5_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  286. #endif
  287. #ifndef BUTTON6_DEBOUNCE_DELAY
  288. #define BUTTON6_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  289. #endif
  290. #ifndef BUTTON7_DEBOUNCE_DELAY
  291. #define BUTTON7_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  292. #endif
  293. #ifndef BUTTON8_DEBOUNCE_DELAY
  294. #define BUTTON8_DEBOUNCE_DELAY BUTTON_DEBOUNCE_DELAY
  295. #endif
  296. #ifndef BUTTON1_REPEAT_DELAY
  297. #define BUTTON1_REPEAT_DELAY BUTTON_REPEAT_DELAY
  298. #endif
  299. #ifndef BUTTON2_REPEAT_DELAY
  300. #define BUTTON2_REPEAT_DELAY BUTTON_REPEAT_DELAY
  301. #endif
  302. #ifndef BUTTON3_REPEAT_DELAY
  303. #define BUTTON3_REPEAT_DELAY BUTTON_REPEAT_DELAY
  304. #endif
  305. #ifndef BUTTON4_REPEAT_DELAY
  306. #define BUTTON4_REPEAT_DELAY BUTTON_REPEAT_DELAY
  307. #endif
  308. #ifndef BUTTON5_REPEAT_DELAY
  309. #define BUTTON5_REPEAT_DELAY BUTTON_REPEAT_DELAY
  310. #endif
  311. #ifndef BUTTON6_REPEAT_DELAY
  312. #define BUTTON6_REPEAT_DELAY BUTTON_REPEAT_DELAY
  313. #endif
  314. #ifndef BUTTON7_REPEAT_DELAY
  315. #define BUTTON7_REPEAT_DELAY BUTTON_REPEAT_DELAY
  316. #endif
  317. #ifndef BUTTON8_REPEAT_DELAY
  318. #define BUTTON8_REPEAT_DELAY BUTTON_REPEAT_DELAY
  319. #endif
  320. #ifndef BUTTON1_LNGCLICK_DELAY
  321. #define BUTTON1_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  322. #endif
  323. #ifndef BUTTON2_LNGCLICK_DELAY
  324. #define BUTTON2_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  325. #endif
  326. #ifndef BUTTON3_LNGCLICK_DELAY
  327. #define BUTTON3_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  328. #endif
  329. #ifndef BUTTON4_LNGCLICK_DELAY
  330. #define BUTTON4_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  331. #endif
  332. #ifndef BUTTON5_LNGCLICK_DELAY
  333. #define BUTTON5_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  334. #endif
  335. #ifndef BUTTON6_LNGCLICK_DELAY
  336. #define BUTTON6_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  337. #endif
  338. #ifndef BUTTON7_LNGCLICK_DELAY
  339. #define BUTTON7_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  340. #endif
  341. #ifndef BUTTON8_LNGCLICK_DELAY
  342. #define BUTTON8_LNGCLICK_DELAY BUTTON_LNGCLICK_DELAY
  343. #endif
  344. #ifndef BUTTON1_LNGLNGCLICK_DELAY
  345. #define BUTTON1_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  346. #endif
  347. #ifndef BUTTON2_LNGLNGCLICK_DELAY
  348. #define BUTTON2_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  349. #endif
  350. #ifndef BUTTON3_LNGLNGCLICK_DELAY
  351. #define BUTTON3_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  352. #endif
  353. #ifndef BUTTON4_LNGLNGCLICK_DELAY
  354. #define BUTTON4_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  355. #endif
  356. #ifndef BUTTON5_LNGLNGCLICK_DELAY
  357. #define BUTTON5_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  358. #endif
  359. #ifndef BUTTON6_LNGLNGCLICK_DELAY
  360. #define BUTTON6_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  361. #endif
  362. #ifndef BUTTON7_LNGLNGCLICK_DELAY
  363. #define BUTTON7_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  364. #endif
  365. #ifndef BUTTON8_LNGLNGCLICK_DELAY
  366. #define BUTTON8_LNGLNGCLICK_DELAY BUTTON_LNGLNGCLICK_DELAY
  367. #endif
  368. #ifndef BUTTON1_MQTT_SEND_ALL_EVENTS
  369. #define BUTTON1_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  370. #endif
  371. #ifndef BUTTON2_MQTT_SEND_ALL_EVENTS
  372. #define BUTTON2_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  373. #endif
  374. #ifndef BUTTON3_MQTT_SEND_ALL_EVENTS
  375. #define BUTTON3_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  376. #endif
  377. #ifndef BUTTON4_MQTT_SEND_ALL_EVENTS
  378. #define BUTTON4_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  379. #endif
  380. #ifndef BUTTON5_MQTT_SEND_ALL_EVENTS
  381. #define BUTTON5_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  382. #endif
  383. #ifndef BUTTON6_MQTT_SEND_ALL_EVENTS
  384. #define BUTTON6_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  385. #endif
  386. #ifndef BUTTON7_MQTT_SEND_ALL_EVENTS
  387. #define BUTTON7_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  388. #endif
  389. #ifndef BUTTON8_MQTT_SEND_ALL_EVENTS
  390. #define BUTTON8_MQTT_SEND_ALL_EVENTS BUTTON_MQTT_SEND_ALL_EVENTS
  391. #endif
  392. #ifndef BUTTON1_MQTT_RETAIN
  393. #define BUTTON1_MQTT_RETAIN BUTTON_MQTT_RETAIN
  394. #endif
  395. #ifndef BUTTON2_MQTT_RETAIN
  396. #define BUTTON2_MQTT_RETAIN BUTTON_MQTT_RETAIN
  397. #endif
  398. #ifndef BUTTON3_MQTT_RETAIN
  399. #define BUTTON3_MQTT_RETAIN BUTTON_MQTT_RETAIN
  400. #endif
  401. #ifndef BUTTON4_MQTT_RETAIN
  402. #define BUTTON4_MQTT_RETAIN BUTTON_MQTT_RETAIN
  403. #endif
  404. #ifndef BUTTON5_MQTT_RETAIN
  405. #define BUTTON5_MQTT_RETAIN BUTTON_MQTT_RETAIN
  406. #endif
  407. #ifndef BUTTON6_MQTT_RETAIN
  408. #define BUTTON6_MQTT_RETAIN BUTTON_MQTT_RETAIN
  409. #endif
  410. #ifndef BUTTON7_MQTT_RETAIN
  411. #define BUTTON7_MQTT_RETAIN BUTTON_MQTT_RETAIN
  412. #endif
  413. #ifndef BUTTON8_MQTT_RETAIN
  414. #define BUTTON8_MQTT_RETAIN BUTTON_MQTT_RETAIN
  415. #endif
  416. #ifndef BUTTON1_PROVIDER
  417. #define BUTTON1_PROVIDER BUTTON_PROVIDER_GPIO
  418. #endif
  419. #ifndef BUTTON2_PROVIDER
  420. #define BUTTON2_PROVIDER BUTTON_PROVIDER_GPIO
  421. #endif
  422. #ifndef BUTTON3_PROVIDER
  423. #define BUTTON3_PROVIDER BUTTON_PROVIDER_GPIO
  424. #endif
  425. #ifndef BUTTON4_PROVIDER
  426. #define BUTTON4_PROVIDER BUTTON_PROVIDER_GPIO
  427. #endif
  428. #ifndef BUTTON5_PROVIDER
  429. #define BUTTON5_PROVIDER BUTTON_PROVIDER_GPIO
  430. #endif
  431. #ifndef BUTTON6_PROVIDER
  432. #define BUTTON6_PROVIDER BUTTON_PROVIDER_GPIO
  433. #endif
  434. #ifndef BUTTON7_PROVIDER
  435. #define BUTTON7_PROVIDER BUTTON_PROVIDER_GPIO
  436. #endif
  437. #ifndef BUTTON8_PROVIDER
  438. #define BUTTON8_PROVIDER BUTTON_PROVIDER_GPIO
  439. #endif
  440. #ifndef BUTTON1_ANALOG_LEVEL
  441. #define BUTTON1_ANALOG_LEVEL 0
  442. #endif
  443. #ifndef BUTTON2_ANALOG_LEVEL
  444. #define BUTTON2_ANALOG_LEVEL 0
  445. #endif
  446. #ifndef BUTTON3_ANALOG_LEVEL
  447. #define BUTTON3_ANALOG_LEVEL 0
  448. #endif
  449. #ifndef BUTTON4_ANALOG_LEVEL
  450. #define BUTTON4_ANALOG_LEVEL 0
  451. #endif
  452. #ifndef BUTTON5_ANALOG_LEVEL
  453. #define BUTTON5_ANALOG_LEVEL 0
  454. #endif
  455. #ifndef BUTTON6_ANALOG_LEVEL
  456. #define BUTTON6_ANALOG_LEVEL 0
  457. #endif
  458. #ifndef BUTTON7_ANALOG_LEVEL
  459. #define BUTTON7_ANALOG_LEVEL 0
  460. #endif
  461. #ifndef BUTTON8_ANALOG_LEVEL
  462. #define BUTTON8_ANALOG_LEVEL 0
  463. #endif
  464. // -----------------------------------------------------------------------------
  465. // Encoders
  466. // -----------------------------------------------------------------------------
  467. #ifndef ENCODER1_PIN1
  468. #define ENCODER1_PIN1 GPIO_NONE
  469. #endif
  470. #ifndef ENCODER2_PIN1
  471. #define ENCODER2_PIN1 GPIO_NONE
  472. #endif
  473. #ifndef ENCODER3_PIN1
  474. #define ENCODER3_PIN1 GPIO_NONE
  475. #endif
  476. #ifndef ENCODER4_PIN1
  477. #define ENCODER4_PIN1 GPIO_NONE
  478. #endif
  479. #ifndef ENCODER5_PIN1
  480. #define ENCODER5_PIN1 GPIO_NONE
  481. #endif
  482. #ifndef ENCODER1_PIN2
  483. #define ENCODER1_PIN2 GPIO_NONE
  484. #endif
  485. #ifndef ENCODER2_PIN2
  486. #define ENCODER2_PIN2 GPIO_NONE
  487. #endif
  488. #ifndef ENCODER3_PIN2
  489. #define ENCODER3_PIN2 GPIO_NONE
  490. #endif
  491. #ifndef ENCODER4_PIN2
  492. #define ENCODER4_PIN2 GPIO_NONE
  493. #endif
  494. #ifndef ENCODER5_PIN2
  495. #define ENCODER5_PIN2 GPIO_NONE
  496. #endif
  497. #ifndef ENCODER1_BUTTON_PIN
  498. #define ENCODER1_BUTTON_PIN GPIO_NONE
  499. #endif
  500. #ifndef ENCODER2_BUTTON_PIN
  501. #define ENCODER2_BUTTON_PIN GPIO_NONE
  502. #endif
  503. #ifndef ENCODER3_BUTTON_PIN
  504. #define ENCODER3_BUTTON_PIN GPIO_NONE
  505. #endif
  506. #ifndef ENCODER4_BUTTON_PIN
  507. #define ENCODER4_BUTTON_PIN GPIO_NONE
  508. #endif
  509. #ifndef ENCODER5_BUTTON_PIN
  510. #define ENCODER5_BUTTON_PIN GPIO_NONE
  511. #endif
  512. #ifndef ENCODER1_BUTTON_LOGIC
  513. #define ENCODER1_BUTTON_LOGIC HIGH
  514. #endif
  515. #ifndef ENCODER2_BUTTON_LOGIC
  516. #define ENCODER2_BUTTON_LOGIC HIGH
  517. #endif
  518. #ifndef ENCODER3_BUTTON_LOGIC
  519. #define ENCODER3_BUTTON_LOGIC HIGH
  520. #endif
  521. #ifndef ENCODER4_BUTTON_LOGIC
  522. #define ENCODER4_BUTTON_LOGIC HIGH
  523. #endif
  524. #ifndef ENCODER5_BUTTON_LOGIC
  525. #define ENCODER5_BUTTON_LOGIC HIGH
  526. #endif
  527. #ifndef ENCODER1_BUTTON_MODE
  528. #define ENCODER1_BUTTON_MODE INPUT_PULLUP
  529. #endif
  530. #ifndef ENCODER2_BUTTON_MODE
  531. #define ENCODER2_BUTTON_MODE INPUT_PULLUP
  532. #endif
  533. #ifndef ENCODER3_BUTTON_MODE
  534. #define ENCODER3_BUTTON_MODE INPUT_PULLUP
  535. #endif
  536. #ifndef ENCODER4_BUTTON_MODE
  537. #define ENCODER4_BUTTON_MODE INPUT_PULLUP
  538. #endif
  539. #ifndef ENCODER5_BUTTON_MODE
  540. #define ENCODER5_BUTTON_MODE INPUT_PULLUP
  541. #endif
  542. #ifndef ENCODER1_MODE
  543. #define ENCODER1_MODE 1
  544. #endif
  545. #ifndef ENCODER2_MODE
  546. #define ENCODER2_MODE 1
  547. #endif
  548. #ifndef ENCODER3_MODE
  549. #define ENCODER3_MODE 1
  550. #endif
  551. #ifndef ENCODER4_MODE
  552. #define ENCODER4_MODE 1
  553. #endif
  554. #ifndef ENCODER5_MODE
  555. #define ENCODER5_MODE 1
  556. #endif
  557. #ifndef ENCODER1_CHANNEL1
  558. #define ENCODER1_CHANNEL1 0
  559. #endif
  560. #ifndef ENCODER2_CHANNEL1
  561. #define ENCODER2_CHANNEL1 0
  562. #endif
  563. #ifndef ENCODER3_CHANNEL1
  564. #define ENCODER3_CHANNEL1 0
  565. #endif
  566. #ifndef ENCODER4_CHANNEL1
  567. #define ENCODER4_CHANNEL1 0
  568. #endif
  569. #ifndef ENCODER5_CHANNEL1
  570. #define ENCODER5_CHANNEL1 0
  571. #endif
  572. #ifndef ENCODER1_CHANNEL2
  573. #define ENCODER1_CHANNEL2 1
  574. #endif
  575. #ifndef ENCODER2_CHANNEL2
  576. #define ENCODER2_CHANNEL2 1
  577. #endif
  578. #ifndef ENCODER3_CHANNEL2
  579. #define ENCODER3_CHANNEL2 1
  580. #endif
  581. #ifndef ENCODER4_CHANNEL2
  582. #define ENCODER4_CHANNEL2 1
  583. #endif
  584. #ifndef ENCODER5_CHANNEL2
  585. #define ENCODER5_CHANNEL2 1
  586. #endif
  587. // -----------------------------------------------------------------------------
  588. // Relays
  589. // -----------------------------------------------------------------------------
  590. #ifndef DUMMY_RELAY_COUNT
  591. #define DUMMY_RELAY_COUNT 0
  592. #endif
  593. #ifndef RELAY1_PIN
  594. #define RELAY1_PIN GPIO_NONE
  595. #endif
  596. #ifndef RELAY2_PIN
  597. #define RELAY2_PIN GPIO_NONE
  598. #endif
  599. #ifndef RELAY3_PIN
  600. #define RELAY3_PIN GPIO_NONE
  601. #endif
  602. #ifndef RELAY4_PIN
  603. #define RELAY4_PIN GPIO_NONE
  604. #endif
  605. #ifndef RELAY5_PIN
  606. #define RELAY5_PIN GPIO_NONE
  607. #endif
  608. #ifndef RELAY6_PIN
  609. #define RELAY6_PIN GPIO_NONE
  610. #endif
  611. #ifndef RELAY7_PIN
  612. #define RELAY7_PIN GPIO_NONE
  613. #endif
  614. #ifndef RELAY8_PIN
  615. #define RELAY8_PIN GPIO_NONE
  616. #endif
  617. #ifndef RELAY1_TYPE
  618. #define RELAY1_TYPE RELAY_TYPE_NORMAL
  619. #endif
  620. #ifndef RELAY2_TYPE
  621. #define RELAY2_TYPE RELAY_TYPE_NORMAL
  622. #endif
  623. #ifndef RELAY3_TYPE
  624. #define RELAY3_TYPE RELAY_TYPE_NORMAL
  625. #endif
  626. #ifndef RELAY4_TYPE
  627. #define RELAY4_TYPE RELAY_TYPE_NORMAL
  628. #endif
  629. #ifndef RELAY5_TYPE
  630. #define RELAY5_TYPE RELAY_TYPE_NORMAL
  631. #endif
  632. #ifndef RELAY6_TYPE
  633. #define RELAY6_TYPE RELAY_TYPE_NORMAL
  634. #endif
  635. #ifndef RELAY7_TYPE
  636. #define RELAY7_TYPE RELAY_TYPE_NORMAL
  637. #endif
  638. #ifndef RELAY8_TYPE
  639. #define RELAY8_TYPE RELAY_TYPE_NORMAL
  640. #endif
  641. #ifndef RELAY1_RESET_PIN
  642. #define RELAY1_RESET_PIN GPIO_NONE
  643. #endif
  644. #ifndef RELAY2_RESET_PIN
  645. #define RELAY2_RESET_PIN GPIO_NONE
  646. #endif
  647. #ifndef RELAY3_RESET_PIN
  648. #define RELAY3_RESET_PIN GPIO_NONE
  649. #endif
  650. #ifndef RELAY4_RESET_PIN
  651. #define RELAY4_RESET_PIN GPIO_NONE
  652. #endif
  653. #ifndef RELAY5_RESET_PIN
  654. #define RELAY5_RESET_PIN GPIO_NONE
  655. #endif
  656. #ifndef RELAY6_RESET_PIN
  657. #define RELAY6_RESET_PIN GPIO_NONE
  658. #endif
  659. #ifndef RELAY7_RESET_PIN
  660. #define RELAY7_RESET_PIN GPIO_NONE
  661. #endif
  662. #ifndef RELAY8_RESET_PIN
  663. #define RELAY8_RESET_PIN GPIO_NONE
  664. #endif
  665. #ifndef RELAY1_DELAY_ON
  666. #define RELAY1_DELAY_ON 0
  667. #endif
  668. #ifndef RELAY2_DELAY_ON
  669. #define RELAY2_DELAY_ON 0
  670. #endif
  671. #ifndef RELAY3_DELAY_ON
  672. #define RELAY3_DELAY_ON 0
  673. #endif
  674. #ifndef RELAY4_DELAY_ON
  675. #define RELAY4_DELAY_ON 0
  676. #endif
  677. #ifndef RELAY5_DELAY_ON
  678. #define RELAY5_DELAY_ON 0
  679. #endif
  680. #ifndef RELAY6_DELAY_ON
  681. #define RELAY6_DELAY_ON 0
  682. #endif
  683. #ifndef RELAY7_DELAY_ON
  684. #define RELAY7_DELAY_ON 0
  685. #endif
  686. #ifndef RELAY8_DELAY_ON
  687. #define RELAY8_DELAY_ON 0
  688. #endif
  689. #ifndef RELAY1_DELAY_OFF
  690. #define RELAY1_DELAY_OFF 0
  691. #endif
  692. #ifndef RELAY2_DELAY_OFF
  693. #define RELAY2_DELAY_OFF 0
  694. #endif
  695. #ifndef RELAY3_DELAY_OFF
  696. #define RELAY3_DELAY_OFF 0
  697. #endif
  698. #ifndef RELAY4_DELAY_OFF
  699. #define RELAY4_DELAY_OFF 0
  700. #endif
  701. #ifndef RELAY5_DELAY_OFF
  702. #define RELAY5_DELAY_OFF 0
  703. #endif
  704. #ifndef RELAY6_DELAY_OFF
  705. #define RELAY6_DELAY_OFF 0
  706. #endif
  707. #ifndef RELAY7_DELAY_OFF
  708. #define RELAY7_DELAY_OFF 0
  709. #endif
  710. #ifndef RELAY8_DELAY_OFF
  711. #define RELAY8_DELAY_OFF 0
  712. #endif
  713. #ifndef RELAY1_PROVIDER
  714. #define RELAY1_PROVIDER RELAY_PROVIDER_GPIO
  715. #endif
  716. #ifndef RELAY2_PROVIDER
  717. #define RELAY2_PROVIDER RELAY_PROVIDER_GPIO
  718. #endif
  719. #ifndef RELAY3_PROVIDER
  720. #define RELAY3_PROVIDER RELAY_PROVIDER_GPIO
  721. #endif
  722. #ifndef RELAY4_PROVIDER
  723. #define RELAY4_PROVIDER RELAY_PROVIDER_GPIO
  724. #endif
  725. #ifndef RELAY5_PROVIDER
  726. #define RELAY5_PROVIDER RELAY_PROVIDER_GPIO
  727. #endif
  728. #ifndef RELAY6_PROVIDER
  729. #define RELAY6_PROVIDER RELAY_PROVIDER_GPIO
  730. #endif
  731. #ifndef RELAY7_PROVIDER
  732. #define RELAY7_PROVIDER RELAY_PROVIDER_GPIO
  733. #endif
  734. #ifndef RELAY8_PROVIDER
  735. #define RELAY8_PROVIDER RELAY_PROVIDER_GPIO
  736. #endif
  737. #ifndef RELAY1_PIN_TYPE
  738. #define RELAY1_PIN_TYPE GPIO_TYPE_HARDWARE
  739. #endif
  740. #ifndef RELAY2_PIN_TYPE
  741. #define RELAY2_PIN_TYPE GPIO_TYPE_HARDWARE
  742. #endif
  743. #ifndef RELAY3_PIN_TYPE
  744. #define RELAY3_PIN_TYPE GPIO_TYPE_HARDWARE
  745. #endif
  746. #ifndef RELAY4_PIN_TYPE
  747. #define RELAY4_PIN_TYPE GPIO_TYPE_HARDWARE
  748. #endif
  749. #ifndef RELAY5_PIN_TYPE
  750. #define RELAY5_PIN_TYPE GPIO_TYPE_HARDWARE
  751. #endif
  752. #ifndef RELAY6_PIN_TYPE
  753. #define RELAY6_PIN_TYPE GPIO_TYPE_HARDWARE
  754. #endif
  755. #ifndef RELAY7_PIN_TYPE
  756. #define RELAY7_PIN_TYPE GPIO_TYPE_HARDWARE
  757. #endif
  758. #ifndef RELAY8_PIN_TYPE
  759. #define RELAY8_PIN_TYPE GPIO_TYPE_HARDWARE
  760. #endif
  761. #ifndef RELAY1_BOOT_MODE
  762. #define RELAY1_BOOT_MODE RELAY_BOOT_MODE
  763. #endif
  764. #ifndef RELAY2_BOOT_MODE
  765. #define RELAY2_BOOT_MODE RELAY_BOOT_MODE
  766. #endif
  767. #ifndef RELAY3_BOOT_MODE
  768. #define RELAY3_BOOT_MODE RELAY_BOOT_MODE
  769. #endif
  770. #ifndef RELAY4_BOOT_MODE
  771. #define RELAY4_BOOT_MODE RELAY_BOOT_MODE
  772. #endif
  773. #ifndef RELAY5_BOOT_MODE
  774. #define RELAY5_BOOT_MODE RELAY_BOOT_MODE
  775. #endif
  776. #ifndef RELAY6_BOOT_MODE
  777. #define RELAY6_BOOT_MODE RELAY_BOOT_MODE
  778. #endif
  779. #ifndef RELAY7_BOOT_MODE
  780. #define RELAY7_BOOT_MODE RELAY_BOOT_MODE
  781. #endif
  782. #ifndef RELAY8_BOOT_MODE
  783. #define RELAY8_BOOT_MODE RELAY_BOOT_MODE
  784. #endif
  785. // -----------------------------------------------------------------------------
  786. // LEDs
  787. // -----------------------------------------------------------------------------
  788. #ifndef LED1_PIN
  789. #define LED1_PIN GPIO_NONE
  790. #endif
  791. #ifndef LED2_PIN
  792. #define LED2_PIN GPIO_NONE
  793. #endif
  794. #ifndef LED3_PIN
  795. #define LED3_PIN GPIO_NONE
  796. #endif
  797. #ifndef LED4_PIN
  798. #define LED4_PIN GPIO_NONE
  799. #endif
  800. #ifndef LED5_PIN
  801. #define LED5_PIN GPIO_NONE
  802. #endif
  803. #ifndef LED6_PIN
  804. #define LED6_PIN GPIO_NONE
  805. #endif
  806. #ifndef LED7_PIN
  807. #define LED7_PIN GPIO_NONE
  808. #endif
  809. #ifndef LED8_PIN
  810. #define LED8_PIN GPIO_NONE
  811. #endif
  812. #ifndef LED1_MODE
  813. #define LED1_MODE LED_MODE_WIFI
  814. #endif
  815. #ifndef LED2_MODE
  816. #define LED2_MODE LED_MODE_MANUAL
  817. #endif
  818. #ifndef LED3_MODE
  819. #define LED3_MODE LED_MODE_MANUAL
  820. #endif
  821. #ifndef LED4_MODE
  822. #define LED4_MODE LED_MODE_MANUAL
  823. #endif
  824. #ifndef LED5_MODE
  825. #define LED5_MODE LED_MODE_MANUAL
  826. #endif
  827. #ifndef LED6_MODE
  828. #define LED6_MODE LED_MODE_MANUAL
  829. #endif
  830. #ifndef LED7_MODE
  831. #define LED7_MODE LED_MODE_MANUAL
  832. #endif
  833. #ifndef LED8_MODE
  834. #define LED8_MODE LED_MODE_MANUAL
  835. #endif
  836. #ifndef LED1_RELAY
  837. #define LED1_RELAY 1
  838. #endif
  839. #ifndef LED2_RELAY
  840. #define LED2_RELAY 2
  841. #endif
  842. #ifndef LED3_RELAY
  843. #define LED3_RELAY 3
  844. #endif
  845. #ifndef LED4_RELAY
  846. #define LED4_RELAY 4
  847. #endif
  848. #ifndef LED5_RELAY
  849. #define LED5_RELAY 5
  850. #endif
  851. #ifndef LED6_RELAY
  852. #define LED6_RELAY 6
  853. #endif
  854. #ifndef LED7_RELAY
  855. #define LED7_RELAY 7
  856. #endif
  857. #ifndef LED8_RELAY
  858. #define LED8_RELAY 8
  859. #endif
  860. #ifndef LED1_PIN_INVERSE
  861. #define LED1_PIN_INVERSE 0
  862. #endif
  863. #ifndef LED2_PIN_INVERSE
  864. #define LED2_PIN_INVERSE 0
  865. #endif
  866. #ifndef LED3_PIN_INVERSE
  867. #define LED3_PIN_INVERSE 0
  868. #endif
  869. #ifndef LED4_PIN_INVERSE
  870. #define LED4_PIN_INVERSE 0
  871. #endif
  872. #ifndef LED5_PIN_INVERSE
  873. #define LED5_PIN_INVERSE 0
  874. #endif
  875. #ifndef LED6_PIN_INVERSE
  876. #define LED6_PIN_INVERSE 0
  877. #endif
  878. #ifndef LED7_PIN_INVERSE
  879. #define LED7_PIN_INVERSE 0
  880. #endif
  881. #ifndef LED8_PIN_INVERSE
  882. #define LED8_PIN_INVERSE 0
  883. #endif
  884. // -----------------------------------------------------------------------------
  885. // Lights
  886. // -----------------------------------------------------------------------------
  887. #ifndef LIGHT_CHANNELS
  888. #define LIGHT_CHANNELS 0
  889. #endif
  890. #ifndef LIGHT_ENABLE_PIN
  891. #define LIGHT_ENABLE_PIN GPIO_NONE
  892. #endif
  893. #ifndef LIGHT_CH1_PIN
  894. #define LIGHT_CH1_PIN GPIO_NONE
  895. #endif
  896. #ifndef LIGHT_CH2_PIN
  897. #define LIGHT_CH2_PIN GPIO_NONE
  898. #endif
  899. #ifndef LIGHT_CH3_PIN
  900. #define LIGHT_CH3_PIN GPIO_NONE
  901. #endif
  902. #ifndef LIGHT_CH4_PIN
  903. #define LIGHT_CH4_PIN GPIO_NONE
  904. #endif
  905. #ifndef LIGHT_CH5_PIN
  906. #define LIGHT_CH5_PIN GPIO_NONE
  907. #endif
  908. #ifndef LIGHT_CH1_INVERSE
  909. #define LIGHT_CH1_INVERSE 0
  910. #endif
  911. #ifndef LIGHT_CH2_INVERSE
  912. #define LIGHT_CH2_INVERSE 0
  913. #endif
  914. #ifndef LIGHT_CH3_INVERSE
  915. #define LIGHT_CH3_INVERSE 0
  916. #endif
  917. #ifndef LIGHT_CH4_INVERSE
  918. #define LIGHT_CH4_INVERSE 0
  919. #endif
  920. #ifndef LIGHT_CH5_INVERSE
  921. #define LIGHT_CH5_INVERSE 0
  922. #endif
  923. // -----------------------------------------------------------------------------
  924. // General
  925. // -----------------------------------------------------------------------------
  926. // Device name (DNS, SoftAP SSID, ALEXA etc.)
  927. // If empty, default will be ESPURNA-XXXXXX, where XXXXXX is last 3 octets of chipID
  928. // When set, must be 1..31 characters. See:
  929. // https://github.com/xoseperez/espurna/issues/921
  930. // https://github.com/xoseperez/espurna/issues/1151
  931. #ifndef HOSTNAME
  932. #define HOSTNAME ""
  933. #endif