diff options
Diffstat (limited to 'lass/2configs/radio/weather_for_ips.py')
-rw-r--r-- | lass/2configs/radio/weather_for_ips.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lass/2configs/radio/weather_for_ips.py b/lass/2configs/radio/weather_for_ips.py index 8d9a2e7bc..f7cc2dace 100644 --- a/lass/2configs/radio/weather_for_ips.py +++ b/lass/2configs/radio/weather_for_ips.py @@ -21,13 +21,13 @@ for ip in fileinput.input(): f'&units=metric' ) resp = requests.get(url) - weather = json.loads(resp.text)['current'] + weather = json.loads(resp.text) output.append( - f'Weather report for {location.city.name}' - f', {location.country.name}. ' - f'Currently it is {weather["weather"][0]["description"]} outside ' - f'with a temperature of {weather["temp"]} degrees ' - f'and a windspeed of {weather["wind_speed"]} meter per second. ' + f'Weather report for {location.city.name}, {location.country.name}. ' + f'Currently it is {weather["current"]["weather"][0]["description"]} outside ' + f'with a temperature of {weather["current"]["temp"]} degrees, ' + f'and a wind speed of {weather["current"]["wind_speed"]} meters per second. ' + f'The probability of precipitation is {weather["hourly"][0]["pop"] * 100} percent. ' ) print('\n'.join(output)) |