From d6f25af7394f11fc2b5183c09b645f68eda244fe Mon Sep 17 00:00:00 2001 From: TilCreator Date: Mon, 28 May 2018 19:44:15 +0200 Subject: [PATCH 1/3] Add option to disable automatic connecting to open Wifis --- wifimgr.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wifimgr.py b/wifimgr.py index 387866c..03381d4 100644 --- a/wifimgr.py +++ b/wifimgr.py @@ -6,6 +6,7 @@ ap_ssid = "WifiManager" ap_password = "tayfunulu" ap_authmode = 3 # WPA2 +connectToOpenWifis = False NETWORK_PROFILES = 'wifi.dat' @@ -48,7 +49,8 @@ def get_connection(): else: print("skipping unknown encrypted network") else: # open - connected = do_connect(ssid, None) + if connectToOpenWifis: + connected = do_connect(ssid, None) if connected: break From b7a8665d5643341cfa9686f6375ce374382aa1c5 Mon Sep 17 00:00:00 2001 From: TilCreator Date: Wed, 30 May 2018 13:48:20 +0200 Subject: [PATCH 2/3] Change var naming style to match code --- wifimgr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wifimgr.py b/wifimgr.py index 03381d4..4ee6931 100644 --- a/wifimgr.py +++ b/wifimgr.py @@ -6,7 +6,7 @@ ap_ssid = "WifiManager" ap_password = "tayfunulu" ap_authmode = 3 # WPA2 -connectToOpenWifis = False +connect_to_open_wifis = False NETWORK_PROFILES = 'wifi.dat' @@ -49,7 +49,7 @@ def get_connection(): else: print("skipping unknown encrypted network") else: # open - if connectToOpenWifis: + if connect_to_open_wifis: connected = do_connect(ssid, None) if connected: break From 05f44e8e6c7dcd5e2ecc92ccce1207ed0a4bac5d Mon Sep 17 00:00:00 2001 From: TilCreator Date: Wed, 30 May 2018 13:49:16 +0200 Subject: [PATCH 3/3] Merge else and if into elif --- wifimgr.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wifimgr.py b/wifimgr.py index 4ee6931..4615e87 100644 --- a/wifimgr.py +++ b/wifimgr.py @@ -48,8 +48,7 @@ def get_connection(): connected = do_connect(ssid, password) else: print("skipping unknown encrypted network") - else: # open - if connect_to_open_wifis: + elif connect_to_open_wifis: connected = do_connect(ssid, None) if connected: break