mirror of
https://github.com/chubin/wttr.in
synced 2025-01-26 02:34:59 +00:00
Add UV Index support (one-line format)
This commit is contained in:
parent
6242706950
commit
3cbf7a9349
2 changed files with 10 additions and 0 deletions
|
@ -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*,
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Reference in a new issue