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.

189 lines
5.6 KiB

  1. //--------------------------------------------------------------------------------
  2. // HARDWARE
  3. // This setting is normally provided by PlatformIO
  4. // Uncomment the appropiate line to build from the Arduino IDE
  5. //--------------------------------------------------------------------------------
  6. //#define NODEMCUV2
  7. //#define SONOFF
  8. //#define SONOFF_TH
  9. //#define SLAMPHER
  10. //#define S20
  11. //#define SONOFF_SV
  12. //#define SONOFF_POW
  13. //#define SONOFF_DUAL
  14. //#define SONOFF_4CH
  15. //#define ESP_RELAY_BOARD
  16. //#define ECOPLUG
  17. //#define ESPURNA
  18. //#define ENABLE_DHT 1
  19. //#define ENABLE_DS18B20 1
  20. //#define ENABLE_EMON 1
  21. //#define ENABLE_HLW8018 1
  22. //#define ENABLE_RF 1
  23. //#define ENABLE_FAUXMO 1
  24. //#define ENABLE_NOFUSS 1
  25. // -----------------------------------------------------------------------------
  26. // Development boards
  27. // -----------------------------------------------------------------------------
  28. #if defined(NODEMCUV2)
  29. #define MANUFACTURER "NODEMCU"
  30. #define DEVICE "LOLIN"
  31. #define BUTTON1_PIN 0
  32. #define RELAY1_PIN 12
  33. #define LED1_PIN 2
  34. #define LED1_PIN_INVERSE 1
  35. #elif defined(D1_RELAYSHIELD)
  36. #define MANUFACTURER "WEMOS"
  37. #define DEVICE "D1_MINI"
  38. #define RELAY1_PIN 5
  39. #define LED1_PIN 2
  40. #define LED1_PIN_INVERSE 1
  41. // -----------------------------------------------------------------------------
  42. // Itead Studio boards
  43. // -----------------------------------------------------------------------------
  44. #elif defined(SONOFF)
  45. #define MANUFACTURER "ITEAD"
  46. #define DEVICE "SONOFF"
  47. #define BUTTON1_PIN 0
  48. #define RELAY1_PIN 12
  49. #define LED1_PIN 13
  50. #define LED1_PIN_INVERSE 1
  51. #elif defined(SONOFF_TH)
  52. #define MANUFACTURER "ITEAD"
  53. #define DEVICE "SONOFF_TH"
  54. #define BUTTON1_PIN 0
  55. #define RELAY1_PIN 12
  56. #define LED1_PIN 13
  57. #define LED1_PIN_INVERSE 1
  58. #elif defined(SONOFF_SV)
  59. #define MANUFACTURER "ITEAD"
  60. #define DEVICE "SONOFF_SV"
  61. #define BUTTON1_PIN 0
  62. #define RELAY1_PIN 12
  63. #define LED1_PIN 13
  64. #define LED1_PIN_INVERSE 1
  65. #elif defined(SLAMPHER)
  66. #define MANUFACTURER "ITEAD"
  67. #define DEVICE "SLAMPHER"
  68. #define BUTTON1_PIN 0
  69. #define RELAY1_PIN 12
  70. #define LED1_PIN 13
  71. #define LED1_PIN_INVERSE 1
  72. #elif defined(S20)
  73. #define MANUFACTURER "ITEAD"
  74. #define DEVICE "S20"
  75. #define BUTTON1_PIN 0
  76. #define RELAY1_PIN 12
  77. #define LED1_PIN 13
  78. #define LED1_PIN_INVERSE 1
  79. #elif defined(SONOFF_TOUCH)
  80. #define MANUFACTURER "ITEAD"
  81. #define DEVICE "SONOFF_TOUCH"
  82. #define BUTTON1_PIN 0
  83. #define RELAY1_PIN 12
  84. #define LED1_PIN 13
  85. #define LED1_PIN_INVERSE 1
  86. #elif defined(SONOFF_POW)
  87. #define MANUFACTURER "ITEAD"
  88. #define DEVICE "SONOFF_POW"
  89. #define BUTTON1_PIN 0
  90. #define RELAY1_PIN 12
  91. #define LED1_PIN 15
  92. #define LED1_PIN_INVERSE 0
  93. #define ENABLE_POW 1
  94. #elif defined(SONOFF_DUAL)
  95. #define MANUFACTURER "ITEAD"
  96. #define DEVICE "SONOFF_DUAL"
  97. #define BUTTON1_PIN 0
  98. #define LED1_PIN 13
  99. #define LED1_PIN_INVERSE 1
  100. #undef SERIAL_BAUDRATE
  101. #define SERIAL_BAUDRATE 19230
  102. #elif defined(SONOFF_4CH)
  103. #define MANUFACTURER "ITEAD"
  104. #define DEVICE "SONOFF_4CH"
  105. #define BUTTON1_PIN 0
  106. #define BUTTON2_PIN 9
  107. #define BUTTON3_PIN 10
  108. #define BUTTON4_PIN 14
  109. #define RELAY1_PIN 12
  110. #define RELAY2_PIN 5
  111. #define RELAY3_PIN 4
  112. #define RELAY4_PIN 15
  113. #define LED1_PIN 13
  114. #define LED1_PIN_INVERSE 1
  115. // -----------------------------------------------------------------------------
  116. // Electrodragon boards
  117. // -----------------------------------------------------------------------------
  118. #elif defined(ESP_RELAY_BOARD)
  119. #define MANUFACTURER "ELECTRODRAGON"
  120. #define DEVICE "ESP_RELAY_BOARD"
  121. #define BUTTON1_PIN 0
  122. #define BUTTON2_PIN 2
  123. #define RELAY1_PIN 12
  124. #define RELAY2_PIN 13
  125. #define LED1_PIN 16
  126. #define LED1_PIN_INVERSE 0
  127. // -----------------------------------------------------------------------------
  128. // WorkChoice ecoPlug
  129. // -----------------------------------------------------------------------------
  130. #elif defined(ECOPLUG)
  131. #define MANUFACTURER "WORKCHOICE"
  132. #define DEVICE "ECOPLUG"
  133. #define BUTTON1_PIN 13
  134. #define RELAY1_PIN 15
  135. #define LED1_PIN 2
  136. #define LED1_PIN_INVERSE 0
  137. // -----------------------------------------------------------------------------
  138. // ESPurna board (still beta)
  139. // -----------------------------------------------------------------------------
  140. #elif defined(ESPURNA)
  141. #define MANUFACTURER "TINKERMAN"
  142. #define DEVICE "ESPURNA"
  143. #define BUTTON1_PIN 0
  144. #define RELAY1_PIN 12
  145. #define LED1_PIN 13
  146. #define LED1_PIN_INVERSE 0
  147. // -----------------------------------------------------------------------------
  148. // Unknown hardware
  149. // -----------------------------------------------------------------------------
  150. #else
  151. #error "UNSUPPORTED HARDWARE!"
  152. #endif