Skip to content

Commit

Permalink
Added swifitch device support
Browse files Browse the repository at this point in the history
  • Loading branch information
LubergAlexander committed Apr 5, 2018
1 parent fa20c47 commit 1d9dba1
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)|
Expand Down
27 changes: 27 additions & 0 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions code/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 ---
# ------------------------------------------------------------------------------
Expand Down
Binary file added images/devices/swifitch.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1d9dba1

Please sign in to comment.