From 2d101500ab6afac87d06cb3550332f593c9fd4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Wed, 8 Nov 2017 11:53:44 +0100 Subject: [PATCH] Preliminary support for Arilux E27 light bulb (untested) --- code/espurna/config/hardware.h | 16 ++++++++++++++++ code/espurna/hardware.ino | 9 +++++++++ code/platformio.ini | 23 +++++++++++++++++++++++ 3 files changed, 48 insertions(+) diff --git a/code/espurna/config/hardware.h b/code/espurna/config/hardware.h index 4d7fa57d..51264ecc 100644 --- a/code/espurna/config/hardware.h +++ b/code/espurna/config/hardware.h @@ -1045,6 +1045,22 @@ #define LIGHT_CH4_INVERSE 0 #define LIGHT_CH5_INVERSE 0 + +#elif defined(ARILUX_E27) + + // Info + #define MANUFACTURER "ARILUX" + #define DEVICE "E27" + #define RELAY_PROVIDER RELAY_PROVIDER_LIGHT + #define LIGHT_PROVIDER LIGHT_PROVIDER_MY9192 + #define DUMMY_RELAY_COUNT 1 + + // Channels + #define MY9291_CHANNELS 4 + #define MY9291_DI_PIN 13 + #define MY9291_DCKI_PIN 15 + #define MY9291_COMMAND MY9291_COMMAND_DEFAULT + // ----------------------------------------------------------------------------- // XENON SM-PW701U // ----------------------------------------------------------------------------- diff --git a/code/espurna/hardware.ino b/code/espurna/hardware.ino index 6b21090f..f9c1b04a 100644 --- a/code/espurna/hardware.ino +++ b/code/espurna/hardware.ino @@ -557,6 +557,15 @@ void hwUpwardsCompatibility() { setSetting("relays", 1); setSetting("enGPIO", 15); + #elif defined(ARILUX_E27) + + setSetting("board", 46); + setSetting("relayProvider", RELAY_PROVIDER_LIGHT); + setSetting("lightProvider", LIGHT_PROVIDER_MY9192); + setSetting("myDIGPIO", 13); + setSetting("myDCKIGPIO", 15); + setSetting("relays", 1); + #else #error "UNSUPPORTED HARDWARE!" diff --git a/code/platformio.ini b/code/platformio.ini index 40f68586..1cf2fbd3 100644 --- a/code/platformio.ini +++ b/code/platformio.ini @@ -820,6 +820,29 @@ upload_port = "192.168.4.1" upload_flags = --auth=fibonacci --port 8266 monitor_baud = 115200 +[env:arilux-e27] +platform = ${common.platform} +framework = arduino +board = esp01_1m +board_flash_mode = dout +lib_deps = ${common.lib_deps} +lib_ignore = ${common.lib_ignore} +build_flags = -g -Wl,-Tesp8266.flash.1m0.ld -DARILUX_E27 +monitor_baud = 115200 + +[env:arilux-e27-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 = -g -Wl,-Tesp8266.flash.1m0.ld -DARILUX_E27 +upload_speed = 115200 +upload_port = "192.168.4.1" +upload_flags = --auth=fibonacci --port 8266 +monitor_baud = 115200 + [env:itead-bnsz01] platform = ${common.platform} framework = arduino