File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed
Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -175,22 +175,10 @@ def do_POST(self):
175175 try :
176176 # Handle WiFi networks specially
177177 if key == 'WIFI_NETWORKS' :
178- try :
179- # Parse the value to ensure it's in the correct format
180- if isinstance (value , str ):
181- networks = json .loads (value )
182- else :
183- networks = value
184-
185- # Save networks using the wifi module's function
186- # This already calls settings.set() internally
187- wifi .save_networks (networks )
188-
189- # Update wpa_supplicant configuration using the wifi module
190- wifi .update_wpa_supplicant_config ()
191- wifi .reconfigure_wifi ()
192- except Exception as e :
193- print (f"Error updating WiFi configuration: { e } " )
178+ networks = json .loads (value )
179+ wifi .save_networks (networks )
180+ wifi .update_wpa_supplicant_config ()
181+ wifi .reconfigure_wifi ()
194182 else :
195183 # For all other settings, just use settings.set
196184 settings .set (key , value )
You can’t perform that action at this time.
0 commit comments