diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 8aa25d2a..36e7db29 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -706,6 +706,26 @@ #define LIGHT_CH3_INVERSE 0 #define LIGHT_CH4_INVERSE 0 +#elif defined(MAGICHOME_LED_CONTROLLER_2_0) + + // Info + #define MANUFACTURER "MAGICHOME" + #define DEVICE "LED_CONTROLLER_2_0" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER + #define DUMMY_RELAY_COUNT 1 + + // Channels + #define LIGHT_CH1_PIN 5 // RED + #define LIGHT_CH2_PIN 12 // GREEN + #define LIGHT_CH3_PIN 13 // BLUE + #define LIGHT_CH4_PIN 15 // WHITE + + #define LIGHT_CH1_INVERSE 0 + #define LIGHT_CH2_INVERSE 0 + #define LIGHT_CH3_INVERSE 0 + #define LIGHT_CH4_INVERSE 0 + // ----------------------------------------------------------------------------- // HUACANXING H801 // ----------------------------------------------------------------------------- diff --git a/code/espurna/hardware.ino b/code/espurna/hardware.ino index 1eae8c03..99122aaa 100644 --- a/code/espurna/hardware.ino +++ b/code/espurna/hardware.ino @@ -482,6 +482,21 @@ void hwUpwardsCompatibility() { setSetting("chLogic", 2, 0); setSetting("relays", 1); + #elif defined(MAGICHOME_LED_CONTROLLER_2_0) + + setSetting("board", 42); + setSetting("relayProvider", RELAY_PROVIDER_LIGHT); + setSetting("lightProvider", LIGHT_PROVIDER_DIMMER); + setSetting("chGPIO", 1, 5); + setSetting("chGPIO", 2, 12); + setSetting("chGPIO", 3, 13); + setSetting("chGPIO", 4, 15); + setSetting("chLogic", 1, 0); + setSetting("chLogic", 2, 0); + setSetting("chLogic", 3, 0); + setSetting("chLogic", 4, 0); + setSetting("relays", 1); + #else #error "UNSUPPORTED HARDWARE!" diff --git a/code/platformio.ini b/code/platformio.ini index 8870d5ec..5ff3176c 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -728,6 +728,28 @@ upload_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 monitor_baud = 115200 +[env:magichome-led-controller-2-0] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m} -DMAGICHOME_LED_CONTROLLER_2_0 +monitor_baud = 115200 + +[env:magichome-led-controller-2-0-ota] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = ${common.build_flags_1m} -DMAGICHOME_LED_CONTROLLER_2_0 +upload_port = "192.168.4.1" +upload_flags = --auth=fibonacci --port 8266 +monitor_baud = 115200 + [env:huacanxing-h801] platform = ${common.platform} framework = arduino