diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index 84c6a198a..4938aec19 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -58,6 +58,7 @@ template_t g_templates [] = { { Setup_Device_BK7231N_TuyaLightBulb_RGBCW_5PWMs, "Tuya E27 LED RGBCW 5PWMs BK7231N"}, { Setup_Device_TuyaSmartPFW02G, "Tuya Smart PFW02-G"}, { Setup_Device_AvatarASL04, "Avatar ASL04 5v LED strip"}, + { Setup_Device_BL602_MagicHome_IR_RGB_LedStrip, "BL602 Magic Home LED RGB IR Strip"}, { Setup_Device_TuyaSmartWIFISwith_4Gang_CB3S, "[BK7231N][CB3S] Tuya Smart Wifi Switch 4 Gang"} }; diff --git a/src/new_builtin_devices.c b/src/new_builtin_devices.c index f2fd2db77..f08ac01fa 100644 --- a/src/new_builtin_devices.c +++ b/src/new_builtin_devices.c @@ -12,6 +12,33 @@ void Setup_Device_Empty() { } +// https://www.elektroda.pl/rtvforum/topic3881416.html +void Setup_Device_BL602_MagicHome_IR_RGB_LedStrip() { + CFG_ClearPins(); + + // red + PIN_SetPinRoleForPinIndex(4, IOR_PWM); + PIN_SetPinChannelForPinIndex(4, 0); + + // green + PIN_SetPinRoleForPinIndex(3, IOR_PWM); + PIN_SetPinChannelForPinIndex(3, 1); + + // blue + PIN_SetPinRoleForPinIndex(21, IOR_PWM); + PIN_SetPinChannelForPinIndex(21, 1); + + // dummy unused channel 4 with place on pcb for transistor + PIN_SetPinRoleForPinIndex(20, IOR_PWM); + PIN_SetPinChannelForPinIndex(20, 3); + + // IR recv + PIN_SetPinRoleForPinIndex(12, IOR_IR_RECV); + PIN_SetPinChannelForPinIndex(12, 0); + + CFG_Save_SetupTimer(); +} + // https://www.elektroda.pl/rtvforum/topic3804553.html // SmartSwitch Tuya WL-SW01_16 16A void Setup_Device_TuyaWL_SW01_16A() { diff --git a/src/new_pins.h b/src/new_pins.h index cba450d74..acae4cfef 100644 --- a/src/new_pins.h +++ b/src/new_pins.h @@ -158,6 +158,7 @@ void Setup_Device_BK7231T_WB2S_QiachipSmartSwitch(); void Setup_Device_BK7231T_Raw_PrimeWiFiSmartOutletsOutdoor_CCWFIO232PK(); void Setup_Device_AvatarASL04(); void Setup_Device_TuyaSmartWIFISwith_4Gang_CB3S(); +void Setup_Device_BL602_MagicHome_IR_RGB_LedStrip(); #endif