|
|
|
@ -25,7 +25,7 @@ from astral.sun import sun
|
|
|
|
|
|
|
|
|
|
import pytz
|
|
|
|
|
|
|
|
|
|
from constants import WWO_CODE, WEATHER_SYMBOL, WIND_DIRECTION, WEATHER_SYMBOL_WIDTH_VTE
|
|
|
|
|
from constants import WWO_CODE, WEATHER_SYMBOL, WIND_DIRECTION, WEATHER_SYMBOL_WIDTH_VTE, WEATHER_SYMBOL_PLAIN
|
|
|
|
|
from weather_data import get_weather_data
|
|
|
|
|
from . import v2
|
|
|
|
|
from . import v3
|
|
|
|
@ -106,6 +106,15 @@ def render_condition_fullname(data, query):
|
|
|
|
|
|
|
|
|
|
return weather_condition
|
|
|
|
|
|
|
|
|
|
def render_condition_plain(data, query):
|
|
|
|
|
"""Plain text weather condition (x)
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
weather_condition = WEATHER_SYMBOL_PLAIN[WWO_CODE[data['weatherCode']]]
|
|
|
|
|
spaces = " "*(WEATHER_SYMBOL_WIDTH_VTE.get(weather_condition) - 1)
|
|
|
|
|
|
|
|
|
|
return weather_condition + spaces
|
|
|
|
|
|
|
|
|
|
def render_humidity(data, query):
|
|
|
|
|
"""
|
|
|
|
|
humidity (h)
|
|
|
|
@ -249,6 +258,7 @@ def render_local_timezone(data, query, local_time_of):
|
|
|
|
|
FORMAT_SYMBOL = {
|
|
|
|
|
'c': render_condition,
|
|
|
|
|
'C': render_condition_fullname,
|
|
|
|
|
'x': render_condition_plain,
|
|
|
|
|
'h': render_humidity,
|
|
|
|
|
't': render_temperature,
|
|
|
|
|
'f': render_feel_like_temperature,
|
|
|
|
|