mirror of
https://github.com/chubin/wttr.in
synced 2024-11-15 00:27:09 +00:00
Merge pull request #463 from spywhere/feel-like
lib/view/line.py: add feel like temperature
This commit is contained in:
commit
949f601263
1 changed files with 16 additions and 0 deletions
|
@ -60,6 +60,21 @@ def render_temperature(data, query):
|
|||
|
||||
return temperature
|
||||
|
||||
def render_feel_like_temperature(data, query):
|
||||
"""
|
||||
feel like temperature (f)
|
||||
"""
|
||||
|
||||
if query.get('use_imperial', False):
|
||||
temperature = u'%s°F' % data['FeelsLikeF']
|
||||
else:
|
||||
temperature = u'%s°C' % data['FeelsLikeC']
|
||||
|
||||
if temperature[0] != '-':
|
||||
temperature = '+' + temperature
|
||||
|
||||
return temperature
|
||||
|
||||
def render_condition(data, query):
|
||||
"""Emoji encoded weather condition (c)
|
||||
"""
|
||||
|
@ -224,6 +239,7 @@ FORMAT_SYMBOL = {
|
|||
'C': render_condition_fullname,
|
||||
'h': render_humidity,
|
||||
't': render_temperature,
|
||||
'f': render_feel_like_temperature,
|
||||
'w': render_wind,
|
||||
'l': render_location,
|
||||
'm': render_moonphase,
|
||||
|
|
Loading…
Reference in a new issue