From 2cab1e06d00938cdf7f834c881fcaf394e01a7bd Mon Sep 17 00:00:00 2001 From: Jarno Rankinen Date: Mon, 14 Nov 2022 21:06:58 +0200 Subject: [PATCH] =?UTF-8?q?Fixed=20s=C3=A4=C3=A4.py=20claiming=20to=20fore?= =?UTF-8?q?cast=20stuff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/sää.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/modules/sää.py b/modules/sää.py index fe261c7..19e4884 100644 --- a/modules/sää.py +++ b/modules/sää.py @@ -23,15 +23,21 @@ class MatrixModule(BotModule): elif weather['winddir'] >= 293 and weather['winddir'] < 338: winddir = 'luoteesta' - weathermsg = f"""\ - Lämpötila on tällä hetkellä {weather['tempnow']} astetta. + time = weather['timestamp'].split()[1] - Ilmankosteus on {weather['humidity']}% ja sadetta on odotettavissa - seuraavan tunnin aikana {weather['precipitation1h']}mm - ja tulevan vuorokauden aikana {weather['precipitation1d']}mm. + weathermsg = f"""Sää klo {time}: + + Lämpötila on tällä hetkellä {weather['tempnow']} astetta. + Tulevan vuorokauden alin lämpötila on {weather['templo']} astetta + ja ylin {weather['temphi']} astetta. + + Ilmankosteus on {weather['humidity']}%. - Tuuli puhaltaa {winddir} nopeudella {weather['windspeed']}m/s, voimakkuus - puuskissa on {weather['windspeedmax']}m/s""" + Kuluneen tunnin sademäärä on {weather['precipitation1h']}mm + ja kuluneen vuorokauden {weather['precipitation1d']}mm. + + Tuuli puhaltaa {winddir} nopeudella {weather['windspeed']}m/s + voimakkuus puuskissa on {weather['windspeedmax']}m/s""" await bot.send_text(room, weathermsg, event)