diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index d04205c75..e5121645c 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -60,6 +60,9 @@ template_t g_templates [] = { { Setup_Device_AvatarASL04, "Avatar ASL04 5v LED strip"}, { Setup_Device_BL602_MagicHome_IR_RGB_LedStrip, "BL602 Magic Home LED RGB IR Strip"}, { Setup_Device_WiFi_DIY_Switch_WB2S_ZN268131, "WB2S WiFi DIY Switch ZN268131"}, + { Setup_Device_DS_102_1Gang_WB3S, "DS-102 1 Gang Switch"}, + { Setup_Device_DS_102_2Gang_WB3S, "DS-102 2 Gang Switch"}, + { Setup_Device_DS_102_3Gang_WB3S, "DS-102 3 Gang Switch"}, { Setup_Device_TuyaSmartWIFISwith_4Gang_CB3S, "[BK7231N][CB3S] Tuya Smart Wifi Switch 4 Gang"}, { Setup_Device_BK7231N_CB2S_LSPA9_BL0942, "[BK7231N][CB2S] LSPA9 power metering plug BL0942 version"}, { Setup_Device_LSC_Smart_Connect_Plug_CB2S, "[BK7231N][CB2S] LSC Smart Connect Plug"}, diff --git a/src/new_builtin_devices.c b/src/new_builtin_devices.c index 8550fc8ed..f11a62161 100644 --- a/src/new_builtin_devices.c +++ b/src/new_builtin_devices.c @@ -556,5 +556,73 @@ void Setup_Device_LSC_Smart_Connect_Plug_CB2S(){ } +void Setup_Device_DS_102_1Gang_WB3S(){ + CFG_ClearPins(); + + PIN_SetPinRoleForPinIndex(1, IOR_LED_WIFI); + PIN_SetPinChannelForPinIndex(1, 1); + + PIN_SetPinRoleForPinIndex(6, IOR_Relay); + PIN_SetPinChannelForPinIndex(6, 1); + + PIN_SetPinRoleForPinIndex(10, IOR_Button); + PIN_SetPinChannelForPinIndex(10, 1); + + PIN_SetPinRoleForPinIndex(26, IOR_LED); + PIN_SetPinChannelForPinIndex(26, 1); + + CFG_Save_SetupTimer(); +} +void Setup_Device_DS_102_2Gang_WB3S(){ + Setup_Device_DS_102_1Gang_WB3S(); + + PIN_SetPinRoleForPinIndex(8, IOR_Button); + PIN_SetPinChannelForPinIndex(8, 2); + + PIN_SetPinRoleForPinIndex(9, IOR_Relay); + PIN_SetPinChannelForPinIndex(9, 2); + + PIN_SetPinRoleForPinIndex(11, IOR_LED); + PIN_SetPinChannelForPinIndex(11, 2); + + CFG_Save_SetupTimer(); +} + + +void Setup_Device_DS_102_3Gang_WB3S(){ + CFG_ClearPins(); + + PIN_SetPinRoleForPinIndex(1, IOR_LED_WIFI); + PIN_SetPinChannelForPinIndex(1, 1); + + PIN_SetPinRoleForPinIndex(6, IOR_Relay); + PIN_SetPinChannelForPinIndex(6, 1); + + PIN_SetPinRoleForPinIndex(7, IOR_Relay); + PIN_SetPinChannelForPinIndex(7, 3); + + PIN_SetPinRoleForPinIndex(8, IOR_Button); + PIN_SetPinChannelForPinIndex(8, 3); + + PIN_SetPinRoleForPinIndex(9, IOR_Relay); + PIN_SetPinChannelForPinIndex(9, 2); + + PIN_SetPinRoleForPinIndex(10, IOR_Button); + PIN_SetPinChannelForPinIndex(10, 2); + + PIN_SetPinRoleForPinIndex(11, IOR_LED); + PIN_SetPinChannelForPinIndex(11, 3); + + PIN_SetPinRoleForPinIndex(14, IOR_LED); + PIN_SetPinChannelForPinIndex(14, 1); + + PIN_SetPinRoleForPinIndex(24, IOR_Button); + PIN_SetPinChannelForPinIndex(24, 1); + + PIN_SetPinRoleForPinIndex(26, IOR_LED); + PIN_SetPinChannelForPinIndex(26, 2); + + CFG_Save_SetupTimer(); +}