Add humiditiy to forecast data

master
Alfred Egger 2019-05-27 17:36:04 +02:00
parent 4e8c643df1
commit c5b6120b18
2 changed files with 4 additions and 1 deletions

View File

@ -105,6 +105,7 @@ class WeatherController extends IntermediateController {
'weather' => $forecast['list'][$i]['weather'][0]['description'], 'weather' => $forecast['list'][$i]['weather'][0]['description'],
'temperature' => $forecast['list'][$i]['main']['temp'], 'temperature' => $forecast['list'][$i]['main']['temp'],
'pressure' => $forecast['list'][$i]['main']['pressure'], 'pressure' => $forecast['list'][$i]['main']['pressure'],
'humidity' => $forecast['list'][$i]['main']['humidity'],
'wind' => array( 'wind' => array(
'speed' => $forecast['list'][$i]['wind']['speed'], 'speed' => $forecast['list'][$i]['wind']['speed'],
'desc' => $this->windDegToString($forecast['list'][$i]['wind']['deg']) 'desc' => $this->windDegToString($forecast['list'][$i]['wind']['deg'])

View File

@ -67,13 +67,15 @@
<th><?php p($l->t('Temperature')); ?></th> <th><?php p($l->t('Temperature')); ?></th>
<th><?php p($l->t('Weather')); ?></th> <th><?php p($l->t('Weather')); ?></th>
<th><?php p($l->t('Pressure')); ?></th> <th><?php p($l->t('Pressure')); ?></th>
<th><?php p($l->t('Humidity')); ?></th>
<th><?php p($l->t('Wind')); ?></th> <th><?php p($l->t('Wind')); ?></th>
</tr> </tr>
<tr ng-repeat="forecast in currentCity.forecast"> <tr ng-repeat="forecast in currentCity.forecast">
<td>{{ forecast.date }}</td> <td>{{ forecast.date }}</td>
<td>{{ forecast.temperature }}{{ metricRepresentation }}</td> <td>{{ forecast.temperature }}{{ metricRepresentation }}</td>
<td>{{ forecast.weather }}</td> <td>{{ forecast.weather }}</td>
<td>{{ forecast.pressure }}</td> <td>{{ forecast.pressure }} hpa</td>
<td>{{ forecast.humidity }} %</td>
<td>{{ forecast.wind.speed }} m/s - {{ forecast.wind.desc }}</td> <td>{{ forecast.wind.speed }} m/s - {{ forecast.wind.desc }}</td>
</tr> </tr>
</table> </table>