Skip to content

Commit 19dbe13

Browse files
committed
If the OTA password has been set and auth information is known, it will always add the --auth flag into the platformio.ini, if there is not password set, the flag will be removed. If the device has been discover over the mdns service, it will considerate the auth information to set or not the password in the platformio.ini file (and it will ask for a password if it's neccesary)
1 parent b3f2f83 commit 19dbe13

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

libraries/project_check.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -240,19 +240,21 @@ def check_auth_ota(self):
240240
auth = port[2]
241241
break
242242
except:
243-
pass
243+
return
244244

245245
environment = 'env:{0}'.format(self.board_id)
246+
auth_pass = get_setting('auth_pass', None)
246247

247-
if(not auth or auth == 'no'):
248+
if(auth == 'no' or not auth_pass):
248249
if('upload_flags' in config[environment]):
249250
config[environment].pop('upload_flags')
250251
config.write()
251252
return None
252253

253-
auth_pass = get_setting('auth_pass', None)
254-
if(not auth_pass):
254+
255+
if(auth == 'yes' and not auth_pass):
255256
self.window.run_command("deviot_set_password")
257+
save_setting('last_action', 3)
256258
return
257259

258260
flag = {'upload_flags': '--auth={0}'.format(auth_pass)}

0 commit comments

Comments
 (0)