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.

614 lines
20 KiB

  1. /*
  2. HARDWARE MODULE
  3. Copyright (C) 2016-2017 by Xose Pérez <xose dot perez at gmail dot com>
  4. */
  5. /*
  6. The goal of this file is to store board configuration values in EEPROM so
  7. the migration to future version 2 will be straigh forward.
  8. */
  9. void hwUpwardsCompatibility() {
  10. unsigned int board = getSetting("board", 0).toInt();
  11. if (board > 0) return;
  12. #if defined(NODEMCU_LOLIN)
  13. setSetting("board", 2);
  14. setSetting("ledGPIO", 1, 2);
  15. setSetting("ledLogic", 1, 1);
  16. setSetting("btnGPIO", 1, 0);
  17. setSetting("btnRelay", 1, 1);
  18. setSetting("relayGPIO", 1, 12);
  19. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  20. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  21. setSetting("board", 3);
  22. setSetting("ledGPIO", 1, 2);
  23. setSetting("ledLogic", 1, 1);
  24. setSetting("btnGPIO", 1, 0);
  25. setSetting("btnRelay", 1, 1);
  26. setSetting("relayGPIO", 1, 5);
  27. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  28. #elif defined(ITEAD_SONOFF_BASIC)
  29. setSetting("board", 4);
  30. setSetting("ledGPIO", 1, 13);
  31. setSetting("ledLogic", 1, 1);
  32. setSetting("btnGPIO", 1, 0);
  33. setSetting("btnRelay", 1, 1);
  34. setSetting("relayGPIO", 1, 12);
  35. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  36. #elif defined(ITEAD_SONOFF_TH)
  37. setSetting("board", 5);
  38. setSetting("ledGPIO", 1, 13);
  39. setSetting("ledLogic", 1, 1);
  40. setSetting("btnGPIO", 1, 0);
  41. setSetting("btnRelay", 1, 1);
  42. setSetting("relayGPIO", 1, 12);
  43. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  44. #elif defined(ITEAD_SONOFF_SV)
  45. setSetting("board", 6);
  46. setSetting("ledGPIO", 1, 13);
  47. setSetting("ledLogic", 1, 1);
  48. setSetting("btnGPIO", 1, 0);
  49. setSetting("btnRelay", 1, 1);
  50. setSetting("relayGPIO", 1, 12);
  51. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  52. #elif defined(ITEAD_SONOFF_TOUCH)
  53. setSetting("board", 7);
  54. setSetting("ledGPIO", 1, 13);
  55. setSetting("ledLogic", 1, 1);
  56. setSetting("btnGPIO", 1, 0);
  57. setSetting("btnRelay", 1, 1);
  58. setSetting("relayGPIO", 1, 12);
  59. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  60. #elif defined(ITEAD_SONOFF_POW)
  61. setSetting("board", 8);
  62. setSetting("ledGPIO", 1, 15);
  63. setSetting("ledLogic", 1, 1);
  64. setSetting("btnGPIO", 1, 0);
  65. setSetting("btnRelay", 1, 1);
  66. setSetting("relayGPIO", 1, 12);
  67. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  68. setSetting("selGPIO", 5);
  69. setSetting("cf1GPIO", 13);
  70. setSetting("cfGPIO", 14);
  71. #elif defined(ITEAD_SONOFF_DUAL)
  72. setSetting("board", 9);
  73. setSetting("ledGPIO", 1, 13);
  74. setSetting("ledLogic", 1, 1);
  75. setSetting("btnRelay", 3, 1);
  76. setSetting("relayProvider", RELAY_PROVIDER_DUAL);
  77. setSetting("relays", 2);
  78. #elif defined(ITEAD_1CH_INCHING)
  79. setSetting("board", 10);
  80. setSetting("ledGPIO", 1, 13);
  81. setSetting("ledLogic", 1, 1);
  82. setSetting("btnGPIO", 1, 0);
  83. setSetting("btnRelay", 1, 1);
  84. setSetting("relayGPIO", 1, 12);
  85. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  86. #elif defined(ITEAD_SONOFF_4CH)
  87. setSetting("board", 11);
  88. setSetting("ledGPIO", 1, 13);
  89. setSetting("ledLogic", 1, 1);
  90. setSetting("btnGPIO", 1, 0);
  91. setSetting("btnGPIO", 2, 9);
  92. setSetting("btnGPIO", 3, 10);
  93. setSetting("btnGPIO", 4, 14);
  94. setSetting("btnRelay", 1, 1);
  95. setSetting("btnRelay", 2, 2);
  96. setSetting("btnRelay", 3, 3);
  97. setSetting("btnRelay", 4, 4);
  98. setSetting("relayGPIO", 1, 12);
  99. setSetting("relayGPIO", 2, 5);
  100. setSetting("relayGPIO", 3, 4);
  101. setSetting("relayGPIO", 4, 15);
  102. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  103. setSetting("relayType", 2, RELAY_TYPE_NORMAL);
  104. setSetting("relayType", 3, RELAY_TYPE_NORMAL);
  105. setSetting("relayType", 4, RELAY_TYPE_NORMAL);
  106. #elif defined(ITEAD_SLAMPHER)
  107. setSetting("board", 12);
  108. setSetting("ledGPIO", 1, 13);
  109. setSetting("ledLogic", 1, 1);
  110. setSetting("btnGPIO", 1, 0);
  111. setSetting("btnRelay", 1, 1);
  112. setSetting("relayGPIO", 1, 12);
  113. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  114. #elif defined(ITEAD_S20)
  115. setSetting("board", 13);
  116. setSetting("ledGPIO", 1, 13);
  117. setSetting("ledLogic", 1, 1);
  118. setSetting("btnGPIO", 1, 0);
  119. setSetting("btnRelay", 1, 1);
  120. setSetting("relayGPIO", 1, 12);
  121. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  122. #elif defined(ELECTRODRAGON_WIFI_IOT)
  123. setSetting("board", 14);
  124. setSetting("ledGPIO", 1, 16);
  125. setSetting("ledLogic", 1, 0);
  126. setSetting("btnGPIO", 1, 0);
  127. setSetting("btnGPIO", 2, 2);
  128. setSetting("btnRelay", 1, 1);
  129. setSetting("btnRelay", 2, 2);
  130. setSetting("relayGPIO", 1, 12);
  131. setSetting("relayGPIO", 2, 13);
  132. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  133. setSetting("relayType", 2, RELAY_TYPE_NORMAL);
  134. #elif defined(WORKCHOICE_ECOPLUG)
  135. setSetting("board", 15);
  136. setSetting("ledGPIO", 1, 2);
  137. setSetting("ledLogic", 1, 0);
  138. setSetting("btnGPIO", 1, 13);
  139. setSetting("btnRelay", 1, 1);
  140. setSetting("relayGPIO", 1, 15);
  141. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  142. #elif defined(JANGOE_WIFI_RELAY_NC)
  143. setSetting("board", 16);
  144. setSetting("btnGPIO", 1, 12);
  145. setSetting("btnGPIO", 2, 13);
  146. setSetting("btnRelay", 1, 1);
  147. setSetting("btnRelay", 2, 2);
  148. setSetting("relayGPIO", 1, 2);
  149. setSetting("relayGPIO", 2, 14);
  150. setSetting("relayType", 1, RELAY_TYPE_INVERSE);
  151. setSetting("relayType", 2, RELAY_TYPE_INVERSE);
  152. #elif defined(JANGOE_WIFI_RELAY_NO)
  153. setSetting("board", 17);
  154. setSetting("btnGPIO", 1, 12);
  155. setSetting("btnGPIO", 2, 13);
  156. setSetting("btnRelay", 1, 1);
  157. setSetting("btnRelay", 2, 2);
  158. setSetting("relayGPIO", 1, 2);
  159. setSetting("relayGPIO", 2, 14);
  160. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  161. setSetting("relayType", 2, RELAY_TYPE_NORMAL);
  162. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  163. setSetting("board", 18);
  164. setSetting("ledGPIO", 1, 16);
  165. setSetting("ledLogic", 1, 1);
  166. setSetting("btnGPIO", 1, 0);
  167. setSetting("btnRelay", 1, 1);
  168. setSetting("relayGPIO", 1, 12);
  169. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  170. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  171. setSetting("board", 19);
  172. setSetting("relayGPIO", 1, 0);
  173. setSetting("relayGPIO", 2, 2);
  174. setSetting("relayType", 1, RELAY_TYPE_INVERSE);
  175. setSetting("relayType", 2, RELAY_TYPE_INVERSE);
  176. #elif defined(AITHINKER_AI_LIGHT)
  177. setSetting("board", 20);
  178. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  179. setSetting("lightProvider", LIGHT_PROVIDER_MY92XX);
  180. setSetting("myModel", MY92XX_MODEL_MY9291);
  181. setSetting("myChips", 1);
  182. setSetting("myDIGPIO", 13);
  183. setSetting("myDCKIGPIO", 15);
  184. setSetting("relays", 1);
  185. #elif defined(MAGICHOME_LED_CONTROLLER)
  186. setSetting("board", 21);
  187. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  188. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  189. setSetting("ledGPIO", 1, 2);
  190. setSetting("ledLogic", 1, 1);
  191. setSetting("chGPIO", 1, 14);
  192. setSetting("chGPIO", 2, 5);
  193. setSetting("chGPIO", 3, 12);
  194. setSetting("chGPIO", 4, 13);
  195. setSetting("chLogic", 1, 0);
  196. setSetting("chLogic", 2, 0);
  197. setSetting("chLogic", 3, 0);
  198. setSetting("chLogic", 4, 0);
  199. setSetting("relays", 1);
  200. #elif defined(MAGICHOME_LED_CONTROLLER_IR)
  201. setSetting("board", 21);
  202. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  203. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  204. setSetting("ledGPIO", 1, 2);
  205. setSetting("ledLogic", 1, 1);
  206. setSetting("chGPIO", 1, 5);
  207. setSetting("chGPIO", 2, 12);
  208. setSetting("chGPIO", 3, 13);
  209. setSetting("chGPIO", 4, 14);
  210. setSetting("chLogic", 1, 0);
  211. setSetting("chLogic", 2, 0);
  212. setSetting("chLogic", 3, 0);
  213. setSetting("chLogic", 4, 0);
  214. setSetting("relays", 1);
  215. #elif defined(ITEAD_MOTOR)
  216. setSetting("board", 22);
  217. setSetting("ledGPIO", 1, 13);
  218. setSetting("ledLogic", 1, 1);
  219. setSetting("btnGPIO", 1, 0);
  220. setSetting("btnRelay", 1, 1);
  221. setSetting("relayGPIO", 1, 12);
  222. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  223. #elif defined(TINKERMAN_ESPURNA_H06)
  224. setSetting("board", 23);
  225. setSetting("ledGPIO", 1, 5);
  226. setSetting("ledLogic", 1, 0);
  227. setSetting("btnGPIO", 1, 4);
  228. setSetting("btnRelay", 1, 1);
  229. setSetting("relayGPIO", 1, 12);
  230. setSetting("relayType", 1, RELAY_TYPE_INVERSE);
  231. setSetting("selGPIO", 2);
  232. setSetting("cf1GPIO", 13);
  233. setSetting("cfGPIO", 14);
  234. #elif defined(HUACANXING_H801)
  235. setSetting("board", 24);
  236. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  237. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  238. setSetting("ledGPIO", 1, 5);
  239. setSetting("ledLogic", 1, 1);
  240. setSetting("chGPIO", 1, 15);
  241. setSetting("chGPIO", 2, 13);
  242. setSetting("chGPIO", 3, 12);
  243. setSetting("chGPIO", 4, 14);
  244. setSetting("chGPIO", 5, 4);
  245. setSetting("chLogic", 1, 0);
  246. setSetting("chLogic", 2, 0);
  247. setSetting("chLogic", 3, 0);
  248. setSetting("chLogic", 4, 0);
  249. setSetting("chLogic", 5, 0);
  250. setSetting("relays", 1);
  251. #elif defined(ITEAD_BNSZ01)
  252. setSetting("board", 25);
  253. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  254. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  255. setSetting("ledGPIO", 3, 13);
  256. setSetting("ledLogic", 1, 1);
  257. setSetting("chGPIO", 1, 12);
  258. setSetting("chLogic", 1, 0);
  259. setSetting("relays", 1);
  260. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  261. setSetting("board", 26);
  262. setSetting("ledGPIO", 1, 13);
  263. setSetting("ledLogic", 1, 1);
  264. setSetting("btnGPIO", 1, 0);
  265. setSetting("relayProvider", RELAY_PROVIDER_RFBRIDGE);
  266. setSetting("relays", 6);
  267. #elif defined(ITEAD_SONOFF_4CH_PRO)
  268. setSetting("board", 27);
  269. setSetting("ledGPIO", 1, 13);
  270. setSetting("ledLogic", 1, 1);
  271. setSetting("btnGPIO", 1, 0);
  272. setSetting("btnGPIO", 2, 9);
  273. setSetting("btnGPIO", 3, 10);
  274. setSetting("btnGPIO", 4, 14);
  275. setSetting("btnRelay", 1, 1);
  276. setSetting("btnRelay", 2, 2);
  277. setSetting("btnRelay", 3, 3);
  278. setSetting("btnRelay", 4, 4);
  279. setSetting("relayGPIO", 1, 12);
  280. setSetting("relayGPIO", 2, 5);
  281. setSetting("relayGPIO", 3, 4);
  282. setSetting("relayGPIO", 4, 15);
  283. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  284. setSetting("relayType", 2, RELAY_TYPE_NORMAL);
  285. setSetting("relayType", 3, RELAY_TYPE_NORMAL);
  286. setSetting("relayType", 4, RELAY_TYPE_NORMAL);
  287. #elif defined(ITEAD_SONOFF_B1)
  288. setSetting("board", 28);
  289. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  290. setSetting("lightProvider", LIGHT_PROVIDER_MY92XX);
  291. setSetting("myModel", MY92XX_MODEL_MY9231);
  292. setSetting("myChips", 2);
  293. setSetting("myDIGPIO", 12);
  294. setSetting("myDCKIGPIO", 14);
  295. setSetting("relays", 1);
  296. #elif defined(ITEAD_SONOFF_LED)
  297. setSetting("board", 29);
  298. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  299. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  300. setSetting("ledGPIO", 1, 13);
  301. setSetting("ledLogic", 1, 1);
  302. setSetting("chGPIO", 1, 12);
  303. setSetting("chLogic", 1, 0);
  304. setSetting("chGPIO", 2, 14);
  305. setSetting("chLogic", 2, 0);
  306. setSetting("relays", 1);
  307. #elif defined(ITEAD_SONOFF_T1_1CH)
  308. setSetting("board", 30);
  309. setSetting("ledGPIO", 1, 13);
  310. setSetting("ledLogic", 1, 1);
  311. setSetting("btnGPIO", 1, 9);
  312. setSetting("btnRelay", 1, 1);
  313. setSetting("relayGPIO", 1, 5);
  314. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  315. #elif defined(ITEAD_SONOFF_T1_2CH)
  316. setSetting("board", 31);
  317. setSetting("ledGPIO", 1, 13);
  318. setSetting("ledLogic", 1, 1);
  319. setSetting("btnGPIO", 1, 0);
  320. setSetting("btnGPIO", 2, 10);
  321. setSetting("btnRelay", 1, 1);
  322. setSetting("btnRelay", 2, 2);
  323. setSetting("relayGPIO", 1, 12);
  324. setSetting("relayGPIO", 2, 4);
  325. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  326. setSetting("relayType", 2, RELAY_TYPE_NORMAL);
  327. #elif defined(ITEAD_SONOFF_T1_3CH)
  328. setSetting("board", 32);
  329. setSetting("ledGPIO", 1, 13);
  330. setSetting("ledLogic", 1, 1);
  331. setSetting("btnGPIO", 1, 0);
  332. setSetting("btnGPIO", 2, 9);
  333. setSetting("btnGPIO", 3, 10);
  334. setSetting("btnRelay", 1, 1);
  335. setSetting("btnRelay", 2, 2);
  336. setSetting("btnRelay", 3, 3);
  337. setSetting("relayGPIO", 1, 12);
  338. setSetting("relayGPIO", 2, 5);
  339. setSetting("relayGPIO", 3, 4);
  340. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  341. setSetting("relayType", 2, RELAY_TYPE_NORMAL);
  342. setSetting("relayType", 3, RELAY_TYPE_NORMAL);
  343. #elif defined(ITEAD_SONOFF_RF)
  344. setSetting("board", 33);
  345. setSetting("ledGPIO", 1, 13);
  346. setSetting("ledLogic", 1, 1);
  347. setSetting("btnGPIO", 1, 0);
  348. setSetting("btnRelay", 1, 1);
  349. setSetting("relayGPIO", 1, 12);
  350. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  351. #elif defined(WION_50055)
  352. setSetting("board", 34);
  353. setSetting("ledGPIO", 1, 2);
  354. setSetting("ledLogic", 1, 0);
  355. setSetting("btnGPIO", 1, 13);
  356. setSetting("btnRelay", 1,1);
  357. setSetting("relayGPIO", 1, 15);
  358. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  359. #elif defined(EXS_WIFI_RELAY_V31)
  360. setSetting("board", 35);
  361. setSetting("btnGPIO", 1, 0);
  362. setSetting("btnRelay", 1, 1);
  363. setSetting("relayGPIO", 1, 13);
  364. setSetting("relayResetGPIO", 1, 12);
  365. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  366. #elif defined(HUACANXING_H802)
  367. setSetting("board", 36);
  368. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  369. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  370. setSetting("chGPIO", 1, 12);
  371. setSetting("chGPIO", 2, 14);
  372. setSetting("chGPIO", 3, 13);
  373. setSetting("chGPIO", 4, 15);
  374. setSetting("chLogic", 1, 0);
  375. setSetting("chLogic", 2, 0);
  376. setSetting("chLogic", 3, 0);
  377. setSetting("chLogic", 4, 0);
  378. setSetting("relays", 1);
  379. #elif defined(GENERIC_V9261F)
  380. setSetting("board", 37);
  381. #elif defined(GENERIC_ECH1560)
  382. setSetting("board", 38);
  383. #elif defined(TINKERMAN_ESPURNA_H08)
  384. setSetting("board", 39);
  385. setSetting("ledGPIO", 1, 2);
  386. setSetting("ledLogic", 1, 0);
  387. setSetting("btnGPIO", 1, 4);
  388. setSetting("btnRelay", 1, 1);
  389. setSetting("relayGPIO", 1, 12);
  390. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  391. setSetting("selGPIO", 5);
  392. setSetting("cf1GPIO", 13);
  393. setSetting("cfGPIO", 14);
  394. #elif defined(MANCAVEMADE_ESPLIVE)
  395. setSetting("board", 40);
  396. setSetting("btnGPIO", 1, 4);
  397. setSetting("btnGPIO", 2, 5);
  398. setSetting("btnRelay", 1, 1);
  399. setSetting("btnRelay", 2, 2);
  400. setSetting("relayGPIO", 1, 12);
  401. setSetting("relayGPIO", 2, 13);
  402. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  403. setSetting("relayType", 2, RELAY_TYPE_NORMAL);
  404. #elif defined(INTERMITTECH_QUINLED)
  405. setSetting("board", 41);
  406. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  407. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  408. setSetting("ledGPIO", 1, 1);
  409. setSetting("ledLogic", 1, 1);
  410. setSetting("chGPIO", 1, 0);
  411. setSetting("chGPIO", 2, 2);
  412. setSetting("chLogic", 1, 0);
  413. setSetting("chLogic", 2, 0);
  414. setSetting("relays", 1);
  415. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  416. setSetting("board", 42);
  417. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  418. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  419. setSetting("chGPIO", 1, 5);
  420. setSetting("chGPIO", 2, 12);
  421. setSetting("chGPIO", 3, 13);
  422. setSetting("chGPIO", 4, 15);
  423. setSetting("chLogic", 1, 0);
  424. setSetting("chLogic", 2, 0);
  425. setSetting("chLogic", 3, 0);
  426. setSetting("chLogic", 4, 0);
  427. setSetting("relays", 1);
  428. #elif defined(ARILUX_AL_LC06)
  429. setSetting("board", 43);
  430. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  431. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  432. setSetting("chGPIO", 1, 12);
  433. setSetting("chGPIO", 2, 14);
  434. setSetting("chGPIO", 3, 13);
  435. setSetting("chGPIO", 4, 15);
  436. setSetting("chGPIO", 5, 5);
  437. setSetting("chLogic", 1, 0);
  438. setSetting("chLogic", 2, 0);
  439. setSetting("chLogic", 3, 0);
  440. setSetting("chLogic", 4, 0);
  441. setSetting("chLogic", 5, 0);
  442. setSetting("relays", 1);
  443. #elif defined(XENON_SM_PW702U)
  444. setSetting("board", 44);
  445. setSetting("ledGPIO", 1, 4);
  446. setSetting("ledLogic", 1, 0);
  447. setSetting("btnGPIO", 1, 13);
  448. setSetting("btnRelay", 1, 1);
  449. setSetting("relayGPIO", 1, 12);
  450. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  451. #elif defined(AUTHOMETION_LYT8266)
  452. setSetting("board", 45);
  453. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  454. setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
  455. setSetting("chGPIO", 1, 13);
  456. setSetting("chGPIO", 2, 12);
  457. setSetting("chGPIO", 3, 14);
  458. setSetting("chGPIO", 4, 2);
  459. setSetting("chLogic", 1, 0);
  460. setSetting("chLogic", 2, 0);
  461. setSetting("chLogic", 3, 0);
  462. setSetting("chLogic", 4, 0);
  463. setSetting("relays", 1);
  464. setSetting("enGPIO", 15);
  465. #elif defined(ARILUX_E27)
  466. setSetting("board", 46);
  467. setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
  468. setSetting("lightProvider", LIGHT_PROVIDER_MY92XX);
  469. setSetting("myModel", MY92XX_MODEL_MY9291);
  470. setSetting("myChips", 1);
  471. setSetting("myDIGPIO", 13);
  472. setSetting("myDCKIGPIO", 15);
  473. setSetting("relays", 1);
  474. #elif defined(YJZK_SWITCH_2CH)
  475. setSetting("board", 47);
  476. setSetting("ledGPIO", 1, 13);
  477. setSetting("ledLogic", 1, 0);
  478. setSetting("ledWifi", 0);
  479. setSetting("btnGPIO", 1, 0);
  480. setSetting("btnGPIO", 2, 9);
  481. setSetting("btnRelay", 1, 1);
  482. setSetting("btnRelay", 2, 2);
  483. setSetting("relayGPIO", 1, 12);
  484. setSetting("relayGPIO", 2, 5);
  485. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  486. setSetting("relayType", 2, RELAY_TYPE_NORMAL);
  487. #elif defined(ITEAD_SONOFF_DUAL_R2)
  488. setSetting("board", 48);
  489. setSetting("ledGPIO", 1, 13);
  490. setSetting("ledLogic", 1, 1);
  491. setSetting("btnGPIO", 1, 0);
  492. setSetting("btnGPIO", 2, 9);
  493. setSetting("btnGPIO", 3, 10);
  494. setSetting("btnRelay", 1, 1);
  495. setSetting("btnRelay", 2, 2);
  496. setSetting("btnRelay", 3, 1);
  497. setSetting("relayGPIO", 1, 12);
  498. setSetting("relayGPIO", 2, 5);
  499. setSetting("relayType", 1, RELAY_TYPE_NORMAL);
  500. setSetting("relayType", 2, RELAY_TYPE_NORMAL);
  501. #else
  502. #error "UNSUPPORTED HARDWARE!"
  503. #endif
  504. saveSettings();
  505. }