Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2022-03-03 17:58:21 +01:00
parent f984d25f6a
commit 81b035d6e8
6 changed files with 30 additions and 52 deletions

View File

@@ -70,7 +70,7 @@ def get_metar_data(airportcode, unixtime):
lengte = len(doc.xpath('data/METAR/station_id'))
idnr = int(lengte/2)
try:
id = doc.xpath('data/METAR/station_id')[idnr].text
_ = doc.xpath('data/METAR/station_id')[idnr].text
temp_c = doc.xpath('data/METAR/temp_c')[idnr].text
wind_dir = doc.xpath('data/METAR/wind_dir_degrees')[idnr].text
wind_speed = doc.xpath('data/METAR/wind_speed_kt')[idnr].text
@@ -138,7 +138,7 @@ def get_wind_data(lat, long, unixtime):
windbearing = 0
summary = 'unknown'
airports = ['unknown']
temparature = 'unknown'
temperature = 'unknown'
temperaturec = 'unknown'
message = 'Not able to get weather data'