diff --git a/README.md b/README.md index bae9fae..6723802 100644 --- a/README.md +++ b/README.md @@ -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*, diff --git a/lib/view/line.py b/lib/view/line.py index 7bc81ef..f657246 100644 --- a/lib/view/line.py +++ b/lib/view/line.py @@ -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 = {