summaryrefslogtreecommitdiff
path: root/weather.py
diff options
context:
space:
mode:
authorroot <root@turin.home>2022-01-30 15:16:19 +0000
committerroot <root@turin.home>2022-01-30 15:16:19 +0000
commitbcaa188e4a1212f5fdd174b2cf65fca7a35250f9 (patch)
tree54e47438692dfd7120dc452a3f9e3ca8abad184b /weather.py
parente866cc7fe978f7589f37ec91040c053db3eb0d87 (diff)
Minor errors
Diffstat (limited to 'weather.py')
-rw-r--r--weather.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/weather.py b/weather.py
index c7276fe..cc21022 100644
--- a/weather.py
+++ b/weather.py
@@ -37,13 +37,15 @@ class weather_met_no(weather):
self.HEADERS = {"User-Agent": "TopologicalMap"}
super.init(self)
- def get_temperature(self):
+ def get_temp(self):
# https://docs.python-requests.org/en/latest/
try:
data = requests.get(
self.CALL, headers=self.HEADERS
).json()["properties"]["timeseries"][0]["data"]
- return data["instant"]["details"]["air_temperature"]
+ self.temp = data["instant"]["details"]["air_temperature"]
# data['next_1_hours']['summary']['symbol_code']
+ return 0
except:
return -1
+