mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Updates to support Environment Canada provider
Code updates to support a new weatherobject element called precipitationUnits. For the 'forecast' and 'hourly' UI, the weather module will use this new element if it is not null (i.e. a provider has pushed some value into this object element). If the element is null, then default 'units' processing will still occur. This allows a provider to have a customn unit of measure for precipitation - e.g. Env Canada will use mm for rain and cm for snow.
This commit is contained in:
parent
e31450f731
commit
96db21f9bf
@ -14,15 +14,21 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
<td class="bright weather-icon"><span class="wi weathericon wi-{{ f.weatherType }}"></span></td>
|
<td class="bright weather-icon"><span class="wi weathericon wi-{{ f.weatherType }}"></span></td>
|
||||||
<td class="align-right bright max-temp">
|
<td class="align-right bright max-temp">
|
||||||
{{ f.maxTemperature | roundValue | unit("temperature") | decimalSymbol }}
|
{{ f.maxTemperature | roundValue | unit("temperature") }}
|
||||||
</td>
|
</td>
|
||||||
<td class="align-right min-temp">
|
<td class="align-right min-temp">
|
||||||
{{ f.minTemperature | roundValue | unit("temperature") | decimalSymbol }}
|
{{ f.minTemperature | roundValue | unit("temperature") }}
|
||||||
</td>
|
</td>
|
||||||
{% if config.showPrecipitationAmount %}
|
{% if config.showPrecipitationAmount %}
|
||||||
<td class="align-right bright precipitation">
|
{% if f.precipitationUnits %}
|
||||||
{{ f.precipitation | unit("precip") }}
|
<td class="align-right bright precipitation">
|
||||||
</td>
|
{{ f.precipitation }}{{ f.precipitationUnits }}
|
||||||
|
</td>
|
||||||
|
{% else %}
|
||||||
|
<td class="align-right bright precipitation">
|
||||||
|
{{ f.precipitation | unit("precip") }}
|
||||||
|
</td>
|
||||||
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tr>
|
</tr>
|
||||||
{% set currentStep = currentStep + 1 %}
|
{% set currentStep = currentStep + 1 %}
|
||||||
|
@ -11,6 +11,10 @@
|
|||||||
{{ hour.temperature | roundValue | unit("temperature") }}
|
{{ hour.temperature | roundValue | unit("temperature") }}
|
||||||
</td>
|
</td>
|
||||||
{% if config.showPrecipitationAmount %}
|
{% if config.showPrecipitationAmount %}
|
||||||
|
<td class="align-right bright precipitation">
|
||||||
|
{{ hour.precipitation }}{{ hour.precipitationUnits }}
|
||||||
|
</td>
|
||||||
|
{% else %}
|
||||||
<td class="align-right bright precipitation">
|
<td class="align-right bright precipitation">
|
||||||
{{ hour.precipitation | unit("precip") }}
|
{{ hour.precipitation | unit("precip") }}
|
||||||
</td>
|
</td>
|
||||||
|
@ -28,6 +28,7 @@ class WeatherObject {
|
|||||||
this.rain = null;
|
this.rain = null;
|
||||||
this.snow = null;
|
this.snow = null;
|
||||||
this.precipitation = null;
|
this.precipitation = null;
|
||||||
|
this.precipitationUnits = null;
|
||||||
this.feelsLikeTemp = null;
|
this.feelsLikeTemp = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user