summaryrefslogtreecommitdiffstats
path: root/lass/2configs/radio/weather_for_ips.py
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2022-06-07 00:17:23 +0200
committermakefu <github@syntax-fehler.de>2022-06-07 00:17:23 +0200
commit9c1799914a2e6f2dc736fe2eaad7134602a3d837 (patch)
tree08347f7f29bc00c3b40be2a49e069268c0163716 /lass/2configs/radio/weather_for_ips.py
parent1e405be047a79e1abd0c28e52b5009b9675909b8 (diff)
parentbdc80e55411e197f89990e988f8b7e67c084d3d3 (diff)
Merge remote-tracking branch 'lass/master' into 22.05
Diffstat (limited to 'lass/2configs/radio/weather_for_ips.py')
-rw-r--r--lass/2configs/radio/weather_for_ips.py12
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 8d9a2e7b..f7cc2dac 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))