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.

699 lines
16 KiB

Rework settings (#2282) * wip based on early draft. todo benchmarking * fixup eraser, assume keys are unique * fix cursor copy, test removal at random * small benchmark via permutations. todo lambdas and novirtual * fix empty condition / reset * overwrite optimizations, fix move offsets overflows * ...erase using 0xff instead of 0 * test the theory with code, different length kv were bugged * try to check for out-of-bounds writes / reads * style * trying to fix mover again * clarify length, defend against reading len on edge * fix uncommited rewind change * prove space assumptions * more concise traces, fix move condition (agrh!!!) * slightly more internal knowledge (estimates API?) * make sure cursor is only valid within the range * ensure 0 does not blow things * go back up * cursor comments * comments * rewrite writes through cursor * in del too * estimate kv storage requirements, return available size * move raw erase / move into a method, allow ::set to avoid scanning storage twice * refactor naming, use in code * amend storage slicing test * fix crash handler offsets, cleanup configuration * start -> begin * eeprom readiness * dependencies * unused * SPI_FLASH constants for older Core * vtables -> templates * less include dependencies * gcov help, move estimate outside of the class * writer position can never match, use begin + offset * tweak save_crash to trigger only once in a serious crash * doh, header function should be inline * foreach api, tweak structs for public api * use test helper class * when not using foreach, move cursor reset closer to the loop using read_kv * coverage comments, fix typo in tests decltype * ensure set() does not break with offset * make codacy happy again
4 years ago
  1. /*
  2. BOARD MODULE
  3. */
  4. #include "espurna.h"
  5. #include "relay.h"
  6. #include "sensor.h"
  7. //--------------------------------------------------------------------------------
  8. PROGMEM const char espurna_modules[] =
  9. #if ALEXA_SUPPORT
  10. "ALEXA "
  11. #endif
  12. #if API_SUPPORT
  13. "API "
  14. #endif
  15. #if BROKER_SUPPORT
  16. "BROKER "
  17. #endif
  18. #if BUTTON_SUPPORT
  19. #if BUTTON_EVENTS_SOURCE == BUTTON_EVENTS_SOURCE_GENERIC
  20. "BUTTON "
  21. #else
  22. "BUTTON_DUAL "
  23. #endif
  24. #endif
  25. #if DEBUG_SERIAL_SUPPORT
  26. "DEBUG_SERIAL "
  27. #endif
  28. #if DEBUG_TELNET_SUPPORT
  29. "DEBUG_TELNET "
  30. #endif
  31. #if DEBUG_UDP_SUPPORT
  32. "DEBUG_UDP "
  33. #endif
  34. #if DEBUG_WEB_SUPPORT
  35. "DEBUG_WEB "
  36. #endif
  37. #if DOMOTICZ_SUPPORT
  38. "DOMOTICZ "
  39. #endif
  40. #if ENCODER_SUPPORT
  41. "ENCODER "
  42. #endif
  43. #if HOMEASSISTANT_SUPPORT
  44. "HOMEASSISTANT "
  45. #endif
  46. #if I2C_SUPPORT
  47. "I2C "
  48. #endif
  49. #if INFLUXDB_SUPPORT
  50. "INFLUXDB "
  51. #endif
  52. #if IR_SUPPORT
  53. "IR "
  54. #endif
  55. #if LED_SUPPORT
  56. "LED "
  57. #endif
  58. #if LLMNR_SUPPORT
  59. "LLMNR "
  60. #endif
  61. #if MDNS_CLIENT_SUPPORT
  62. "MDNS_CLIENT "
  63. #endif
  64. #if MDNS_SERVER_SUPPORT
  65. "MDNS_SERVER "
  66. #endif
  67. #if MQTT_SUPPORT
  68. "MQTT "
  69. #endif
  70. #if NETBIOS_SUPPORT
  71. "NETBIOS "
  72. #endif
  73. #if NOFUSS_SUPPORT
  74. "NOFUSS "
  75. #endif
  76. #if NTP_SUPPORT
  77. "NTP "
  78. #endif
  79. #if PROMETHEUS_SUPPORT
  80. "METRICS "
  81. #endif
  82. #if RELAY_SUPPORT
  83. "RELAY "
  84. #endif
  85. #if RFM69_SUPPORT
  86. "RFM69 "
  87. #endif
  88. #if RFB_SUPPORT
  89. "RFB "
  90. #endif
  91. #if RPN_RULES_SUPPORT
  92. "RPN_RULES "
  93. #endif
  94. #if SCHEDULER_SUPPORT
  95. "SCHEDULER "
  96. #endif
  97. #if SENSOR_SUPPORT
  98. "SENSOR "
  99. #endif
  100. #if SPIFFS_SUPPORT
  101. "SPIFFS "
  102. #endif
  103. #if SSDP_SUPPORT
  104. "SSDP "
  105. #endif
  106. #if TELNET_SUPPORT
  107. #if TELNET_SERVER == TELNET_SERVER_WIFISERVER
  108. "TELNET_SYNC "
  109. #else
  110. "TELNET "
  111. #endif // TELNET_SERVER == TELNET_SERVER_WIFISERVER
  112. #endif
  113. #if TERMINAL_SUPPORT
  114. "TERMINAL "
  115. #endif
  116. #if THERMOSTAT_SUPPORT
  117. "THERMOSTAT "
  118. #endif
  119. #if THERMOSTAT_DISPLAY_SUPPORT
  120. "THERMOSTAT_DISPLAY "
  121. #endif
  122. #if THINGSPEAK_SUPPORT
  123. "THINGSPEAK "
  124. #endif
  125. #if UART_MQTT_SUPPORT
  126. "UART_MQTT "
  127. #endif
  128. #if WEB_SUPPORT
  129. "WEB "
  130. #endif
  131. "";
  132. PROGMEM const char espurna_ota_modules[] =
  133. #if OTA_ARDUINOOTA_SUPPORT
  134. "ARDUINO "
  135. #endif
  136. #if (OTA_CLIENT == OTA_CLIENT_ASYNCTCP)
  137. "ASYNCTCP "
  138. #endif
  139. #if (OTA_CLIENT == OTA_CLIENT_HTTPUPDATE)
  140. #if (SECURE_CLIENT == SECURE_CLIENT_NONE)
  141. "*HTTPUPDATE "
  142. #endif
  143. #if (SECURE_CLIENT == SECURE_CLIENT_AXTLS)
  144. "*HTTPUPDATE_AXTLS "
  145. #endif
  146. #if (SECURE_CLIENT == SECURE_CLIENT_BEARSSL)
  147. "*HTTPUPDATE_BEARSSL "
  148. #endif
  149. #endif // OTA_CLIENT_HTTPUPDATE
  150. #if OTA_MQTT_SUPPORT
  151. "MQTT "
  152. #endif
  153. #if WEB_SUPPORT
  154. "WEB "
  155. #endif
  156. "";
  157. PROGMEM const char espurna_webui[] =
  158. #if WEBUI_IMAGE == WEBUI_IMAGE_SMALL
  159. "SMALL"
  160. #endif
  161. #if WEBUI_IMAGE == WEBUI_IMAGE_LIGHT
  162. "LIGHT"
  163. #endif
  164. #if WEBUI_IMAGE == WEBUI_IMAGE_SENSOR
  165. "SENSOR"
  166. #endif
  167. #if WEBUI_IMAGE == WEBUI_IMAGE_RFBRIDGE
  168. "RFBRIDGE"
  169. #endif
  170. #if WEBUI_IMAGE == WEBUI_IMAGE_RFM69
  171. "RFM69"
  172. #endif
  173. #if WEBUI_IMAGE == WEBUI_IMAGE_LIGHTFOX
  174. "LIGHTFOX"
  175. #endif
  176. #if WEBUI_IMAGE == WEBUI_IMAGE_THERMOSTAT
  177. "THERMOSTAT"
  178. #endif
  179. #if WEBUI_IMAGE == WEBUI_IMAGE_CURTAIN
  180. "CURTAIN"
  181. #endif
  182. #if WEBUI_IMAGE == WEBUI_IMAGE_FULL
  183. "FULL"
  184. #endif
  185. "";
  186. #if SENSOR_SUPPORT
  187. PROGMEM const char espurna_sensors[] =
  188. #if AM2320_SUPPORT
  189. "AM2320_I2C "
  190. #endif
  191. #if ANALOG_SUPPORT
  192. "ANALOG "
  193. #endif
  194. #if BH1750_SUPPORT
  195. "BH1750 "
  196. #endif
  197. #if BMP180_SUPPORT
  198. "BMP180 "
  199. #endif
  200. #if BMX280_SUPPORT
  201. "BMX280 "
  202. #endif
  203. #if BME680_SUPPORT
  204. "BME680 "
  205. #endif
  206. #if CSE7766_SUPPORT
  207. "CSE7766 "
  208. #endif
  209. #if DALLAS_SUPPORT
  210. "DALLAS "
  211. #endif
  212. #if DHT_SUPPORT
  213. "DHTXX "
  214. #endif
  215. #if DIGITAL_SUPPORT
  216. "DIGITAL "
  217. #endif
  218. #if ECH1560_SUPPORT
  219. "ECH1560 "
  220. #endif
  221. #if EMON_ADC121_SUPPORT
  222. "EMON_ADC121 "
  223. #endif
  224. #if EMON_ADS1X15_SUPPORT
  225. "EMON_ADX1X15 "
  226. #endif
  227. #if EMON_ANALOG_SUPPORT
  228. "EMON_ANALOG "
  229. #endif
  230. #if EVENTS_SUPPORT
  231. "EVENTS "
  232. #endif
  233. #if GEIGER_SUPPORT
  234. "GEIGER "
  235. #endif
  236. #if GUVAS12SD_SUPPORT
  237. "GUVAS12SD "
  238. #endif
  239. #if HLW8012_SUPPORT
  240. "HLW8012 "
  241. #endif
  242. #if LDR_SUPPORT
  243. "LDR "
  244. #endif
  245. #if MHZ19_SUPPORT
  246. "MHZ19 "
  247. #endif
  248. #if MICS2710_SUPPORT
  249. "MICS2710 "
  250. #endif
  251. #if MICS5525_SUPPORT
  252. "MICS5525 "
  253. #endif
  254. #if NTC_SUPPORT
  255. "NTC "
  256. #endif
  257. #if PMSX003_SUPPORT
  258. "PMSX003 "
  259. #endif
  260. #if PULSEMETER_SUPPORT
  261. "PULSEMETER "
  262. #endif
  263. #if PZEM004T_SUPPORT
  264. "PZEM004T "
  265. #endif
  266. #if SDS011_SUPPORT
  267. "SDS011 "
  268. #endif
  269. #if SENSEAIR_SUPPORT
  270. "SENSEAIR "
  271. #endif
  272. #if SHT3X_I2C_SUPPORT
  273. "SHT3X_I2C "
  274. #endif
  275. #if SI7021_SUPPORT
  276. "SI7021 "
  277. #endif
  278. #if SONAR_SUPPORT
  279. "SONAR "
  280. #endif
  281. #if T6613_SUPPORT
  282. "T6613 "
  283. #endif
  284. #if TMP3X_SUPPORT
  285. "TMP3X "
  286. #endif
  287. #if V9261F_SUPPORT
  288. "V9261F "
  289. #endif
  290. #if VEML6075_SUPPORT
  291. "VEML6075 "
  292. #endif
  293. #if VL53L1X_SUPPORT
  294. "VL53L1X "
  295. #endif
  296. #if EZOPH_SUPPORT
  297. "EZOPH "
  298. #endif
  299. #if ADE7953_SUPPORT
  300. "ADE7953 "
  301. #endif
  302. #if SI1145_SUPPORT
  303. "SI1145 "
  304. #endif
  305. "";
  306. #endif // SENSOR_SUPPORT == 1
  307. //--------------------------------------------------------------------------------
  308. const String& getChipId() {
  309. static String value;
  310. if (!value.length()) {
  311. char buffer[7];
  312. value.reserve(sizeof(buffer));
  313. snprintf_P(buffer, sizeof(buffer), PSTR("%06X"), ESP.getChipId());
  314. value = buffer;
  315. }
  316. return value;
  317. }
  318. const String& getIdentifier() {
  319. static String value;
  320. if (!value.length()) {
  321. value += APP_NAME;
  322. value += '-';
  323. value += getChipId();
  324. }
  325. return value;
  326. }
  327. String getEspurnaModules() {
  328. return FPSTR(espurna_modules);
  329. }
  330. String getEspurnaOTAModules() {
  331. return FPSTR(espurna_ota_modules);
  332. }
  333. #if SENSOR_SUPPORT
  334. String getEspurnaSensors() {
  335. return FPSTR(espurna_sensors);
  336. }
  337. #endif // SENSOR_SUPPORT == 1
  338. String getEspurnaWebUI() {
  339. return FPSTR(espurna_webui);
  340. }
  341. bool isEspurnaCore() {
  342. #if defined(ESPURNA_CORE) || defined(ESPURNA_CORE_WEBUI)
  343. return true;
  344. #else
  345. return false;
  346. #endif
  347. }
  348. bool haveRelaysOrSensors() {
  349. bool result = false;
  350. result = (relayCount() > 0);
  351. #if SENSOR_SUPPORT
  352. result = result || (magnitudeCount() > 0);
  353. #endif
  354. return result;
  355. }
  356. int getBoardId() {
  357. #if defined(ESPURNA_CORE) || defined(ESPURNA_CORE_WEBUI)
  358. return 0;
  359. #elif defined(NODEMCU_LOLIN)
  360. return 2;
  361. #elif defined(NODEMCU_BASIC)
  362. return 3;
  363. #elif defined(WEMOS_D1_MINI)
  364. return 4;
  365. #elif defined(WEMOS_D1_MINI_RELAYSHIELD)
  366. return 5;
  367. #elif defined(WEMOS_D1_TARPUNA_SHIELD)
  368. return 6;
  369. #elif defined(TINKERMAN_ESPURNA_H06)
  370. return 7;
  371. #elif defined(TINKERMAN_ESPURNA_H08)
  372. return 8;
  373. #elif defined(TINKERMAN_ESPURNA_SWITCH)
  374. return 9;
  375. #elif defined(TINKERMAN_RFM69GW)
  376. return 10;
  377. #elif defined(ITEAD_SONOFF_BASIC)
  378. return 11;
  379. #elif defined(ITEAD_SONOFF_RF)
  380. return 12;
  381. #elif defined(ITEAD_SONOFF_MINI)
  382. return 13;
  383. #elif defined(ITEAD_SONOFF_TH)
  384. return 14;
  385. #elif defined(ITEAD_SONOFF_SV)
  386. return 15;
  387. #elif defined(ITEAD_SLAMPHER)
  388. return 16;
  389. #elif defined(ITEAD_S20)
  390. return 17;
  391. #elif defined(ITEAD_SONOFF_TOUCH)
  392. return 18;
  393. #elif defined(ITEAD_SONOFF_POW)
  394. return 19;
  395. #elif defined(ITEAD_SONOFF_POW_R2)
  396. return 20;
  397. #elif defined(ITEAD_SONOFF_DUAL)
  398. return 21;
  399. #elif defined(ITEAD_SONOFF_DUAL_R2)
  400. return 22;
  401. #elif defined(ITEAD_SONOFF_4CH)
  402. return 23;
  403. #elif defined(ITEAD_SONOFF_4CH_PRO)
  404. return 24;
  405. #elif defined(ITEAD_1CH_INCHING)
  406. return 25;
  407. #elif defined(ITEAD_MOTOR)
  408. return 26;
  409. #elif defined(ITEAD_BNSZ01)
  410. return 27;
  411. #elif defined(ITEAD_SONOFF_RFBRIDGE)
  412. return 28;
  413. #elif defined(ITEAD_SONOFF_B1)
  414. return 29;
  415. #elif defined(ITEAD_SONOFF_LED)
  416. return 30;
  417. #elif defined(ITEAD_SONOFF_T1_1CH)
  418. return 31;
  419. #elif defined(ITEAD_SONOFF_T1_2CH)
  420. return 32;
  421. #elif defined(ITEAD_SONOFF_T1_3CH)
  422. return 33;
  423. #elif defined(ITEAD_SONOFF_S31)
  424. return 34;
  425. #elif defined(ITEAD_SONOFF_S31_LITE)
  426. return 35;
  427. #elif defined(ITEAD_SONOFF_IFAN02)
  428. return 36;
  429. #elif defined(ORVIBO_B25)
  430. return 37;
  431. #elif defined(YJZK_SWITCH_1CH)
  432. return 38;
  433. #elif defined(YJZK_SWITCH_2CH)
  434. return 39;
  435. #elif defined(YJZK_SWITCH_3CH)
  436. return 40;
  437. #elif defined(ELECTRODRAGON_WIFI_IOT)
  438. return 41;
  439. #elif defined(WORKCHOICE_ECOPLUG)
  440. return 42;
  441. #elif defined(AITHINKER_AI_LIGHT)
  442. return 43;
  443. #elif defined(LYASI_LIGHT)
  444. return 44;
  445. #elif defined(MAGICHOME_LED_CONTROLLER)
  446. return 45;
  447. #elif defined(MAGICHOME_LED_CONTROLLER_20)
  448. return 46;
  449. #elif defined(MAGICHOME_ZJ_WFMN_A_11)
  450. return 47;
  451. #elif defined(MAGICHOME_ZJ_WFMN_B_11)
  452. return 48;
  453. #elif defined(MAGICHOME_ZJ_WFMN_C_11)
  454. return 49;
  455. #elif defined(MAGICHOME_ZJ_ESPM_5CH_B_13)
  456. return 50;
  457. #elif defined(MAGICHOME_ZJ_LB_RGBWW_L)
  458. return 51;
  459. #elif defined(HUACANXING_H801)
  460. return 52;
  461. #elif defined(HUACANXING_H802)
  462. return 53;
  463. #elif defined(JANGOE_WIFI_RELAY_NC)
  464. return 54;
  465. #elif defined(JANGOE_WIFI_RELAY_NO)
  466. return 55;
  467. #elif defined(JORGEGARCIA_WIFI_RELAYS)
  468. return 56;
  469. #elif defined(OPENENERGYMONITOR_MQTT_RELAY)
  470. return 57;
  471. #elif defined(WION_50055)
  472. return 58;
  473. #elif defined(EXS_WIFI_RELAY_V31)
  474. return 59;
  475. #elif defined(EXS_WIFI_RELAY_V50)
  476. return 60;
  477. #elif defined(GENERIC_V9261F)
  478. return 61;
  479. #elif defined(GENERIC_ECH1560)
  480. return 62;
  481. #elif defined(MANCAVEMADE_ESPLIVE)
  482. return 63;
  483. #elif defined(INTERMITTECH_QUINLED)
  484. return 64;
  485. #elif defined(ARILUX_AL_LC01)
  486. return 65;
  487. #elif defined(ARILUX_AL_LC02)
  488. return 66;
  489. #elif defined(ARILUX_AL_LC02_V14)
  490. return 67;
  491. #elif defined(ARILUX_AL_LC06)
  492. return 68;
  493. #elif defined(ARILUX_AL_LC11)
  494. return 69;
  495. #elif defined(ARILUX_E27)
  496. return 70;
  497. #elif defined(XENON_SM_PW702U)
  498. return 71;
  499. #elif defined(ISELECTOR_SM_PW702)
  500. return 72;
  501. #elif defined(AUTHOMETION_LYT8266)
  502. return 73;
  503. #elif defined(GIZWITS_WITTY_CLOUD)
  504. return 74;
  505. #elif defined(KMC_70011)
  506. return 75;
  507. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO)
  508. return 76;
  509. #elif defined(EUROMATE_WIFI_STECKER_SCHUKO_V2)
  510. return 77;
  511. #elif defined(GENERIC_8CH)
  512. return 78;
  513. #elif defined(STM_RELAY)
  514. return 79;
  515. #elif defined(TONBUX_POWERSTRIP02)
  516. return 80;
  517. #elif defined(LINGAN_SWA1)
  518. return 81;
  519. #elif defined(HEYGO_HY02)
  520. return 82;
  521. #elif defined(MAXCIO_WUS002S)
  522. return 83;
  523. #elif defined(MAXCIO_WDE004)
  524. return 84;
  525. #elif defined(OUKITEL_P1)
  526. return 85;
  527. #elif defined(YIDIAN_XSSSA05)
  528. return 86;
  529. #elif defined(TONBUX_XSSSA01)
  530. return 87;
  531. #elif defined(TONBUX_XSSSA06)
  532. return 88;
  533. #elif defined(GREEN_ESP8266RELAY)
  534. return 89;
  535. #elif defined(IKE_ESPIKE)
  536. return 90;
  537. #elif defined(ARNIEX_SWIFITCH)
  538. return 91;
  539. #elif defined(GENERIC_ESP01S_RELAY_V40)
  540. return 92;
  541. #elif defined(GENERIC_ESP01S_RGBLED_V10)
  542. return 93;
  543. #elif defined(GENERIC_ESP01S_DHT11_V10)
  544. return 94;
  545. #elif defined(GENERIC_ESP01S_DS18B20_V10)
  546. return 95;
  547. #elif defined(PILOTAK_ESP_DIN_V1)
  548. return 96;
  549. #elif defined(HELTEC_TOUCHRELAY)
  550. return 97;
  551. #elif defined(ZHILDE_44EU_W)
  552. return 98;
  553. #elif defined(ALLNET_4DUINO_IOT_WLAN_RELAIS)
  554. return 99;
  555. #elif defined(LUANI_HVIO)
  556. return 100;
  557. #elif defined(TONBUX_MOSQUITO_KILLER)
  558. return 101;
  559. #elif defined(NEO_COOLCAM_NAS_WR01W)
  560. return 102;
  561. #elif defined(DELTACO_SH_P01)
  562. return 103;
  563. #elif defined(DELTACO_SH_P03USB)
  564. return 104;
  565. #elif defined(FORNORM_ZLD_34EU)
  566. return 105;
  567. #elif defined(BH_ONOFRE)
  568. return 106;
  569. #elif defined(BLITZWOLF_BWSHPX)
  570. return 107;
  571. #elif defined(BLITZWOLF_BWSHPX_V23)
  572. return 108;
  573. #elif defined(BLITZWOLF_BWSHP5)
  574. return 109;
  575. #elif defined(TECKIN_SP21)
  576. return 110;
  577. #elif defined(TECKIN_SP22_V14)
  578. return 111;
  579. #elif defined(GOSUND_WS1)
  580. return 112;
  581. #elif defined(HOMECUBE_16A)
  582. return 113;
  583. #elif defined(VANZAVANZU_SMART_WIFI_PLUG_MINI)
  584. return 114;
  585. #elif defined(GENERIC_AG_L4)
  586. return 115;
  587. #elif defined(ALLTERCO_SHELLY1)
  588. return 116;
  589. #elif defined(ALLTERCO_SHELLY2)
  590. return 117;
  591. #elif defined(ALLTERCO_SHELLY1PM)
  592. return 118;
  593. #elif defined(ALLTERCO_SHELLY25)
  594. return 119;
  595. #elif defined(LOHAS_E27_9W)
  596. return 120;
  597. #elif defined(LOHAS_E26_A19)
  598. return 121;
  599. #elif defined(TECKIN_SB53)
  600. return 122;
  601. #elif defined(XIAOMI_SMART_DESK_LAMP)
  602. return 123;
  603. #elif defined(PHYX_ESP12_RGB)
  604. return 124;
  605. #elif defined(IWOOLE_LED_TABLE_LAMP)
  606. return 125;
  607. #elif defined(GENERIC_GU10)
  608. return 126;
  609. #elif defined(GENERIC_E14)
  610. return 127;
  611. #elif defined(DELTACO_SH_LEXXW)
  612. return 128;
  613. #elif defined(DELTACO_SH_LEXXRGB)
  614. return 129;
  615. #elif defined(NEXETE_A19)
  616. return 130;
  617. #elif defined(LOMBEX_LUX_NOVA2_TUNABLE_WHITE)
  618. return 131;
  619. #elif defined(LOMBEX_LUX_NOVA2_WHITE_COLOR)
  620. return 132;
  621. #elif defined(BESTEK_MRJ1011)
  622. return 133;
  623. #elif defined(GBLIFE_RGBW_SOCKET)
  624. return 134;
  625. #elif defined(SMARTLIFE_MINI_SMART_SOCKET)
  626. return 135;
  627. #elif defined(HAMA_WIFI_STECKDOSE_00176533)
  628. return 136;
  629. #elif defined(DIGOO_NX_SP202)
  630. return 137;
  631. #elif defined(FOXEL_LIGHTFOX_DUAL)
  632. return 138;
  633. #elif defined(TECKIN_SP20)
  634. return 139;
  635. #elif defined(LITESUN_LA_WF3)
  636. return 140;
  637. #elif defined(PSH_WIFI_PLUG)
  638. return 141;
  639. #elif defined(PSH_RGBW_CONTROLLER)
  640. return 142;
  641. #elif defined(PSH_WIFI_SENSOR)
  642. return 143;
  643. #elif defined(JINVOO_VALVE_SM_AW713)
  644. return 144;
  645. #elif defined(TUYA_GENERIC_DIMMER)
  646. return 145;
  647. #elif defined(ETEKCITY_ESW01_USA)
  648. return 146;
  649. #elif defined(FS_UAP1)
  650. return 147;
  651. #elif defined(TFLAG_NX_SMX00)
  652. return 148;
  653. #elif defined(MUVIT_IO_MIOBULB001)
  654. return 149;
  655. #elif defined(HYKKER_SMART_HOME_POWER_PLUG)
  656. return 150;
  657. #elif defined(KOGAN_SMARTER_HOME_PLUG_W_POW)
  658. return 151;
  659. #elif defined(LSC_SMART_LED_LIGHT_STRIP)
  660. return 152;
  661. #elif defined(EHOMEDIY_WT02)
  662. return 153;
  663. #elif defined(EHOMEDIY_WT03)
  664. return 154;
  665. #elif defined(LINKSPRITE_LINKNODE_R4)
  666. return 155;
  667. #elif defined(GENERIC_ESP01_512KB)
  668. return 156;
  669. #elif defined(GOSUND_WP3)
  670. return 157;
  671. #elif defined(GENERIC_AG_L4_V3)
  672. return 158;
  673. #elif defined(PRODINO_WIFI)
  674. return 159;
  675. #else
  676. return -1; // CUSTOM
  677. #endif
  678. }