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

hardware: Add support for HUGOAI smart socket plug. #2243

Merged
merged 2 commits into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -70,6 +70,7 @@
//#define HOMECUBE_16A
//#define HUACANXING_H801
//#define HUACANXING_H802
//#define HUGOAI_AWP02L_N
//#define HYKKER_SMART_HOME_POWER_PLUG
//#define IKE_ESPIKE
//#define INTERMITTECH_QUINLED
Expand Down
36 changes: 36 additions & 0 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,42 @@
#define LIGHT_CH3_PIN 13 // BLUE
#define LIGHT_CH4_PIN 15 // WHITE

// -----------------------------------------------------------------------------
// HUGOAI AWP02L-N
// Pin equivalence extracted from https://templates.blakadder.com/hugoai_awp02l-n.html
//
// It follows almost same structure as AOYCOCR X5P with only 1 LED on GPIO02
//
// -----------------------------------------------------------------------------

#elif defined(HUGOAI_AWP02L_N)
#define MANUFACTURER "HUGOAI"
#define DEVICE "AWP02L-N"

// Buttons
#define BUTTON1_PIN 13
#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON1_RELAY 1
// the defaults are reasonable, but you can change them as desired
//#define BUTTON1_PRESS BUTTON_ACTION_NONE
//#define BUTTON1_CLICK BUTTON_ACTION_TOGGLE
//#define BUTTON1_DBLCLICK BUTTON_ACTION_AP
//#define BUTTON1_LNGCLICK BUTTON_ACTION_RESET
//#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_FACTORY

// Relays
#define RELAY1_PIN 15
#define RELAY1_TYPE RELAY_TYPE_NORMAL

// LEDs

// LED1 (blue) indicates on/off state; you could use LED_MODE_FOLLOW_INVERSE
// so that the LED lights the button when 'off' so it can be found easily.
#define LED1_PIN 2
#define LED1_PIN_INVERSE 1
#define LED1_MODE LED_MODE_FOLLOW
#define LED1_RELAY 1

// -----------------------------------------------------------------------------
// Jan Goedeke Wifi Relay
// https://github.com/JanGoe/esp8266-wifi-relay
Expand Down
6 changes: 5 additions & 1 deletion code/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ src_build_flags = -DTINKERMAN_RFM69GW -DNOWSAUTH

[env:foxel-lightfox-dual]
extends = env:esp8266-1m-base
src_build_flags =
src_build_flags =
-DFOXEL_LIGHTFOX_DUAL
-DDISABLE_POSTMORTEM_STACKDUMP

Expand Down Expand Up @@ -1006,3 +1006,7 @@ src_build_flags = -DKINGART_CURTAIN_SWITCH
[env:aoycocr-x5p]
extends = env:esp8266-1m-base
src_build_flags = -DAOYCOCR_X5P

[env:hugoai-awp02l-n]
extends = env:esp8266-1m-base
src_build_flags = -HUGOAI_AWP02L_N
mcspr marked this conversation as resolved.
Show resolved Hide resolved