Przeglądaj źródła

esp_prov: prompt for passphrase if not given

Cody Cutrer 3 lat temu
rodzic
commit
0a892d2818
1 zmienionych plików z 3 dodań i 1 usunięć
  1. 3 1
      tools/esp_prov/esp_prov.py

+ 3 - 1
tools/esp_prov/esp_prov.py

@@ -365,7 +365,7 @@ async def main():
                             'If Wi-Fi scanning is supported by the provisioning service, this need not '
                             'If Wi-Fi scanning is supported by the provisioning service, this need not '
                             'be specified'))
                             'be specified'))
 
 
-    parser.add_argument('--passphrase', dest='passphrase', type=str, default='',
+    parser.add_argument('--passphrase', dest='passphrase', type=str,
                         help=desc_format(
                         help=desc_format(
                             'This configures the device to use Passphrase for the Wi-Fi network to which '
                             'This configures the device to use Passphrase for the Wi-Fi network to which '
                             'we would like it to connect to permanently, once provisioning is complete. '
                             'we would like it to connect to permanently, once provisioning is complete. '
@@ -480,6 +480,8 @@ async def main():
                     break
                     break
 
 
             args.ssid = APs[select - 1]['ssid']
             args.ssid = APs[select - 1]['ssid']
+
+        if args.passphrase is None:
             prompt_str = 'Enter passphrase for {0} : '.format(args.ssid)
             prompt_str = 'Enter passphrase for {0} : '.format(args.ssid)
             args.passphrase = getpass(prompt_str)
             args.passphrase = getpass(prompt_str)