diff --git a/code/espurna/config/arduino.h b/code/espurna/config/arduino.h index 3fdd0451..767c7b6b 100644 --- a/code/espurna/config/arduino.h +++ b/code/espurna/config/arduino.h @@ -34,6 +34,7 @@ //#define WORKCHOICE_ECOPLUG //#define AITHINKER_AI_LIGHT //#define MAGICHOME_LED_CONTROLLER +//#define MAGICHOME_LED_CONTROLLER_IR //#define HUACANXING_H801 //#define JANGOE_WIFI_RELAY_NC //#define JANGOE_WIFI_RELAY_NO diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 25796d15..5209e90a 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -647,6 +647,35 @@ #define LIGHT_CH3_INVERSE 0 #define LIGHT_CH4_INVERSE 0 +// ----------------------------------------------------------------------------- +// LED Controller With IR +// ----------------------------------------------------------------------------- + +#elif defined(MAGICHOME_LED_CONTROLLER_IR) + + // Info + #define MANUFACTURER "MAGICHOME" + #define DEVICE "LED_CONTROLLER_IR" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_DIMMER + #define DUMMY_RELAY_COUNT 1 + + // LEDs + #define LED1_PIN 2 + #define LED1_PIN_INVERSE 1 + + // Channels + #define LIGHT_CH1_PIN 5 // RED + #define LIGHT_CH2_PIN 12 // GREEN + #define LIGHT_CH3_PIN 13 // BLUE + //#define LIGHT_CH4_PIN 13 // WHITE + #define LIGHT_IR_PIN 14 // IR LED ? + + #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 d11f6a7d..ae49193a 100644 --- a/code/espurna/hardware.ino +++ b/code/espurna/hardware.ino @@ -242,6 +242,23 @@ void hwUpwardsCompatibility() { setSetting("chLogic", 4, 0); setSetting("relays", 1); + #elif defined(MAGICHOME_LED_CONTROLLER_IR) + + setSetting("board", 21); + setSetting("relayProvider", RELAY_PROVIDER_LIGHT); + setSetting("lightProvider", LIGHT_PROVIDER_DIMMER); + setSetting("ledGPIO", 1, 2); + setSetting("ledLogic", 1, 1); + setSetting("chGPIO", 1, 5); + setSetting("chGPIO", 2, 12); + setSetting("chGPIO", 3, 13); + setSetting("chGPIO", 4, 14); + setSetting("chLogic", 1, 0); + setSetting("chLogic", 2, 0); + setSetting("chLogic", 3, 0); + setSetting("chLogic", 4, 0); + setSetting("relays", 1); + #elif defined(ITEAD_MOTOR) setSetting("board", 22); diff --git a/code/platformio.ini b/code/platformio.ini index 36607ec8..3704c260 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -703,6 +703,29 @@ upload_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 monitor_baud = 115200 +[env:magichome-led-controller-ir] +platform = espressif8266 +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_IR +monitor_baud = 115200 + +[env:magichome-led-controller-ir-ota] +platform = espressif8266 +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_IR +upload_speed = 115200 +upload_port = "192.168.4.1" +upload_flags = --auth=fibonacci --port 8266 +monitor_baud = 115200 + [env:huacanxing-h801] platform = espressif8266 framework = arduino