Also show windspeed in MPh

This commit is contained in:
jesopo 2019-06-24 07:12:58 +01:00
parent 8adf320e65
commit 0c9dfd5bdb

View file

@ -63,12 +63,14 @@ 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 = "%sKM/h" % page.data["wind"]["speed"] wind_speed_k = "%sKMh" % page.data["wind"]["speed"]
wind_speed_m = "%sMPh" % round(
0.6214*page.data["wind"]["speed"], 1)
event["stdout"].write( event["stdout"].write(
"(%s) %s/%s | %s | Humidity: %s | Wind: %s" % ( "(%s) %s/%s | %s | Humidity: %s | Wind: %s/%s" % (
location_str, celsius, fahrenheit, description, humidity, location_str, celsius, fahrenheit, description, humidity,
wind_speed)) wind_speed_k, wind_speed_m))
else: else:
event["stderr"].write("No weather information for this location") event["stderr"].write("No weather information for this location")
else: else: