diff --git a/src/httpserver/http_fns.c b/src/httpserver/http_fns.c index f7b9ee160..407295195 100644 --- a/src/httpserver/http_fns.c +++ b/src/httpserver/http_fns.c @@ -66,6 +66,7 @@ template_t g_templates [] = { { 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"}, + { Setup_Device_BK7231T_Gosund_Switch_SW5_A_V2_1, "BK7231T Gosund Smart Switch SW5-A-V2.1"}, }; 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 e840d8130..676138c13 100644 --- a/src/new_builtin_devices.c +++ b/src/new_builtin_devices.c @@ -574,6 +574,28 @@ void Setup_Device_DS_102_1Gang_WB3S(){ CFG_Save_SetupTimer(); } +// see https://www.elektroda.com/rtvforum/viewtopic.php?p=20008969#20008969 + +void Setup_Device_BK7231T_Gosund_Switch_SW5_A_V2_1(){ + CFG_ClearPins(); + + // green + PIN_SetPinRoleForPinIndex(7, IOR_LED_WIFI); + PIN_SetPinChannelForPinIndex(7, 1); + + PIN_SetPinRoleForPinIndex(14, IOR_Relay); + PIN_SetPinChannelForPinIndex(14, 1); + + PIN_SetPinRoleForPinIndex(8, IOR_Button); + PIN_SetPinChannelForPinIndex(8, 1); + + // red + PIN_SetPinRoleForPinIndex(16, IOR_LED_n); + PIN_SetPinChannelForPinIndex(16, 1); + + + CFG_Save_SetupTimer(); +} void Setup_Device_DS_102_2Gang_WB3S(){ CFG_ClearPins(); diff --git a/src/new_pins.h b/src/new_pins.h index cef72593b..5fecdd257 100644 --- a/src/new_pins.h +++ b/src/new_pins.h @@ -181,6 +181,7 @@ void Setup_Device_LSC_Smart_Connect_Plug_CB2S(); void Setup_Device_DS_102_1Gang_WB3S(); void Setup_Device_DS_102_2Gang_WB3S(); void Setup_Device_DS_102_3Gang_WB3S(); +void Setup_Device_BK7231T_Gosund_Switch_SW5_A_V2_1(); #endif