Add UV Index support (one-line format)

This commit is contained in:
Igor Chubin 2022-06-05 20:07:00 +02:00
parent 6242706950
commit 3cbf7a9349
2 changed files with 10 additions and 0 deletions

View File

@ -186,6 +186,7 @@ To specify your own custom output format, use the special `%`-notation:
M Moon day,
p Precipitation (mm/3 hours),
P Pressure (hPa),
u UV index (1-12),
D Dawn*,
S Sunrise*,

View File

@ -167,6 +167,14 @@ def render_pressure(data, query):
answer += 'hPa'
return answer
def render_uv_index(data, query):
"""
UV Index (u)
"""
answer = data.get('uvIndex', '')
return answer
def render_wind(data, query):
"""
wind (w)
@ -284,6 +292,7 @@ FORMAT_SYMBOL = {
'p': render_precipitation,
'o': render_precipitation_chance,
'P': render_pressure,
"u": render_uv_index,
}
FORMAT_SYMBOL_ASTRO = {