diff --git a/code/espurna/board.cpp b/code/espurna/board.cpp index c1095921..a6927712 100644 --- a/code/espurna/board.cpp +++ b/code/espurna/board.cpp @@ -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 diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index db9b93f8..8cbb43cc 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -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 diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 92fc7a09..40e192b9 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -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 diff --git a/code/platformio.ini b/code/platformio.ini index d6d6fbce..059f1227 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -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 diff --git a/code/platformio_ota.ini b/code/platformio_ota.ini index 392ad5b2..12798a68 100644 --- a/code/platformio_ota.ini +++ b/code/platformio_ota.ini @@ -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 diff --git a/images/devices/generic-ag-l4-v3-1.jpg b/images/devices/generic-ag-l4-v3-1.jpg new file mode 100644 index 00000000..25b3c48e Binary files /dev/null and b/images/devices/generic-ag-l4-v3-1.jpg differ diff --git a/images/devices/generic-ag-l4-v3-2.jpg b/images/devices/generic-ag-l4-v3-2.jpg new file mode 100644 index 00000000..4ae1e159 Binary files /dev/null and b/images/devices/generic-ag-l4-v3-2.jpg differ diff --git a/images/devices/generic-ag-l4-v3-3.jpg b/images/devices/generic-ag-l4-v3-3.jpg new file mode 100644 index 00000000..ab6c4f8a Binary files /dev/null and b/images/devices/generic-ag-l4-v3-3.jpg differ diff --git a/images/devices/generic-ag-l4-v3-4.jpg b/images/devices/generic-ag-l4-v3-4.jpg new file mode 100644 index 00000000..597bc83b Binary files /dev/null and b/images/devices/generic-ag-l4-v3-4.jpg differ diff --git a/images/devices/generic-ag-l4-v3-5.jpg b/images/devices/generic-ag-l4-v3-5.jpg new file mode 100644 index 00000000..b3f5e0db Binary files /dev/null and b/images/devices/generic-ag-l4-v3-5.jpg differ