From c97b33470e24e1dc775689a70ab400f5d13d32bc Mon Sep 17 00:00:00 2001 From: Steveway Date: Tue, 14 Aug 2018 22:19:53 +0200 Subject: [PATCH] Add support for Lohas 9W bulbs It seems to be very similar to the ITead Sonoff B1, so it's based on that. --- code/espurna/config/hardware.h | 19 +++++++++++++++++++ code/platformio.ini | 25 +++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 17727ee7..eda24b5e 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -743,6 +743,25 @@ #define MY92XX_MAPPING 4, 3, 5, 0, 1 #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1 +#elif defined(LOHAS_9W) + + // Info + #define MANUFACTURER "LOHAS" + #define DEVICE "E27_9W" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_MY92XX + #define DUMMY_RELAY_COUNT 1 + + // Light + #define LIGHT_CHANNELS 5 + #define MY92XX_MODEL MY92XX_MODEL_MY9231 + #define MY92XX_CHIPS 2 + #define MY92XX_DI_PIN 13 + #define MY92XX_DCKI_PIN 15 + #define MY92XX_COMMAND MY92XX_COMMAND_DEFAULT + #define MY92XX_MAPPING 0, 1, 2, 3, 4 + #define LIGHT_WHITE_FACTOR (0.1) // White LEDs are way more bright in the B1 + #elif defined(ITEAD_SONOFF_LED) // Info diff --git a/code/platformio.ini b/code/platformio.ini index 3a7e8d2a..2a727151 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -671,6 +671,31 @@ upload_flags = ${common.upload_flags} monitor_speed = ${common.monitor_speed} extra_scripts = ${common.extra_scripts} +[env:lohas-e27-9w] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board_1m} +board_build.flash_mode = ${common.flash_mode} +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m0m} -DLOHAS_9W +monitor_speed = ${common.monitor_speed} +extra_scripts = ${common.extra_scripts} + +[env:lohas-e27-9w-ota] +platform = ${common.platform} +framework = ${common.framework} +board = ${common.board_1m} +board_build.flash_mode = ${common.flash_mode} +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m0m} -DLOHAS_9W +upload_speed = ${common.upload_speed} +upload_port = ${common.upload_port} +upload_flags = ${common.upload_flags} +monitor_speed = ${common.monitor_speed} +extra_scripts = ${common.extra_scripts} + [env:itead-sonoff-t1-1ch] platform = ${common.platform} framework = ${common.framework}