mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-24 14:05:12 +00:00
added OpenWeatherMap One Call API function to default Weather module, added wDataHourly type
This commit is contained in:
29
modules/default/weather/wdataHourly.njk
Normal file
29
modules/default/weather/wdataHourly.njk
Normal file
@@ -0,0 +1,29 @@
|
||||
{% if wData %}
|
||||
{% set numSteps = wData.hours | calcNumEntries %}
|
||||
{% set currentStep = 0 %}
|
||||
<table class="{{ config.tableClass }}">
|
||||
{% set hours = wData.hours.slice(0, numSteps) %}
|
||||
{% for hour in hours %}
|
||||
<tr {% if config.colored %}class="colored"{% endif %} {% if config.fade %}style="opacity: {{ currentStep | opacity(numSteps) }};"{% endif %}>
|
||||
<td class="time">{{ hour.date | formatTimeMoment }}</td>
|
||||
<td class="bright weather-icon"><span class="wi weathericon wi-{{ hour.weatherType }}"></span></td>
|
||||
<td class="align-right bright max-temp">
|
||||
{{ hour.temperature | roundValue | unit("temperature") }}
|
||||
</td>
|
||||
{% if config.showPrecipitationAmount %}
|
||||
<td class="align-right bright precipitation">
|
||||
{{ hour.precipitation | unit("precip") }}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% set currentStep = currentStep + 1 %}
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="dimmed light small">
|
||||
{{ "LOADING" | translate | safe }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Uncomment the line below to see the contents of the `wData` object. -->
|
||||
<!-- <div style="word-wrap:break-word" class="xsmall dimmed">{{wData | dump}}</div> -->
|
Reference in New Issue
Block a user