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.

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