Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for shelly1 relay #1128

Merged
merged 1 commit into from
Aug 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/espurna/config/arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
//#define BH_ONOFRE
//#define ITEAD_SONOFF_IFAN02
//#define GENERIC_AG_L4
#define ALLTERCO_SHELLY1

//--------------------------------------------------------------------------------
// Features (values below are non-default values)
Expand Down
14 changes: 14 additions & 0 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -2728,6 +2728,20 @@
#define NETBIOS_SUPPORT 1
#define SSDP_SUPPORT 1

#elif defined(ALLTERCO_SHELLY1)

// Info
#define MANUFACTURER "ALLTERCO"
#define DEVICE "SHELLY1"

// Buttons
#define BUTTON1_PIN 5
#define BUTTON1_MODE BUTTON_SWITCH
#define BUTTON1_RELAY 1

// Relays
#define RELAY1_PIN 4
#define RELAY1_TYPE RELAY_TYPE_NORMAL
#endif

// -----------------------------------------------------------------------------
Expand Down
9 changes: 9 additions & 0 deletions code/espurna/migrate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,15 @@ void migrate() {
setSetting("chLogic", 2, 0);
setSetting("relays", 1);

#elif defined(ALLTERCO_SHELLY1)

setSetting("board", 83);
setSetting("btnGPIO", 0, 5);
setSetting("btnRelay", 0, 0);
setSetting("relayGPIO", 0, 4);
setSetting("relayType", 0, RELAY_TYPE_NORMAL);


#else

// Allow users to define new settings without migration config
Expand Down