Heading format
This commit is contained in:
parent
f1cc271e3b
commit
d768712181
2 changed files with 8 additions and 0 deletions
|
@ -31,6 +31,10 @@ class WeatherColumnDesign (DesignEntity):
|
||||||
temperature = forecast.air_temperature + " " + self.__get_unit__(("°C", "°F"))
|
temperature = forecast.air_temperature + " " + self.__get_unit__(("°C", "°F"))
|
||||||
humidity = forecast.air_humidity + "%"
|
humidity = forecast.air_humidity + "%"
|
||||||
if self.forecast.units== "aviation":
|
if self.forecast.units== "aviation":
|
||||||
|
if len(forecast.wind_deg)==1:
|
||||||
|
forecast.wind_deg = "00" + forecast.wind_deg
|
||||||
|
elif len(forecast.wind_deg)==2:
|
||||||
|
forecast.wind_deg = "0" + forecast.wind_deg
|
||||||
if int(forecast.wind_speed)<10:
|
if int(forecast.wind_speed)<10:
|
||||||
windspeed = forecast.wind_deg + "@" + "0" + forecast.wind_speed + self.__get_unit__(("", "")) #added degrees, if wind<10 add a 0 to make two digit
|
windspeed = forecast.wind_deg + "@" + "0" + forecast.wind_speed + self.__get_unit__(("", "")) #added degrees, if wind<10 add a 0 to make two digit
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -30,6 +30,10 @@ class WeatherHeaderDesign (DesignEntity):
|
||||||
|
|
||||||
temperature = cur_weather.air_temperature + " " + self.__get_unit__(("°C", "°F"))
|
temperature = cur_weather.air_temperature + " " + self.__get_unit__(("°C", "°F"))
|
||||||
if units== "aviation": #pick up aviation
|
if units== "aviation": #pick up aviation
|
||||||
|
if len(forecast.wind_deg)==1: #if deg is 2, add two zeros for format
|
||||||
|
forecast.wind_deg = "00" + forecast.wind_deg
|
||||||
|
elif len(forecast.wind_deg)==2:
|
||||||
|
forecast.wind_deg = "0" + forecast.wind_deg
|
||||||
if int(cur_weather.wind_speed)<10:
|
if int(cur_weather.wind_speed)<10:
|
||||||
windspeed = cur_weather.wind_deg + "@" + "0" + cur_weather.wind_speed + self.__get_unit__(("", "")) #added degrees, if wind<10 add a 0 to make two digit
|
windspeed = cur_weather.wind_deg + "@" + "0" + cur_weather.wind_speed + self.__get_unit__(("", "")) #added degrees, if wind<10 add a 0 to make two digit
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue