Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magichome led rgb #1726

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/espurna/config/arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
//#define LUANI_HVIO
//#define LYASI_LIGHT
//#define MAGICHOME_LED_CONTROLLER
//#defire MAGICHOME_LED_CONTROLLER_RGB
//#define MAGICHOME_LED_CONTROLLER_20
//#define MAGICHOME_ZJ_WFMN_A_11
//#define MAGICHOME_ZJ_WFMN_B_11
Expand Down
21 changes: 21 additions & 0 deletions code/espurna/config/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,27 @@
#define IR_RX_PIN 4
#define IR_BUTTON_SET 1

#elif defined(MAGICHOME_LED_CONTROLLER_RGB)
// Info
#define MANUFACTURER "MAGICHOME"
#define DEVICE "LED_CONTROLLER_RGB"
#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

// Light
#define LIGHT_CHANNELS 3
#define LIGHT_CH1_PIN 5 // RED
#define LIGHT_CH2_PIN 12 // GREEN
#define LIGHT_CH3_PIN 13 // BLUE
#define LIGHT_CH1_INVERSE 0
#define LIGHT_CH2_INVERSE 0
#define LIGHT_CH3_INVERSE 0

#elif defined(MAGICHOME_LED_CONTROLLER_20)

// Info
Expand Down
15 changes: 15 additions & 0 deletions code/espurna/migrate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,21 @@ void migrate() {
setSetting("chLogic", 3, 0);
setSetting("relays", 1);

#elif defined(MAGICHOME_LED_CONTROLLER_RGB)

setSetting("board", 21);
setSetting("relayProvider", RELAY_PROVIDER_LIGHT);
setSetting("lightProvider", LIGHT_PROVIDER_DIMMER);
setSetting("ledGPIO", 0, 2);
setSetting("ledLogic", 0, 1);
setSetting("chGPIO", 0, 14);
setSetting("chGPIO", 1, 5);
setSetting("chGPIO", 2, 12);
setSetting("chLogic", 0, 0);
setSetting("chLogic", 1, 0);
setSetting("chLogic", 2, 0);
setSetting("relays", 1);

#elif defined(MAGICHOME_LED_CONTROLLER_IR)

setSetting("board", 21);
Expand Down
26 changes: 26 additions & 0 deletions code/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,32 @@ upload_flags = ${common.upload_flags}
monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts}

[env:magichome-led-controller-rgb]
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} -DMAGICHOME_LED_CONTROLLER_RGB
monitor_speed = ${common.monitor_speed}
extra_scripts = ${common.extra_scripts}

[env:magichome-led-controller-rgb-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} -DMAGICHOME_LED_CONTROLLER_RGB
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:magichome-led-controller-20]
platform = ${common.platform}
framework = ${common.framework}
Expand Down