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.

603 lines
20 KiB

  1. // -----------------------------------------------------------------------------
  2. // Configuration HELP
  3. // -----------------------------------------------------------------------------
  4. //
  5. // MANUFACTURER: Name of the manufacturer of the board ("string")
  6. // DEVICE: Name of the device ("string")
  7. // BUTTON#_PIN: GPIO for the n-th button (1-based, up to 4 buttons)
  8. // BUTTON#_RELAY: Relay number that will be bind to the n-th button (1-based)
  9. // BUTTON#_MODE: A mask of options (BUTTON_PUSHBUTTON and BUTTON_SWITCH cannot be together)
  10. // - BUTTON_PUSHBUTTON: button event is fired when released
  11. // - BUTTON_SWITCH: button event is fired when pressed or released
  12. // - BUTTON_DEFAULT_HIGH: there is a pull up in place
  13. // - BUTTON_SET_PULLUP: set pullup by software
  14. // RELAY#_PIN: GPIO for the n-th relay (1-based, up to 4 relays)
  15. // RELAY#_PIN_INVERSE: Relay has inversed logic (closed or ON when pulled down)
  16. // RELAY#_LED: LED number that will be bind to the n-th relay (1-based)
  17. // LED#_PIN: GPIO for the n-th LED (1-based, up to 4 LEDs)
  18. // LED#_PIN_INVERSE: LED has inversed logic (lit when pulled down)
  19. // WIFI_LED: LED number that will used for WIFI notifications (1-based, defaults to 1)
  20. // -----------------------------------------------------------------------------
  21. // Development boards
  22. // -----------------------------------------------------------------------------
  23. #if defined(NODEMCUV2)
  24. #define MANUFACTURER "NODEMCU"
  25. #define DEVICE "LOLIN"
  26. #define BUTTON1_PIN 0
  27. #define BUTTON1_RELAY 1
  28. #define BUTTON1_LNGCLICK BUTTON_MODE_PULSE
  29. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  30. #define RELAY1_PIN 12
  31. #define RELAY1_PIN_INVERSE 0
  32. #define LED1_PIN 2
  33. #define LED1_PIN_INVERSE 1
  34. #elif defined(D1_RELAYSHIELD)
  35. #define MANUFACTURER "WEMOS"
  36. #define DEVICE "D1_MINI"
  37. #define RELAY1_PIN 5
  38. #define RELAY1_PIN_INVERSE 0
  39. #define LED1_PIN 2
  40. #define LED1_PIN_INVERSE 1
  41. // -----------------------------------------------------------------------------
  42. // ESPurna
  43. // -----------------------------------------------------------------------------
  44. #elif defined(ESPURNA_H)
  45. #define MANUFACTURER "TINKERMAN"
  46. #define DEVICE "ESPURNA_H"
  47. #define RELAY1_PIN 12
  48. #define RELAY1_PIN_INVERSE 1
  49. #define LED1_PIN 5
  50. #define LED1_PIN_INVERSE 0
  51. #define BUTTON1_PIN 4
  52. #define BUTTON1_RELAY 1
  53. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  54. #define ENABLE_HLW8012 1
  55. // -----------------------------------------------------------------------------
  56. // Itead Studio boards
  57. // -----------------------------------------------------------------------------
  58. #elif defined(SONOFF)
  59. #define MANUFACTURER "ITEAD"
  60. #define DEVICE "SONOFF"
  61. #define BUTTON1_PIN 0
  62. #define BUTTON1_RELAY 1
  63. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  64. #define RELAY1_PIN 12
  65. #define RELAY1_PIN_INVERSE 0
  66. #define LED1_PIN 13
  67. #define LED1_PIN_INVERSE 1
  68. #elif defined(SONOFF_TH)
  69. #define MANUFACTURER "ITEAD"
  70. #define DEVICE "SONOFF_TH"
  71. #define BUTTON1_PIN 0
  72. #define BUTTON1_RELAY 1
  73. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  74. #define RELAY1_PIN 12
  75. #define RELAY1_PIN_INVERSE 0
  76. #define LED1_PIN 13
  77. #define LED1_PIN_INVERSE 1
  78. #elif defined(SONOFF_SV)
  79. #define MANUFACTURER "ITEAD"
  80. #define DEVICE "SONOFF_SV"
  81. #define BUTTON1_PIN 0
  82. #define BUTTON1_RELAY 1
  83. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  84. #define RELAY1_PIN 12
  85. #define RELAY1_PIN_INVERSE 0
  86. #define LED1_PIN 13
  87. #define LED1_PIN_INVERSE 1
  88. #elif defined(SLAMPHER)
  89. #define MANUFACTURER "ITEAD"
  90. #define DEVICE "SLAMPHER"
  91. #define BUTTON1_PIN 0
  92. #define BUTTON1_RELAY 1
  93. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  94. #define RELAY1_PIN 12
  95. #define RELAY1_PIN_INVERSE 0
  96. #define LED1_PIN 13
  97. #define LED1_PIN_INVERSE 1
  98. #elif defined(S20)
  99. #define MANUFACTURER "ITEAD"
  100. #define DEVICE "S20"
  101. #define BUTTON1_PIN 0
  102. #define BUTTON1_RELAY 1
  103. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  104. #define RELAY1_PIN 12
  105. #define RELAY1_PIN_INVERSE 0
  106. #define LED1_PIN 13
  107. #define LED1_PIN_INVERSE 1
  108. #elif defined(SONOFF_TOUCH)
  109. #define MANUFACTURER "ITEAD"
  110. #define DEVICE "SONOFF_TOUCH"
  111. #define BUTTON1_PIN 0
  112. #define BUTTON1_RELAY 1
  113. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  114. #define RELAY1_PIN 12
  115. #define RELAY1_PIN_INVERSE 0
  116. #define LED1_PIN 13
  117. #define LED1_PIN_INVERSE 1
  118. #elif defined(SONOFF_POW)
  119. #define MANUFACTURER "ITEAD"
  120. #define DEVICE "SONOFF_POW"
  121. #define BUTTON1_PIN 0
  122. #define BUTTON1_RELAY 1
  123. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  124. #define RELAY1_PIN 12
  125. #define RELAY1_PIN_INVERSE 0
  126. #define LED1_PIN 15
  127. #define LED1_PIN_INVERSE 0
  128. #define ENABLE_HLW8012 1
  129. #elif defined(SONOFF_DUAL)
  130. #define MANUFACTURER "ITEAD"
  131. #define DEVICE "SONOFF_DUAL"
  132. #define BUTTON3_RELAY 1
  133. #define LED1_PIN 13
  134. #define LED1_PIN_INVERSE 1
  135. #undef SERIAL_BAUDRATE
  136. #define SERIAL_BAUDRATE 19230
  137. #undef RELAY_PROVIDER
  138. #define RELAY_PROVIDER RELAY_PROVIDER_DUAL
  139. #define DUMMY_RELAY_COUNT 2
  140. #elif defined(SONOFF_4CH)
  141. #define MANUFACTURER "ITEAD"
  142. #define DEVICE "SONOFF_4CH"
  143. #define BUTTON1_PIN 0
  144. #define BUTTON1_RELAY 1
  145. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  146. #define BUTTON2_PIN 9
  147. #define BUTTON2_RELAY 2
  148. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  149. #define BUTTON3_PIN 10
  150. #define BUTTON3_RELAY 3
  151. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  152. #define BUTTON4_PIN 14
  153. #define BUTTON4_RELAY 4
  154. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  155. #define RELAY1_PIN 12
  156. #define RELAY1_PIN_INVERSE 0
  157. #define RELAY2_PIN 5
  158. #define RELAY2_PIN_INVERSE 0
  159. #define RELAY3_PIN 4
  160. #define RELAY3_PIN_INVERSE 0
  161. #define RELAY4_PIN 15
  162. #define RELAY4_PIN_INVERSE 0
  163. #define LED1_PIN 13
  164. #define LED1_PIN_INVERSE 1
  165. #elif defined(SONOFF_4CH_PRO)
  166. #define MANUFACTURER "ITEAD"
  167. #define DEVICE "SONOFF_4CH_PRO"
  168. #define BUTTON1_PIN 0
  169. #define BUTTON1_RELAY 1
  170. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  171. #define BUTTON2_PIN 9
  172. #define BUTTON2_RELAY 2
  173. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  174. #define BUTTON3_PIN 10
  175. #define BUTTON3_RELAY 3
  176. #define BUTTON3_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  177. #define BUTTON4_PIN 14
  178. #define BUTTON4_RELAY 4
  179. #define BUTTON4_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  180. #define RELAY1_PIN 12
  181. #define RELAY1_PIN_INVERSE 0
  182. #define RELAY2_PIN 5
  183. #define RELAY2_PIN_INVERSE 0
  184. #define RELAY3_PIN 4
  185. #define RELAY3_PIN_INVERSE 0
  186. #define RELAY4_PIN 15
  187. #define RELAY4_PIN_INVERSE 0
  188. #define LED1_PIN 13
  189. #define LED1_PIN_INVERSE 1
  190. #elif defined(ITEAD_1CH_INCHING)
  191. // The inching functionality is managed by a misterious IC in the board.
  192. // You cannot control the inching button and functionality from the ESP8266
  193. // Besides, enabling the inching functionality using the hardware button
  194. // will result in the relay switching on and off continuously.
  195. // Fortunately the unkown IC keeps memory of the hardware inching status
  196. // so you can just disable it and forget. The inching LED must be lit.
  197. // You can still use the pulse options from the web interface
  198. // without problem.
  199. #define MANUFACTURER "ITEAD"
  200. #define DEVICE "1CH_INCHING"
  201. #define BUTTON1_PIN 0
  202. #define BUTTON1_RELAY 1
  203. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  204. #define RELAY1_PIN 12
  205. #define RELAY1_PIN_INVERSE 0
  206. #define LED1_PIN 13
  207. #define LED1_PIN_INVERSE 1
  208. #elif defined(ITEAD_MOTOR)
  209. #define MANUFACTURER "ITEAD"
  210. #define DEVICE "MOTOR"
  211. #define BUTTON1_PIN 0
  212. #define BUTTON1_RELAY 1
  213. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  214. #define RELAY1_PIN 12
  215. #define RELAY1_PIN_INVERSE 0
  216. #define LED1_PIN 13
  217. #define LED1_PIN_INVERSE 1
  218. #elif defined(ITEAD_BNSZ01)
  219. #define MANUFACTURER "ITEAD"
  220. #define DEVICE "BN-SZ01"
  221. #define LED1_PIN 13
  222. #define LED1_PIN_INVERSE 1
  223. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  224. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  225. #define DUMMY_RELAY_COUNT 1
  226. #define LIGHT_CH1_PIN 12
  227. #define LIGHT_CH1_INVERSE 0
  228. #elif defined(SONOFF_RFBRIDGE)
  229. #define MANUFACTURER "ITEAD"
  230. #define DEVICE "RFBRIDGE"
  231. #define BUTTON1_PIN 0
  232. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  233. #define LED1_PIN 13
  234. #define LED1_PIN_INVERSE 1
  235. #undef SERIAL_BAUDRATE
  236. #define SERIAL_BAUDRATE 19200
  237. #undef RELAY_PROVIDER
  238. #define RELAY_PROVIDER RELAY_PROVIDER_RFBRIDGE
  239. #define DUMMY_RELAY_COUNT 6
  240. #define TRACK_RELAY_STATUS 0
  241. // -----------------------------------------------------------------------------
  242. // Electrodragon boards
  243. // -----------------------------------------------------------------------------
  244. #elif defined(ESP_RELAY_BOARD)
  245. #define MANUFACTURER "ELECTRODRAGON"
  246. #define DEVICE "ESP_RELAY_BOARD"
  247. #define BUTTON1_PIN 0
  248. #define BUTTON1_RELAY 1
  249. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  250. #define BUTTON2_PIN 2
  251. #define BUTTON2_RELAY 2
  252. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  253. #define RELAY1_PIN 12
  254. #define RELAY1_PIN_INVERSE 0
  255. #define RELAY2_PIN 13
  256. #define RELAY2_PIN_INVERSE 0
  257. #define LED1_PIN 16
  258. #define LED1_PIN_INVERSE 0
  259. // -----------------------------------------------------------------------------
  260. // WorkChoice ecoPlug
  261. // -----------------------------------------------------------------------------
  262. #elif defined(ECOPLUG)
  263. #define MANUFACTURER "WORKCHOICE"
  264. #define DEVICE "ECOPLUG"
  265. #define BUTTON1_PIN 13
  266. #define BUTTON1_RELAY 1
  267. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  268. #define RELAY1_PIN 15
  269. #define RELAY1_PIN_INVERSE 0
  270. #define LED1_PIN 2
  271. #define LED1_PIN_INVERSE 0
  272. // -----------------------------------------------------------------------------
  273. // AI Thinker
  274. // -----------------------------------------------------------------------------
  275. #elif defined(AI_LIGHT)
  276. #define MANUFACTURER "AI_THINKER"
  277. #define DEVICE "AI_LIGHT"
  278. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  279. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  280. #define DUMMY_RELAY_COUNT 1
  281. #define MY9291_DI_PIN 13
  282. #define MY9291_DCKI_PIN 15
  283. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  284. // -----------------------------------------------------------------------------
  285. // LED Controller
  286. // -----------------------------------------------------------------------------
  287. #elif defined(LED_CONTROLLER)
  288. #define MANUFACTURER "MAGIC_HOME"
  289. #define DEVICE "LED_CONTROLLER"
  290. #define LED1_PIN 2
  291. #define LED1_PIN_INVERSE 1
  292. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  293. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  294. #define DUMMY_RELAY_COUNT 1
  295. #define LIGHT_CH1_PIN 14 // RED
  296. #define LIGHT_CH2_PIN 5 // GREEN
  297. #define LIGHT_CH3_PIN 12 // BLUE
  298. #define LIGHT_CH4_PIN 13 // WHITE
  299. #define LIGHT_CH1_INVERSE 0
  300. #define LIGHT_CH2_INVERSE 0
  301. #define LIGHT_CH3_INVERSE 0
  302. #define LIGHT_CH4_INVERSE 0
  303. // -----------------------------------------------------------------------------
  304. // HUACANXING H801
  305. // -----------------------------------------------------------------------------
  306. #elif defined(H801_LED_CONTROLLER)
  307. #define MANUFACTURER "HUACANXING"
  308. #define DEVICE "H801"
  309. #define LED1_PIN 5
  310. #define LED1_PIN_INVERSE 1
  311. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  312. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  313. #define DUMMY_RELAY_COUNT 1
  314. #define LIGHT_CH1_PIN 15 // RED
  315. #define LIGHT_CH2_PIN 13 // GREEN
  316. #define LIGHT_CH3_PIN 12 // BLUE
  317. #define LIGHT_CH4_PIN 14 // WHITE1
  318. #define LIGHT_CH5_PIN 4 // WHITE2
  319. #define LIGHT_CH1_INVERSE 0
  320. #define LIGHT_CH2_INVERSE 0
  321. #define LIGHT_CH3_INVERSE 0
  322. #define LIGHT_CH4_INVERSE 0
  323. #define LIGHT_CH5_INVERSE 0
  324. // -----------------------------------------------------------------------------
  325. // Jan Goedeke Wifi Relay
  326. // https://github.com/JanGoe/esp8266-wifi-relay
  327. // -----------------------------------------------------------------------------
  328. #elif defined(WIFI_RELAY_NC)
  329. #define MANUFACTURER "JAN_GOEDEKE"
  330. #define DEVICE "WIFI_RELAY_NC"
  331. #define BUTTON1_PIN 12
  332. #define BUTTON1_RELAY 1
  333. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  334. #define BUTTON2_PIN 13
  335. #define BUTTON2_RELAY 2
  336. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  337. #define RELAY1_PIN 2
  338. #define RELAY1_PIN_INVERSE 1
  339. #define RELAY2_PIN 14
  340. #define RELAY2_PIN_INVERSE 1
  341. #elif defined(WIFI_RELAY_NO)
  342. #define MANUFACTURER "JAN_GOEDEKE"
  343. #define DEVICE "WIFI_RELAY_NO"
  344. #define BUTTON1_PIN 12
  345. #define BUTTON1_RELAY 1
  346. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  347. #define BUTTON2_PIN 13
  348. #define BUTTON2_RELAY 2
  349. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  350. #define RELAY1_PIN 2
  351. #define RELAY1_PIN_INVERSE 0
  352. #define RELAY2_PIN 14
  353. #define RELAY2_PIN_INVERSE 0
  354. // -----------------------------------------------------------------------------
  355. // Jorge García Wifi+Relays Board Kit
  356. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  357. // https://github.com/jorgegarciadev/wifikit
  358. // -----------------------------------------------------------------------------
  359. #elif defined(WIFI_RELAYS_BOARD_KIT)
  360. #define MANUFACTURER "JORGE_GARCIA"
  361. #define DEVICE "WIFI_RELAYS_BOARD_KIT"
  362. #define RELAY1_PIN 0
  363. #define RELAY1_PIN_INVERSE 1
  364. #define RELAY2_PIN 2
  365. #define RELAY2_PIN_INVERSE 1
  366. // -----------------------------------------------------------------------------
  367. // WiFi MQTT Relay / Thermostat
  368. // -----------------------------------------------------------------------------
  369. #elif defined(MQTT_RELAY)
  370. #define MANUFACTURER "OPENENERGYMONITOR"
  371. #define DEVICE "MQTT_RELAY"
  372. #define BUTTON1_PIN 0
  373. #define BUTTON1_RELAY 1
  374. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  375. #define RELAY1_PIN 12
  376. #define RELAY1_PIN_INVERSE 0
  377. #define LED1_PIN 16
  378. #define LED1_PIN_INVERSE 0
  379. // -----------------------------------------------------------------------------
  380. // Unknown hardware
  381. // -----------------------------------------------------------------------------
  382. #else
  383. #error "UNSUPPORTED HARDWARE!"
  384. #endif
  385. // -----------------------------------------------------------------------------
  386. // Default values
  387. // -----------------------------------------------------------------------------
  388. #ifndef BUTTON1_PRESS
  389. #define BUTTON1_PRESS BUTTON_MODE_NONE
  390. #endif
  391. #ifndef BUTTON2_PRESS
  392. #define BUTTON2_PRESS BUTTON_MODE_NONE
  393. #endif
  394. #ifndef BUTTON3_PRESS
  395. #define BUTTON3_PRESS BUTTON_MODE_NONE
  396. #endif
  397. #ifndef BUTTON4_PRESS
  398. #define BUTTON4_PRESS BUTTON_MODE_NONE
  399. #endif
  400. #ifndef BUTTON1_CLICK
  401. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  402. #endif
  403. #ifndef BUTTON2_CLICK
  404. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  405. #endif
  406. #ifndef BUTTON3_CLICK
  407. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  408. #endif
  409. #ifndef BUTTON4_CLICK
  410. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  411. #endif
  412. #ifndef BUTTON1_DBLCLICK
  413. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  414. #endif
  415. #ifndef BUTTON2_DBLCLICK
  416. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  417. #endif
  418. #ifndef BUTTON3_DBLCLICK
  419. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  420. #endif
  421. #ifndef BUTTON4_DBLCLICK
  422. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  423. #endif
  424. #ifndef BUTTON1_LNGCLICK
  425. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  426. #endif
  427. #ifndef BUTTON2_LNGCLICK
  428. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  429. #endif
  430. #ifndef BUTTON3_LNGCLICK
  431. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  432. #endif
  433. #ifndef BUTTON4_LNGCLICK
  434. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  435. #endif
  436. #ifndef BUTTON1_LNGLNGCLICK
  437. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  438. #endif
  439. #ifndef BUTTON2_LNGLNGCLICK
  440. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  441. #endif
  442. #ifndef BUTTON3_LNGLNGCLICK
  443. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  444. #endif
  445. #ifndef BUTTON4_LNGLNGCLICK
  446. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  447. #endif
  448. #ifndef BUTTON1_RELAY
  449. #define BUTTON1_RELAY 0
  450. #endif
  451. #ifndef BUTTON2_RELAY
  452. #define BUTTON2_RELAY 0
  453. #endif
  454. #ifndef BUTTON3_RELAY
  455. #define BUTTON3_RELAY 0
  456. #endif
  457. #ifndef BUTTON4_RELAY
  458. #define BUTTON4_RELAY 0
  459. #endif
  460. #ifndef RELAY1_DELAY_ON
  461. #define RELAY1_DELAY_ON 0
  462. #endif
  463. #ifndef RELAY2_DELAY_ON
  464. #define RELAY2_DELAY_ON 0
  465. #endif
  466. #ifndef RELAY3_DELAY_ON
  467. #define RELAY3_DELAY_ON 0
  468. #endif
  469. #ifndef RELAY4_DELAY_ON
  470. #define RELAY4_DELAY_ON 0
  471. #endif
  472. #ifndef RELAY1_DELAY_OFF
  473. #define RELAY1_DELAY_OFF 0
  474. #endif
  475. #ifndef RELAY2_DELAY_OFF
  476. #define RELAY2_DELAY_OFF 0
  477. #endif
  478. #ifndef RELAY3_DELAY_OFF
  479. #define RELAY3_DELAY_OFF 0
  480. #endif
  481. #ifndef RELAY4_DELAY_OFF
  482. #define RELAY4_DELAY_OFF 0
  483. #endif
  484. #ifndef RELAY1_LED
  485. #define RELAY1_LED 0
  486. #endif
  487. #ifndef RELAY2_LED
  488. #define RELAY2_LED 0
  489. #endif
  490. #ifndef RELAY3_LED
  491. #define RELAY3_LED 0
  492. #endif
  493. #ifndef RELAY4_LED
  494. #define RELAY4_LED 0
  495. #endif
  496. #ifndef WIFI_LED
  497. #define WIFI_LED 1
  498. #endif
  499. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  500. #ifndef BUTTON_PUSHBUTTON
  501. #define BUTTON_PUSHBUTTON 0
  502. #define BUTTON_SWITCH 1
  503. #define BUTTON_DEFAULT_HIGH 2
  504. #define BUTTON_SET_PULLUP 4
  505. #endif
  506. // Does the board track the relay status?
  507. #ifndef TRACK_RELAY_STATUS
  508. #define TRACK_RELAY_STATUS 1
  509. #endif
  510. // Relay providers
  511. #ifndef RELAY_PROVIDER
  512. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  513. #endif
  514. // Light provider
  515. #ifndef LIGHT_PROVIDER
  516. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  517. #endif