Browse Source

Add iselector-sm-pw702 (#1837)

master
Laine Walker-Avina 5 years ago
committed by Max Prokhorov
parent
commit
7e536be79c
4 changed files with 48 additions and 0 deletions
  1. +1
    -0
      code/espurna/config/arduino.h
  2. +25
    -0
      code/espurna/config/hardware.h
  3. +12
    -0
      code/espurna/migrate.ino
  4. +10
    -0
      code/platformio.ini

+ 1
- 0
code/espurna/config/arduino.h View File

@ -129,6 +129,7 @@
//#define WION_50055 //#define WION_50055
//#define WORKCHOICE_ECOPLUG //#define WORKCHOICE_ECOPLUG
//#define XENON_SM_PW702U //#define XENON_SM_PW702U
//#define ISELECTOR_SM_PW702
//#define XIAOMI_SMART_DESK_LAMP //#define XIAOMI_SMART_DESK_LAMP
//#define YIDIAN_XSSSA05 //#define YIDIAN_XSSSA05
//#define YJZK_SWITCH_1CH //#define YJZK_SWITCH_1CH


+ 25
- 0
code/espurna/config/hardware.h View File

@ -1820,6 +1820,31 @@
#define LED1_PIN 4 #define LED1_PIN 4
#define LED1_PIN_INVERSE 1 #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 // AUTHOMETION LYT8266
// https://authometion.com/shop/en/home/13-lyt8266.html // https://authometion.com/shop/en/home/13-lyt8266.html


+ 12
- 0
code/espurna/migrate.ino View File

@ -1315,6 +1315,18 @@ void migrate() {
setSetting("chLogic", 3, 0); setSetting("chLogic", 3, 0);
setSetting("relays", 1); 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 #else
// Allow users to define new settings without migration config // Allow users to define new settings without migration config


+ 10
- 0
code/platformio.ini View File

@ -896,6 +896,16 @@ build_flags = ${common.build_flags_1m0m} -DXENON_SM_PW702U
upload_port = ${common.ota_upload_port} upload_port = ${common.ota_upload_port}
upload_flags = ${common.ota_upload_flags} 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] [env:authometion-lyt8266]
board = ${common.board_1m} board = ${common.board_1m}
build_flags = ${common.build_flags_1m0m} -DAUTHOMETION_LYT8266 build_flags = ${common.build_flags_1m0m} -DAUTHOMETION_LYT8266


Loading…
Cancel
Save