diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index c6c725b6..6a8cf4e6 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -129,6 +129,7 @@ //#define WION_50055 //#define WORKCHOICE_ECOPLUG //#define XENON_SM_PW702U +//#define ISELECTOR_SM_PW702 //#define XIAOMI_SMART_DESK_LAMP //#define YIDIAN_XSSSA05 //#define YJZK_SWITCH_1CH diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index b6684f93..79651e9c 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -1820,6 +1820,31 @@ #define LED1_PIN 4 #define LED1_PIN_INVERSE 1 +// ----------------------------------------------------------------------------- +// ISELECTOR SM-PW702 +// ----------------------------------------------------------------------------- + +#elif defined(ISELECTOR_SM_PW702) + + // Info + #define MANUFACTURER "ISELECTOR" + #define DEVICE "SM_PW702" + + // Buttons + #define BUTTON1_PIN 13 + #define BUTTON1_MODE BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH + #define BUTTON1_RELAY 1 + + // Relays + #define RELAY1_PIN 12 + #define RELAY1_TYPE RELAY_TYPE_NORMAL + + // LEDs + #define LED1_PIN 4 //BLUE + #define LED1_PIN_INVERSE 0 + #define LED2_PIN 5 //RED + #define LED2_PIN_INVERSE 1 + // ----------------------------------------------------------------------------- // AUTHOMETION LYT8266 // https://authometion.com/shop/en/home/13-lyt8266.html diff --git a/code/espurna/migrate.ino b/code/espurna/migrate.ino index 0f084b55..68b49675 100644 --- a/code/espurna/migrate.ino +++ b/code/espurna/migrate.ino @@ -1315,6 +1315,18 @@ void migrate() { setSetting("chLogic", 3, 0); setSetting("relays", 1); + #elif defined(ISELECTOR_SM_PW702) + + setSetting("board", 98); + setSetting("ledGPIO", 0, 4); + setSetting("ledLogic", 0, 0); + setSetting("ledGPIO", 1, 5); + setSetting("ledLogic", 0, 0); + setSetting("btnGPIO", 0, 13); + setSetting("btnRelay", 0, 0); + setSetting("relayGPIO", 0, 12); + setSetting("relayType", 0, RELAY_TYPE_NORMAL); + #else // Allow users to define new settings without migration config diff --git a/code/platformio.ini b/code/platformio.ini index 65055e05..397477a0 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -896,6 +896,16 @@ build_flags = ${common.build_flags_1m0m} -DXENON_SM_PW702U upload_port = ${common.ota_upload_port} upload_flags = ${common.ota_upload_flags} +[env:iselector-sm-pw702] +board = ${common.board_1m} +build_flags = ${common.build_flags_1m0m} -DISELECTOR_SM_PW702 + +[env:iselector-sm-pw702-ota] +board = ${common.board_1m} +build_flags = ${common.build_flags_1m0m} -DISELECTOR_SM_PW702 +upload_port = ${common.ota_upload_port} +upload_flags = ${common.ota_upload_flags} + [env:authometion-lyt8266] board = ${common.board_1m} build_flags = ${common.build_flags_1m0m} -DAUTHOMETION_LYT8266