diff --git a/ospi.py b/ospi.py
index ea398c1..c2b2dcb 100644
--- a/ospi.py
+++ b/ospi.py
@@ -82,6 +82,25 @@ def CPU_temperature():
except:
pass
+def get_temperature():
+ """Returns the temperature given the stored location info"""
+ import urllib2
+
+ weatherBaseURL = "http://api.openweathermap.org/data/2.5/weather?"
+ weatherFormat = "units=metric&"
+ weatherURL = weatherBaseURL + weatherFormat
+
+ latitude = gv.sd['loc'].split(",")[0]
+ longitude = gv.sd['loc'].split(",")[1]
+
+ queryURL = weatherURL + "lat=" + str(latitude) + "&lon=" + str(longitude)
+ response = urllib2.urlopen(queryURL)
+
+ decoder = json.JSONDecoder()
+ temperature = decoder.decode(response.read())["main"]["temp"]
+
+ return (str(temperature))
+
def log_run():
"""add run data to csv file - most recent first."""
if gv.lg:
@@ -536,6 +555,7 @@ class home:
else:
try:
homepg += '\n'
+ homepg += '\n'
except ValueError:
pass
homepg += ''
diff --git a/static/scripts/java/svc1.8.3/home.js b/static/scripts/java/svc1.8.3/home.js
index 02dcb9f..2ab08cf 100644
--- a/static/scripts/java/svc1.8.3/home.js
+++ b/static/scripts/java/svc1.8.3/home.js
@@ -33,7 +33,8 @@ else w("Firmware version: "+(ver/10>>0)+"."+(ver%10)+"
");
w("Device time: "+datestr(devt*1000)+"
");
if (typeof cputemp === 'undefined') cputemp="";
-w("CPU Temp: "+cputemp+"°"+tempunit+"
"+label+": "); + switch (name) { + case "loc": + w("
"+label+": "); + w(""); + break; + default: + w("
"+label+": "); + } } else { switch (name) { case "tz":