pressure (P) and precipitation (p) (fixes #293)

pull/295/head
Igor Chubin 6 years ago
parent 83b1fd45f2
commit 9a72e04ec7

@ -149,6 +149,8 @@ To specify your own custom output format, use the special `%`-notation:
l Location,
m Moonphase 🌑🌒🌓🌔🌕🌖🌗🌘,
M Moonday,
p precipitation (mm),
P pressure (hPa),
```
So, these two calls are the same:

@ -89,6 +89,26 @@ def render_humidity(data, query):
humidity += '%'
return humidity
def render_precipitation(data, query):
"""
precipitation (p)
"""
answer = data.get('precipMM', '')
if answer:
answer += 'mm'
return answer
def render_pressure(data, query):
"""
pressure (P)
"""
answer = data.get('pressure', '')
if answer:
answer += 'hPa'
return answer
def render_wind(data, query):
"""
wind (w)
@ -166,6 +186,8 @@ FORMAT_SYMBOL = {
'm': render_moonphase,
'M': render_moonday,
's': render_sunset,
'p': render_precipitation,
'P': render_pressure,
}
def render_line(line, data, query):

Loading…
Cancel
Save