File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -633,8 +633,14 @@ void WLED::initConnection()
633633
634634 if (!WLED_WIFI_CONFIGURED) {
635635 DEBUG_PRINTLN (F (" No connection configured." ));
636- if (!apActive) initAP (); // instantly go to ap mode
637- return ;
636+ if (*clientSSID == ' \0 ' ) {
637+ DEBUG_PRINTLN (F (" But user don't want connection, WIFI_OFF" ));
638+ WiFi.mode (WIFI_OFF);
639+ return ;
640+ } else {
641+ if (!apActive) initAP (); // instantly go to ap mode
642+ return ;
643+ }
638644 } else if (!apActive) {
639645 if (apBehavior == AP_BEHAVIOR_ALWAYS) {
640646 DEBUG_PRINTLN (F (" Access point ALWAYS enabled." ));
@@ -801,12 +807,12 @@ void WLED::handleConnection()
801807 sendImprovStateResponse (0x03 , true );
802808 improvActive = 2 ;
803809 }
804- if (now - lastReconnectAttempt > ((stac) ? 300000 : 18000 ) && WLED_WIFI_CONFIGURED) {
810+ if (now - lastReconnectAttempt > ((stac) ? 300000 : 18000 ) && WLED_WIFI_CONFIGURED && *clientSSID != ' \0 ' ) {
805811 if (improvActive == 2 ) improvActive = 3 ;
806812 DEBUG_PRINTLN (F (" Last reconnect too old." ));
807813 initConnection ();
808814 }
809- if (!apActive && now - lastReconnectAttempt > 12000 && (!wasConnected || apBehavior == AP_BEHAVIOR_NO_CONN)) {
815+ if (!apActive && now - lastReconnectAttempt > 12000 && apBehavior != AP_BEHAVIOR_BUTTON_ONLY && (!wasConnected || apBehavior == AP_BEHAVIOR_NO_CONN)) {
810816 DEBUG_PRINTLN (F (" Not connected AP." ));
811817 initAP ();
812818 }
You can’t perform that action at this time.
0 commit comments