From c3a0a701c2986ff1485d6546938cc811558ae3c2 Mon Sep 17 00:00:00 2001 From: Colin Shorts Date: Sat, 23 Mar 2019 09:53:45 +0000 Subject: [PATCH] Adding support for Generic GU10 from #1549 --- code/espurna/config/arduino.h | 1 + code/espurna/config/hardware.h | 25 +++++++++++++++++++++++++ code/espurna/migrate.ino | 15 +++++++++++++++ code/platformio.ini | 28 +++++++++++++++++++++++++++- 4 files changed, 68 insertions(+), 1 deletion(-) diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index a48a268a..0a6c255d 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -40,6 +40,7 @@ //#define GENERIC_ESP01S_DS18B20_V10 //#define GENERIC_ESP01S_RELAY_V40 //#define GENERIC_ESP01S_RGBLED_V10 +//#define GENERIC_GU10 //#define GENERIC_V9261F //#define GIZWITS_WITTY_CLOUD //#define GOSUND_WS1 diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 215bb125..c72053f5 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -3173,6 +3173,31 @@ #define LIGHT_CH3_INVERSE 0 #define LIGHT_CH4_INVERSE 0 +// ----------------------------------------------------------------------------- +// Generic GU10 +// https://www.ebay.com/itm/1-10PC-GU10-RGB-Smart-Bulb-Wireless-WiFi-App-Remote-Ctrl-Light-for-Alexa-Google/173724116351 +// ----------------------------------------------------------------------------- + +#elif defined(GENERIC_GU10) + + // Info + #define MANUFACTURER "GENERIC" + #define DEVICE "GU10" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER + #define DUMMY_RELAY_COUNT 1 + + // Light + #define LIGHT_CHANNELS 4 + #define LIGHT_CH1_PIN 14 // RED + #define LIGHT_CH2_PIN 12 // GREEN + #define LIGHT_CH3_PIN 13 // BLUE + #define LIGHT_CH4_PIN 4 // WHITE + #define LIGHT_CH1_INVERSE 0 + #define LIGHT_CH2_INVERSE 0 + #define LIGHT_CH3_INVERSE 0 + #define LIGHT_CH4_INVERSE 0 + // ----------------------------------------------------------------------------- // Lombex Lux Nova 2 Tunable White // https://www.amazon.com/Lombex-Compatible-Equivalent-Dimmable-2700K-6500K/dp/B07B8K72PR diff --git a/code/espurna/migrate.ino b/code/espurna/migrate.ino index de0880f4..0f084b55 100644 --- a/code/espurna/migrate.ino +++ b/code/espurna/migrate.ino @@ -1300,6 +1300,21 @@ void migrate() { setSetting("relayProvider", RELAY_PROVIDER_DUAL); setSetting("relays", 2); + #elif defined(GENERIC_GU10) + + setSetting("board", 97); + setSetting("relayProvider", RELAY_PROVIDER_LIGHT); + setSetting("lightProvider", LIGHT_PROVIDER_DIMMER); + setSetting("chGPIO", 0, 14); + setSetting("chGPIO", 1, 12); + setSetting("chGPIO", 2, 13); + setSetting("chGPIO", 3, 4); + setSetting("chLogic", 0, 0); + setSetting("chLogic", 1, 0); + setSetting("chLogic", 2, 0); + setSetting("chLogic", 3, 0); + setSetting("relays", 1); + #else // Allow users to define new settings without migration config diff --git a/code/platformio.ini b/code/platformio.ini index 78dc6660..28a7d140 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -3302,4 +3302,30 @@ upload_speed = ${common.upload_speed} monitor_speed = ${common.monitor_speed} upload_port = ${common.upload_port} upload_flags = ${common.upload_flags} -extra_scripts = ${common.extra_scripts} \ No newline at end of file +extra_scripts = ${common.extra_scripts} + +[env:generic-gu10] +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} -DGENERIC_GU10 +monitor_speed = ${common.monitor_speed} +extra_scripts = ${common.extra_scripts} + +[env:generic-gu10] +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} -DGENERIC_GU10 +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} +