diff --git a/src/httpserver/new_http.c b/src/httpserver/new_http.c index 3f17ae95b..f46fcf588 100644 --- a/src/httpserver/new_http.c +++ b/src/httpserver/new_http.c @@ -249,7 +249,8 @@ template_t g_templates [] = { { Setup_Device_TuyaSmartLife4CH10A, "Smart Life 4CH 10A"}, { 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_CalexLEDDimmerFiveChannel, "Calex RGBWW LED Dimmer Five Channel PWM BK7231S"}, + { Setup_Device_CalexPowerStrip_900018_1v1_0UK, "Calex UK power strip 900018.1 v1.0 UK"} }; 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 72e3828f4..e33decec3 100644 --- a/src/new_builtin_devices.c +++ b/src/new_builtin_devices.c @@ -111,4 +111,41 @@ void Setup_Device_CalexLEDDimmerFiveChannel() { PIN_SaveToFlash(); } +void Setup_Device_CalexPowerStrip_900018_1v1_0UK() { + + // pins are: + // red - PWM2 = P7 + // green - PWM3 = P8 + // blue - PWM1 = P6 + // warm white - PWM5 = P26 + // cold white - PWM4 = P24 + + PIN_ClearPins(); + + // relays - 4 sockets + 1 USB + PIN_SetPinChannelForPinIndex(6, 5); + PIN_SetPinRoleForPinIndex(6, IOR_Relay); + PIN_SetPinChannelForPinIndex(7, 2); + PIN_SetPinRoleForPinIndex(7, IOR_Relay); + PIN_SetPinChannelForPinIndex(8, 3); + PIN_SetPinRoleForPinIndex(8, IOR_Relay); + PIN_SetPinChannelForPinIndex(9, 1); + PIN_SetPinRoleForPinIndex(9, IOR_Relay); + PIN_SetPinChannelForPinIndex(26, 4); + PIN_SetPinRoleForPinIndex(26, IOR_Relay); + + // button + PIN_SetPinChannelForPinIndex(14, 1); + PIN_SetPinRoleForPinIndex(14, IOR_Button); + + // 2 x LEDs + // wifi stat + PIN_SetPinChannelForPinIndex(10, 1); + PIN_SetPinRoleForPinIndex(10, IOR_LED); + // power stat + PIN_SetPinChannelForPinIndex(24, 2); + PIN_SetPinRoleForPinIndex(24, IOR_LED); + + PIN_SaveToFlash(); +} diff --git a/src/new_pins.h b/src/new_pins.h index 693ae5370..bc8f76f9c 100644 --- a/src/new_pins.h +++ b/src/new_pins.h @@ -35,12 +35,15 @@ void CHANNEL_Set(int ch, int iVal, int bForce); int CHANNEL_Get(int ch); void PIN_SaveToFlash(); void PIN_LoadFromFlash(); + +// from new_builtin.c void Setup_Device_Empty(); void Setup_Device_TuyaWL_SW01_16A(); void Setup_Device_TuyaSmartLife4CH10A(); void Setup_Device_IntelligentLife_NF101A(); void Setup_Device_TuyaLEDDimmerSingleChannel(); void Setup_Device_CalexLEDDimmerFiveChannel(); +void Setup_Device_CalexPowerStrip_900018_1v1_0UK(); #endif