Skip to content

Commit

Permalink
Merge pull request #1128 from abmantis/shelly1
Browse files Browse the repository at this point in the history
add support for shelly1 relay
  • Loading branch information
xoseperez authored Aug 25, 2018
2 parents 5dcefe3 + cfc0f80 commit 3f8f425
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
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

0 comments on commit 3f8f425

Please sign in to comment.