From e5b72a0d43892eec7e4496e73031180bd2f3acb7 Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Mon, 16 Dec 2019 14:41:35 +0300 Subject: [PATCH] Device: add LOHAS_E26_A19, rename LOHAS_9W to LOHAS_E27_9W (#2068) --- code/espurna/config/arduino.h | 3 ++- code/espurna/config/hardware.h | 24 +++++++++++++++++++++++- code/platformio.ini | 14 ++++++++++++-- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index 3b151db2..142712d3 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -99,7 +99,8 @@ //#define LINGAN_SWA1 //#define LINKSPRITE_LINKNODE_R4 //#define LITESUN_LA_WF3 -//#define LOHAS_9W +//#define LOHAS_E27_9W +//#define LOHAS_E26_A19 //#define LOMBEX_LUX_NOVA2_TUNABLE_WHITE //#define LOMBEX_LUX_NOVA2_WHITE_COLOR //#define LUANI_HVIO diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index eb4f6034..c97c1e7d 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -3389,7 +3389,10 @@ // ----------------------------------------------------------------------------- -#elif defined(LOHAS_9W) +// also works with https://www.amazon.com/gp/product/B07TMY394G/ +// see https://github.com/xoseperez/espurna/issues/2055 + +#elif defined(LOHAS_E27_9W) // Info #define MANUFACTURER "LOHAS" @@ -3408,6 +3411,25 @@ #define MY92XX_MAPPING 0, 1, 2, 3, 4 #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1 +// https://www.amazon.com/gp/product/B07T7W7ZMW + +#elif defined(LOHAS_E26_A19) + + // Info + #define MANUFACTURER "LOHAS" + #define DEVICE "E26_A19" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER + #define DUMMY_RELAY_COUNT 1 + + // Light + #define LIGHT_CHANNELS 5 + #define LIGHT_CH1_PIN 5 // RED + #define LIGHT_CH2_PIN 4 // GREEN + #define LIGHT_CH3_PIN 13 // BLUE + #define LIGHT_CH4_PIN 14 // WHITE1 + #define LIGHT_CH5_PIN 12 // WHITE1 + // ----------------------------------------------------------------------------- #elif defined(XIAOMI_SMART_DESK_LAMP) diff --git a/code/platformio.ini b/code/platformio.ini index 7fee9915..b050be6e 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -1465,11 +1465,21 @@ upload_flags = ${common.ota_upload_flags} [env:lohas-e27-9w] board = ${common.board_1m} -build_flags = ${common.build_flags_1m0m} -DLOHAS_9W +build_flags = ${common.build_flags_1m0m} -DLOHAS_E27_9W [env:lohas-e27-9w-ota] board = ${common.board_1m} -build_flags = ${common.build_flags_1m0m} -DLOHAS_9W +build_flags = ${common.build_flags_1m0m} -DLOHAS_E27_9W +upload_port = ${common.ota_upload_port} +upload_flags = ${common.ota_upload_flags} + +[env:lohas-e26-a19] +board = ${common.board_1m} +build_flags = ${common.build_flags_1m0m} -DLOHAS_E26_A19 + +[env:lohas-e26-a19-ota] +board = ${common.board_1m} +build_flags = ${common.build_flags_1m0m} -DLOHAS_E26_A19 upload_port = ${common.ota_upload_port} upload_flags = ${common.ota_upload_flags}