Skip to content

Commit

Permalink
Add support for AG-L4 v3 (#2276)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej-peterka authored Jun 27, 2020
1 parent 7aec0c5 commit 3e28ebf
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions code/espurna/board.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,8 @@ int getBoardId() {
return 156;
#elif defined(GOSUND_WP3)
return 157;
#elif defined(GENERIC_AG_L4_V3)
return 158;
#else
return -1; // CUSTOM
#endif
Expand Down
1 change: 1 addition & 0 deletions code/espurna/config/arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
//#define GBLIFE_RGBW_SOCKET
//#define GENERIC_8CH
//#define GENERIC_AG_L4
//#define GENERIC_AG_L4_V3
//#define GENERIC_E14
//#define GENERIC_ECH1560
//#define GENERIC_ESP01S_DHT11_V10
Expand Down
44 changes: 44 additions & 0 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -3533,6 +3533,50 @@

// -----------------------------------------------------------------------------

#elif defined(GENERIC_AG_L4_V3)

// Info
#define MANUFACTURER "GENERIC"
#define DEVICE "AG_L4_V3"
#define RELAY_PROVIDER RELAY_PROVIDER_LIGHT
#define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER
#define DUMMY_RELAY_COUNT 1

// button 1: "power" button
#define BUTTON1_PIN 13
#define BUTTON1_RELAY 1
#define BUTTON1_CONFIG BUTTON_PUSHBUTTON | BUTTON_SET_PULLUP | BUTTON_DEFAULT_HIGH
#define BUTTON1_PRESS BUTTON_ACTION_TOGGLE
#define BUTTON1_CLICK BUTTON_ACTION_NONE
#define BUTTON1_DBLCLICK BUTTON_ACTION_NONE
#define BUTTON1_LNGCLICK BUTTON_ACTION_NONE
#define BUTTON1_LNGLNGCLICK BUTTON_ACTION_RESET

// button 2: "wifi" button
#define BUTTON2_PIN 2
#define BUTTON2_CONFIG BUTTON_PUSHBUTTON | BUTTON_DEFAULT_HIGH
#define BUTTON2_PRESS BUTTON_ACTION_TOGGLE
#define BUTTON2_CLICK BUTTON_ACTION_NONE
#define BUTTON2_DBLCLICK BUTTON_ACTION_NONE
#define BUTTON2_LNGCLICK BUTTON_ACTION_NONE
#define BUTTON2_LNGLNGCLICK BUTTON_ACTION_NONE

// LEDs
#define LED1_PIN 5 // red status led
#define LED1_PIN_INVERSE 0

#define LED2_PIN 16 // master light power
#define LED2_PIN_INVERSE 1
#define LED2_MODE LED_MODE_RELAY

// Light
#define LIGHT_CHANNELS 3
#define LIGHT_CH1_PIN 4 // RED
#define LIGHT_CH2_PIN 12 // GREEN
#define LIGHT_CH3_PIN 14 // BLUE

// -----------------------------------------------------------------------------

#elif defined(ALLTERCO_SHELLY1)

// Info
Expand Down
4 changes: 4 additions & 0 deletions code/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,10 @@ src_build_flags = -DBH_ONOFRE
extends = env:esp8266-1m-base
src_build_flags = -DGENERIC_AG_L4

[env:generic-ag-l4-v3]
extends = env:esp8266-1m-base
src_build_flags = -DGENERIC_AG_L4_V3

[env:lohas-e27-9w]
extends = env:esp8266-1m-base
src_build_flags = -DLOHAS_E27_9W
Expand Down
3 changes: 3 additions & 0 deletions code/platformio_ota.ini
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ extends = env:bh-onofre
[env:generic-ag-l4-ota]
extends = env:generic-ag-l4

[env:generic-ag-l4-v3-ota]
extends = env:generic-ag-l4-v3

[env:lohas-e27-9w-ota]
extends = env:lohas-e27-9w

Expand Down
Binary file added images/devices/generic-ag-l4-v3-1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/devices/generic-ag-l4-v3-2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/devices/generic-ag-l4-v3-3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/devices/generic-ag-l4-v3-4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/devices/generic-ag-l4-v3-5.jpg
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 3e28ebf

Please sign in to comment.