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.

631 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. #elif defined(SONOFF_B1)
  242. #define MANUFACTURER "ITEAD"
  243. #define DEVICE "SONOFF_B1"
  244. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  245. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  246. #define DUMMY_RELAY_COUNT 1
  247. #define MY9291_DI_PIN 13
  248. #define MY9291_DCKI_PIN 15
  249. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  250. #elif defined(SONOFF_LED)
  251. #define MANUFACTURER "ITEAD"
  252. #define DEVICE "SONOFF_LED"
  253. #define LED1_PIN 13
  254. #define LED1_PIN_INVERSE 1
  255. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  256. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  257. #define DUMMY_RELAY_COUNT 1
  258. #define LIGHT_CH1_PIN 12 // Cold white
  259. #define LIGHT_CH2_PIN 14 // Warm white
  260. #define LIGHT_CH1_INVERSE 0
  261. #define LIGHT_CH2_INVERSE 0
  262. // -----------------------------------------------------------------------------
  263. // Electrodragon boards
  264. // -----------------------------------------------------------------------------
  265. #elif defined(ESP_RELAY_BOARD)
  266. #define MANUFACTURER "ELECTRODRAGON"
  267. #define DEVICE "ESP_RELAY_BOARD"
  268. #define BUTTON1_PIN 0
  269. #define BUTTON1_RELAY 1
  270. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  271. #define BUTTON2_PIN 2
  272. #define BUTTON2_RELAY 2
  273. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  274. #define RELAY1_PIN 12
  275. #define RELAY1_PIN_INVERSE 0
  276. #define RELAY2_PIN 13
  277. #define RELAY2_PIN_INVERSE 0
  278. #define LED1_PIN 16
  279. #define LED1_PIN_INVERSE 0
  280. // -----------------------------------------------------------------------------
  281. // WorkChoice ecoPlug
  282. // -----------------------------------------------------------------------------
  283. #elif defined(ECOPLUG)
  284. #define MANUFACTURER "WORKCHOICE"
  285. #define DEVICE "ECOPLUG"
  286. #define BUTTON1_PIN 13
  287. #define BUTTON1_RELAY 1
  288. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  289. #define RELAY1_PIN 15
  290. #define RELAY1_PIN_INVERSE 0
  291. #define LED1_PIN 2
  292. #define LED1_PIN_INVERSE 0
  293. // -----------------------------------------------------------------------------
  294. // AI Thinker
  295. // -----------------------------------------------------------------------------
  296. #elif defined(AI_LIGHT)
  297. #define MANUFACTURER "AI_THINKER"
  298. #define DEVICE "AI_LIGHT"
  299. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  300. #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192
  301. #define DUMMY_RELAY_COUNT 1
  302. #define MY9291_DI_PIN 13
  303. #define MY9291_DCKI_PIN 15
  304. #define MY9291_COMMAND MY9291_COMMAND_DEFAULT
  305. // -----------------------------------------------------------------------------
  306. // LED Controller
  307. // -----------------------------------------------------------------------------
  308. #elif defined(LED_CONTROLLER)
  309. #define MANUFACTURER "MAGIC_HOME"
  310. #define DEVICE "LED_CONTROLLER"
  311. #define LED1_PIN 2
  312. #define LED1_PIN_INVERSE 1
  313. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  314. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  315. #define DUMMY_RELAY_COUNT 1
  316. #define LIGHT_CH1_PIN 14 // RED
  317. #define LIGHT_CH2_PIN 5 // GREEN
  318. #define LIGHT_CH3_PIN 12 // BLUE
  319. #define LIGHT_CH4_PIN 13 // WHITE
  320. #define LIGHT_CH1_INVERSE 0
  321. #define LIGHT_CH2_INVERSE 0
  322. #define LIGHT_CH3_INVERSE 0
  323. #define LIGHT_CH4_INVERSE 0
  324. // -----------------------------------------------------------------------------
  325. // HUACANXING H801
  326. // -----------------------------------------------------------------------------
  327. #elif defined(H801_LED_CONTROLLER)
  328. #define MANUFACTURER "HUACANXING"
  329. #define DEVICE "H801"
  330. #define LED1_PIN 5
  331. #define LED1_PIN_INVERSE 1
  332. #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
  333. #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
  334. #define DUMMY_RELAY_COUNT 1
  335. #define LIGHT_CH1_PIN 15 // RED
  336. #define LIGHT_CH2_PIN 13 // GREEN
  337. #define LIGHT_CH3_PIN 12 // BLUE
  338. #define LIGHT_CH4_PIN 14 // WHITE1
  339. #define LIGHT_CH5_PIN 4 // WHITE2
  340. #define LIGHT_CH1_INVERSE 0
  341. #define LIGHT_CH2_INVERSE 0
  342. #define LIGHT_CH3_INVERSE 0
  343. #define LIGHT_CH4_INVERSE 0
  344. #define LIGHT_CH5_INVERSE 0
  345. // -----------------------------------------------------------------------------
  346. // Jan Goedeke Wifi Relay
  347. // https://github.com/JanGoe/esp8266-wifi-relay
  348. // -----------------------------------------------------------------------------
  349. #elif defined(WIFI_RELAY_NC)
  350. #define MANUFACTURER "JAN_GOEDEKE"
  351. #define DEVICE "WIFI_RELAY_NC"
  352. #define BUTTON1_PIN 12
  353. #define BUTTON1_RELAY 1
  354. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  355. #define BUTTON2_PIN 13
  356. #define BUTTON2_RELAY 2
  357. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  358. #define RELAY1_PIN 2
  359. #define RELAY1_PIN_INVERSE 1
  360. #define RELAY2_PIN 14
  361. #define RELAY2_PIN_INVERSE 1
  362. #elif defined(WIFI_RELAY_NO)
  363. #define MANUFACTURER "JAN_GOEDEKE"
  364. #define DEVICE "WIFI_RELAY_NO"
  365. #define BUTTON1_PIN 12
  366. #define BUTTON1_RELAY 1
  367. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  368. #define BUTTON2_PIN 13
  369. #define BUTTON2_RELAY 2
  370. #define BUTTON2_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  371. #define RELAY1_PIN 2
  372. #define RELAY1_PIN_INVERSE 0
  373. #define RELAY2_PIN 14
  374. #define RELAY2_PIN_INVERSE 0
  375. // -----------------------------------------------------------------------------
  376. // Jorge García Wifi+Relays Board Kit
  377. // https://www.tindie.com/products/jorgegarciadev/wifi--relays-board-kit
  378. // https://github.com/jorgegarciadev/wifikit
  379. // -----------------------------------------------------------------------------
  380. #elif defined(WIFI_RELAYS_BOARD_KIT)
  381. #define MANUFACTURER "JORGE_GARCIA"
  382. #define DEVICE "WIFI_RELAYS_BOARD_KIT"
  383. #define RELAY1_PIN 0
  384. #define RELAY1_PIN_INVERSE 1
  385. #define RELAY2_PIN 2
  386. #define RELAY2_PIN_INVERSE 1
  387. // -----------------------------------------------------------------------------
  388. // WiFi MQTT Relay / Thermostat
  389. // -----------------------------------------------------------------------------
  390. #elif defined(MQTT_RELAY)
  391. #define MANUFACTURER "OPENENERGYMONITOR"
  392. #define DEVICE "MQTT_RELAY"
  393. #define BUTTON1_PIN 0
  394. #define BUTTON1_RELAY 1
  395. #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
  396. #define RELAY1_PIN 12
  397. #define RELAY1_PIN_INVERSE 0
  398. #define LED1_PIN 16
  399. #define LED1_PIN_INVERSE 0
  400. // -----------------------------------------------------------------------------
  401. // Unknown hardware
  402. // -----------------------------------------------------------------------------
  403. #else
  404. #error "UNSUPPORTED HARDWARE!"
  405. #endif
  406. // -----------------------------------------------------------------------------
  407. // Default values
  408. // -----------------------------------------------------------------------------
  409. #ifndef BUTTON1_PRESS
  410. #define BUTTON1_PRESS BUTTON_MODE_NONE
  411. #endif
  412. #ifndef BUTTON2_PRESS
  413. #define BUTTON2_PRESS BUTTON_MODE_NONE
  414. #endif
  415. #ifndef BUTTON3_PRESS
  416. #define BUTTON3_PRESS BUTTON_MODE_NONE
  417. #endif
  418. #ifndef BUTTON4_PRESS
  419. #define BUTTON4_PRESS BUTTON_MODE_NONE
  420. #endif
  421. #ifndef BUTTON1_CLICK
  422. #define BUTTON1_CLICK BUTTON_MODE_TOGGLE
  423. #endif
  424. #ifndef BUTTON2_CLICK
  425. #define BUTTON2_CLICK BUTTON_MODE_TOGGLE
  426. #endif
  427. #ifndef BUTTON3_CLICK
  428. #define BUTTON3_CLICK BUTTON_MODE_TOGGLE
  429. #endif
  430. #ifndef BUTTON4_CLICK
  431. #define BUTTON4_CLICK BUTTON_MODE_TOGGLE
  432. #endif
  433. #ifndef BUTTON1_DBLCLICK
  434. #define BUTTON1_DBLCLICK BUTTON_MODE_AP
  435. #endif
  436. #ifndef BUTTON2_DBLCLICK
  437. #define BUTTON2_DBLCLICK BUTTON_MODE_NONE
  438. #endif
  439. #ifndef BUTTON3_DBLCLICK
  440. #define BUTTON3_DBLCLICK BUTTON_MODE_NONE
  441. #endif
  442. #ifndef BUTTON4_DBLCLICK
  443. #define BUTTON4_DBLCLICK BUTTON_MODE_NONE
  444. #endif
  445. #ifndef BUTTON1_LNGCLICK
  446. #define BUTTON1_LNGCLICK BUTTON_MODE_RESET
  447. #endif
  448. #ifndef BUTTON2_LNGCLICK
  449. #define BUTTON2_LNGCLICK BUTTON_MODE_NONE
  450. #endif
  451. #ifndef BUTTON3_LNGCLICK
  452. #define BUTTON3_LNGCLICK BUTTON_MODE_NONE
  453. #endif
  454. #ifndef BUTTON4_LNGCLICK
  455. #define BUTTON4_LNGCLICK BUTTON_MODE_NONE
  456. #endif
  457. #ifndef BUTTON1_LNGLNGCLICK
  458. #define BUTTON1_LNGLNGCLICK BUTTON_MODE_FACTORY
  459. #endif
  460. #ifndef BUTTON2_LNGLNGCLICK
  461. #define BUTTON2_LNGLNGCLICK BUTTON_MODE_NONE
  462. #endif
  463. #ifndef BUTTON3_LNGLNGCLICK
  464. #define BUTTON3_LNGLNGCLICK BUTTON_MODE_NONE
  465. #endif
  466. #ifndef BUTTON4_LNGLNGCLICK
  467. #define BUTTON4_LNGLNGCLICK BUTTON_MODE_NONE
  468. #endif
  469. #ifndef BUTTON1_RELAY
  470. #define BUTTON1_RELAY 0
  471. #endif
  472. #ifndef BUTTON2_RELAY
  473. #define BUTTON2_RELAY 0
  474. #endif
  475. #ifndef BUTTON3_RELAY
  476. #define BUTTON3_RELAY 0
  477. #endif
  478. #ifndef BUTTON4_RELAY
  479. #define BUTTON4_RELAY 0
  480. #endif
  481. #ifndef RELAY1_DELAY_ON
  482. #define RELAY1_DELAY_ON 0
  483. #endif
  484. #ifndef RELAY2_DELAY_ON
  485. #define RELAY2_DELAY_ON 0
  486. #endif
  487. #ifndef RELAY3_DELAY_ON
  488. #define RELAY3_DELAY_ON 0
  489. #endif
  490. #ifndef RELAY4_DELAY_ON
  491. #define RELAY4_DELAY_ON 0
  492. #endif
  493. #ifndef RELAY1_DELAY_OFF
  494. #define RELAY1_DELAY_OFF 0
  495. #endif
  496. #ifndef RELAY2_DELAY_OFF
  497. #define RELAY2_DELAY_OFF 0
  498. #endif
  499. #ifndef RELAY3_DELAY_OFF
  500. #define RELAY3_DELAY_OFF 0
  501. #endif
  502. #ifndef RELAY4_DELAY_OFF
  503. #define RELAY4_DELAY_OFF 0
  504. #endif
  505. #ifndef RELAY1_LED
  506. #define RELAY1_LED 0
  507. #endif
  508. #ifndef RELAY2_LED
  509. #define RELAY2_LED 0
  510. #endif
  511. #ifndef RELAY3_LED
  512. #define RELAY3_LED 0
  513. #endif
  514. #ifndef RELAY4_LED
  515. #define RELAY4_LED 0
  516. #endif
  517. #ifndef WIFI_LED
  518. #define WIFI_LED 1
  519. #endif
  520. // Needed for ESP8285 boards under Windows using PlatformIO (?)
  521. #ifndef BUTTON_PUSHBUTTON
  522. #define BUTTON_PUSHBUTTON 0
  523. #define BUTTON_SWITCH 1
  524. #define BUTTON_DEFAULT_HIGH 2
  525. #define BUTTON_SET_PULLUP 4
  526. #endif
  527. // Does the board track the relay status?
  528. #ifndef TRACK_RELAY_STATUS
  529. #define TRACK_RELAY_STATUS 1
  530. #endif
  531. // Relay providers
  532. #ifndef RELAY_PROVIDER
  533. #define RELAY_PROVIDER RELAY_PROVIDER_RELAY
  534. #endif
  535. // Light provider
  536. #ifndef LIGHT_PROVIDER
  537. #define LIGHT_PROVIDER LIGHT_PROVIDER_NONE
  538. #endif