display wifi SSID on web server

This commit is contained in:
Justin 2022-03-02 23:13:13 +08:00 committed by GitHub
parent a110be31d2
commit 9cfc38b289
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,6 +108,8 @@ def index():
with open('api_keys.txt', 'r') as f: with open('api_keys.txt', 'r') as f:
api_key2 = f.readlines() api_key2 = f.readlines()
with open('/etc/wpa_supplicant/wpa_supplicant.conf', 'r') as f:
wifiline = f.readlines()
now = datetime.datetime.now() now = datetime.datetime.now()
timeString = now.strftime("%Y-%m-%d %H:%M") timeString = now.strftime("%Y-%m-%d %H:%M")
@ -129,6 +131,7 @@ def index():
message_settings = json.load(open('csv/message_settings.json', 'r')) message_settings = json.load(open('csv/message_settings.json', 'r'))
general_settings = json.load(open('csv/general_settings.json', 'r')) general_settings = json.load(open('csv/general_settings.json', 'r'))
api_keys = api_key2[1] api_keys = api_key2[1]
wifi_SSID = wifiline[5]
templateData = { templateData = {
@ -150,7 +153,8 @@ def index():
'message_settings':message_settings, 'message_settings':message_settings,
'professional':professional, 'professional':professional,
'general_settings':general_settings, 'general_settings':general_settings,
'api_keys':api_keys 'api_keys':api_keys,
'wifi_SSID':wifi_SSID
} }
return render_template('index.html', **templateData) return render_template('index.html', **templateData)