diff --git a/README.md b/README.md index 9f8acbd7..c19808ae 100644 --- a/README.md +++ b/README.md @@ -204,8 +204,8 @@ Here is the list of supported hardware. For more information please refer to the |**Maxcio W-US002S**|**HEYGO HY02**|**YiDian XS-SSA05**| |![WiOn 50055](images/devices/wion-50055.jpg)|![LINGAN SWA1](images/devices/lingan-swa1.jpg)|![Tonbux PowerStrip02](images/devices/tonbux-powerstrip02.jpg)| |**WiOn 50055**|**LINGAN SWA1**|**Tonbux PowerStrip02** -|![Itead Sonoff Touch](images/devices/itead-sonoff-touch.jpg)|![Itead Sonoff T1](images/devices/itead-sonoff-t1.jpg)|| -|**Itead Sonoff Touch**|**Itead Sonoff T1**|| +|![Itead Sonoff Touch](images/devices/itead-sonoff-touch.jpg)|![Itead Sonoff T1](images/devices/itead-sonoff-t1.jpg)|![Swifitch](images/devices/swifitch.png)| +|**Itead Sonoff Touch**|**Itead Sonoff T1**|Swifitch| |![Itead Slampher](images/devices/itead-slampher.jpg)||| |**Itead Slampher**||| |![Itead Sonoff B1](images/devices/itead-sonoff-b1.jpg)|![AI-Thinker Wifi Light / Noduino OpenLight](images/devices/aithinker-ai-light.jpg)|![Authometion LYT8266](images/devices/authometion-lyt8266.jpg)| diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index b491c9f3..4a936f4c 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -51,6 +51,33 @@ // Development boards // ----------------------------------------------------------------------------- +#elif defined(SWIFITCH) + // https://github.com/ArnieX/swifitch + + // Info + #define MANUFACTURER "SWIFITCH" + #define DEVICE "SWIFITCH" + + // Buttons + #define BUTTON1_PIN 4 // D2 + #define BUTTON1_MODE BUTTON_SWITCH | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH + #define BUTTON1_RELAY 1 + + #define BUTTON1_PRESS BUTTON_MODE_NONE + #define BUTTON1_CLICK BUTTON_MODE_TOGGLE + #define BUTTON1_DBLCLICK BUTTON_MODE_NONE + #define BUTTON1_LNGCLICK BUTTON_MODE_NONE + #define BUTTON1_LNGLNGCLICK BUTTON_MODE_NONE + + + // Relays + #define RELAY1_PIN 5 // D1 + #define RELAY1_TYPE RELAY_TYPE_INVERSE + + // LEDs + #define LED1_PIN 12 // D6 + #define LED1_PIN_INVERSE 1 + #elif defined(NODEMCU_LOLIN) // Info diff --git a/code/platformio.ini b/code/platformio.ini index 66066ea7..3feb28b7 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1753,6 +1753,18 @@ upload_port = "${env.ESPURNA_IP}" upload_flags = --auth=${env.ESPURNA_AUTH} --port 8266 extra_scripts = ${common.extra_scripts} +[env:swifitch] +platform = espressif8266@1.6.0 +framework = arduino +board = nodemcuv2 +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m} -DSWIFITCH +extra_scripts = ${common.extra_scripts} +monitor_baud = 115200 + + # ------------------------------------------------------------------------------ # SPECIAL BUILDS - DO. NOT. USE. ever --- # ------------------------------------------------------------------------------ diff --git a/images/devices/swifitch.png b/images/devices/swifitch.png new file mode 100644 index 00000000..f43aba09 Binary files /dev/null and b/images/devices/swifitch.png differ