File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -173,8 +173,7 @@ def do_POST(self):
173173 continue
174174
175175 try :
176- settings .set (key , value )
177- # If we're updating WiFi networks, save networks and update the wpa_supplicant.conf file
176+ # Handle WiFi networks specially
178177 if key == 'WIFI_NETWORKS' :
179178 try :
180179 # Parse the value to ensure it's in the correct format
@@ -184,13 +183,17 @@ def do_POST(self):
184183 networks = value
185184
186185 # Save networks using the wifi module's function
186+ # This already calls settings.set() internally
187187 wifi .save_networks (networks )
188188
189189 # Update wpa_supplicant configuration using the wifi module
190190 wifi .update_wpa_supplicant_config ()
191191 wifi .reconfigure_wifi ()
192192 except Exception as e :
193193 print (f"Error updating WiFi configuration: { e } " )
194+ else :
195+ # For all other settings, just use settings.set
196+ settings .set (key , value )
194197 except Exception as e :
195198 print (f"Error setting { key } : { e } " )
196199
You can’t perform that action at this time.
0 commit comments