Wind speed is given to us in metres per second. convert to kph

This commit is contained in:
jesopo 2019-06-24 07:30:29 +01:00
parent f28195e3ae
commit 2ef85960e9

View file

@ -63,9 +63,11 @@ class Module(ModuleManager.BaseModule):
fahrenheit = "%dF" % ((page.data["main"]["temp"]*(9/5))+32) fahrenheit = "%dF" % ((page.data["main"]["temp"]*(9/5))+32)
description = page.data["weather"][0]["description"].title() description = page.data["weather"][0]["description"].title()
humidity = "%s%%" % page.data["main"]["humidity"] humidity = "%s%%" % page.data["main"]["humidity"]
wind_speed_k = "%sKMh" % page.data["wind"]["speed"]
wind_speed_m = "%sMPh" % round( # wind speed is in metres per second - 3.6* for KMh
0.6214*page.data["wind"]["speed"], 1) wind_speed = 3.6*page.data["wind"]["speed"]
wind_speed_k = "%sKMh" % round(wind_speed, 1)
wind_speed_m = "%sMPh" % round(0.6214*wind_speed, 1)
event["stdout"].write( event["stdout"].write(
"(%s) %s/%s | %s | Humidity: %s | Wind: %s/%s" % ( "(%s) %s/%s | %s | Humidity: %s | Wind: %s/%s" % (