Merge pull request #463 from spywhere/feel-like

lib/view/line.py: add feel like temperature
This commit is contained in:
Igor Chubin 2020-06-05 21:22:04 +02:00 committed by GitHub
commit 949f601263
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -60,6 +60,21 @@ def render_temperature(data, query):
return temperature 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): def render_condition(data, query):
"""Emoji encoded weather condition (c) """Emoji encoded weather condition (c)
""" """
@ -224,6 +239,7 @@ FORMAT_SYMBOL = {
'C': render_condition_fullname, 'C': render_condition_fullname,
'h': render_humidity, 'h': render_humidity,
't': render_temperature, 't': render_temperature,
'f': render_feel_like_temperature,
'w': render_wind, 'w': render_wind,
'l': render_location, 'l': render_location,
'm': render_moonphase, 'm': render_moonphase,