From d1e6fc62031e97d3dad26a77ebd7c064e9f218b9 Mon Sep 17 00:00:00 2001 From: TallTechDude Date: Mon, 7 Feb 2022 11:45:39 +0000 Subject: [PATCH] feat: add quick config for CCT Downlight --- src/httpserver/new_http.c | 3 ++- src/new_builtin_devices.c | 19 +++++++++++++++++++ src/new_pins.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/httpserver/new_http.c b/src/httpserver/new_http.c index c1c378141..372b00b95 100644 --- a/src/httpserver/new_http.c +++ b/src/httpserver/new_http.c @@ -259,7 +259,8 @@ template_t g_templates [] = { { Setup_Device_IntelligentLife_NF101A, "Intelligent Life NF101A"}, { Setup_Device_TuyaLEDDimmerSingleChannel, "Tuya LED Dimmer Single Channel PWM WB3S"}, { Setup_Device_CalexLEDDimmerFiveChannel, "Calex RGBWW LED Dimmer Five Channel PWM BK7231S"}, - { Setup_Device_CalexPowerStrip_900018_1v1_0UK, "Calex UK power strip 900018.1 v1.0 UK"} + { Setup_Device_CalexPowerStrip_900018_1v1_0UK, "Calex UK power strip 900018.1 v1.0 UK"}, + { Setup_Device_ArlecCCTDownlight, "Arlec CCT LED Downlight ALD029CHA"} }; int g_total_templates = sizeof(g_templates)/sizeof(g_templates[0]); diff --git a/src/new_builtin_devices.c b/src/new_builtin_devices.c index e33decec3..e948c76f0 100644 --- a/src/new_builtin_devices.c +++ b/src/new_builtin_devices.c @@ -149,3 +149,22 @@ void Setup_Device_CalexPowerStrip_900018_1v1_0UK() { PIN_SaveToFlash(); } +// https://www.bunnings.com.au/arlec-grid-connect-smart-9w-cct-led-downlight_p0168694 +void Setup_Device_ArlecCCTDownlight() { + + // WB3L + // pins are: + // cold white - PWM1 = P6 + // warm white - PWM2 = P24 + + PIN_ClearPins(); + + // cold white + PIN_SetPinChannelForPinIndex(6, 1); + PIN_SetPinRoleForPinIndex(6, IOR_PWM); + // warm white + PIN_SetPinChannelForPinIndex(24, 2); + PIN_SetPinRoleForPinIndex(24, IOR_PWM); + + PIN_SaveToFlash(); +} diff --git a/src/new_pins.h b/src/new_pins.h index 5670298b4..0d54a36ad 100644 --- a/src/new_pins.h +++ b/src/new_pins.h @@ -47,6 +47,7 @@ void Setup_Device_IntelligentLife_NF101A(); void Setup_Device_TuyaLEDDimmerSingleChannel(); void Setup_Device_CalexLEDDimmerFiveChannel(); void Setup_Device_CalexPowerStrip_900018_1v1_0UK(); +void Setup_Device_ArlecCCTDownlight(); #endif