Skip to content
Snippets Groups Projects
Commit a1e5bec4 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

SevenDaysForecastTile: improve icon data access

parent 06d5df99
No related branches found
No related tags found
No related merge requests found
......@@ -37,7 +37,7 @@
<div class="chart" id="{{ chartId }}"></div>
<div class="icons">
{% for icon in icons %}
<i class="wi wi-owm-{{ icon[0] }} icon {% if not icon[2] %}weekend{% endif %} " style="color: {{ icon[1] }};"></i>
<i class="wi wi-owm-{{ icon['icon'] }} icon {% if not icon['isWeekDay'] %}weekend{% endif %} " style="color: {{ icon['iconColor'] }};"></i>
{% endfor %}
</div>
</div>
......
......@@ -41,7 +41,9 @@ class SevenDaysForecastTile(Tile):
icon = day['weather'][0]['id']
iconColor = Helpers.determine_color_for_weather_icon(icon, True)
isWeekDay = date.weekday() < 5
icons.append((icon, iconColor, isWeekDay))
icons.append({'icon': icon,
'iconColor': iconColor,
'isWeekDay': isWeekDay})
forecastData[formattedDate] = (int(day['temp']['min']), int(day['temp']['max']))
minValues = [x[0] for x in forecastData.values()]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment