Add additional weather information provided by OpenWeatherMap API

master
Alfred Egger 2020-04-12 03:40:46 +02:00
parent a60bd3e9a0
commit 58e0f06cf2
3 changed files with 26 additions and 6 deletions

View File

@ -88,7 +88,9 @@
#city-right .city-current-pressure, #city-right .city-current-wind,
#city-right .city-current-humidity, #city-right .city-current-weather,
#city-right .city-current-sunrise, #city-right .city-current-sunset {
#city-right .city-current-sunrise, #city-right .city-current-sunset,
#city-right .city-current-temp_feelslike, #city-right .city-current-temp_min,
#city-right .city-current-temp_max {
font-size: 2em;
line-height: 1em;
}
@ -171,7 +173,9 @@
#city-right .city-current-pressure, #city-right .city-current-wind,
#city-right .city-current-weather, #city-right .city-current-humidity,
#city-right .city-current-sunrise, #city-right .city-current-sunset {
#city-right .city-current-sunrise, #city-right .city-current-sunset,
#city-right .city-current-temp_feelslike, #city-right .city-current-temp_min,
#city-right .city-current-temp_max {
font-size: 3em;
}
#city-forecast-panel {
@ -190,7 +194,9 @@
#city-right .city-current-pressure, #city-right .city-current-wind,
#city-right .city-current-weather, #city-right .city-current-humidity,
#city-right .city-current-sunrise, #city-right .city-current-sunset {
#city-right .city-current-sunrise, #city-right .city-current-sunset,
#city-right .city-current-temp_feelslike, #city-right .city-current-temp_min,
#city-right .city-current-temp_max {
font-size: 2.2em;
}
#city-forecast-panel {
@ -214,7 +220,9 @@
#city-right .city-current-pressure, #city-right .city-current-wind,
#city-right .city-current-weather, #city-right .city-current-humidity,
#city-right .city-current-sunrise, #city-right .city-current-sunset {
#city-right .city-current-sunrise, #city-right .city-current-sunset,
#city-right .city-current-temp_feelslike, #city-right .city-current-temp_min,
#city-right .city-current-temp_max {
font-size: 1.6em;
}
}

View File

@ -104,6 +104,9 @@ class WeatherController extends IntermediateController {
'date' => $this->UnixTimeToString($forecast['list'][$i]['dt']),
'weather' => $forecast['list'][$i]['weather'][0]['description'],
'temperature' => $forecast['list'][$i]['main']['temp'],
'temperature_feelslike' => $forecast['list'][$i]['main']['feels_like'],
'temperature_min' => $forecast['list'][$i]['main']['temp_min'],
'temperature_max' => $forecast['list'][$i]['main']['temp_max'],
'pressure' => $forecast['list'][$i]['main']['pressure'],
'humidity' => $forecast['list'][$i]['main']['humidity'],
'wind' => array(

View File

@ -53,7 +53,10 @@
<img ng-show="selectedCityId == homeCity" src="{{ owncloudAppImgPath }}home-pick.png" />
<img class="home-icon" ng-click="setHome(selectedCityId);" ng-show="selectedCityId != homeCity" src="{{ owncloudAppImgPath }}home-nopick.png" />
</div>
<div class="city-current-temp">{{ currentCity.main.temp }}{{ metricRepresentation }}</div>
<div class="city-current-temp"><?php p($l->t('Current Temperature')); ?>; {{ currentCity.main.temp }}{{ metricRepresentation }}</div>
<div class="city-current-temp_feelslike"><?php p($l->t('Apparent Temperature')); ?>; {{ currentCity.main.feels_like }}{{ metricRepresentation }}</div>
<div class="city-current-temp_min"><?php p($l->t('Minimum Temperature')); ?>; {{ currentCity.main.temp_min }}{{ metricRepresentation }}</div>
<div class="city-current-temp_max"><?php p($l->t('Maximum Temperature')); ?>; {{ currentCity.main.temp_max }}{{ metricRepresentation }}</div>
<div class="city-current-pressure"><?php p($l->t('Pressure')); ?>: {{ currentCity.main.pressure }} hpa</div>
<div class="city-current-humidity"><?php p($l->t('Humidity')); ?>: {{ currentCity.main.humidity}}%</div>
<div class="city-current-weather"><?php p($l->t('Cloudiness')); ?>: {{ currentCity.weather[0].description }}</div>
@ -65,7 +68,10 @@
<table>
<tr>
<th><?php p($l->t('Date')); ?></th>
<th><?php p($l->t('Temperature')); ?></th>
<th><?php p($l->t('Current Temperature')); ?></th>
<th><?php p($l->t('Apparent Temperature')); ?></th>
<th><?php p($l->t('Minimum Temperature')); ?></th>
<th><?php p($l->t('Maximum Temperature')); ?></th>
<th><?php p($l->t('Weather')); ?></th>
<th><?php p($l->t('Pressure')); ?></th>
<th><?php p($l->t('Humidity')); ?></th>
@ -74,6 +80,9 @@
<tr ng-repeat="forecast in currentCity.forecast">
<td>{{ forecast.date }}</td>
<td>{{ forecast.temperature }}{{ metricRepresentation }}</td>
<td>{{ forecast.temperature_feelslike }}{{ metricRepresentation }}</td>
<td>{{ forecast.temperature_min }}{{ metricRepresentation }}</td>
<td>{{ forecast.temperature_max }}{{ metricRepresentation }}</td>
<td>{{ forecast.weather }}</td>
<td>{{ forecast.pressure }} hpa</td>
<td>{{ forecast.humidity }} %</td>