From c5b6120b1856fe1e7c6d0c5a215d977dd5f0f0d7 Mon Sep 17 00:00:00 2001 From: Alfred Egger Date: Mon, 27 May 2019 17:36:04 +0200 Subject: [PATCH] Add humiditiy to forecast data --- lib/Controller/WeatherController.php | 1 + templates/main.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Controller/WeatherController.php b/lib/Controller/WeatherController.php index d907a65..890a2dc 100644 --- a/lib/Controller/WeatherController.php +++ b/lib/Controller/WeatherController.php @@ -105,6 +105,7 @@ class WeatherController extends IntermediateController { 'weather' => $forecast['list'][$i]['weather'][0]['description'], 'temperature' => $forecast['list'][$i]['main']['temp'], 'pressure' => $forecast['list'][$i]['main']['pressure'], + 'humidity' => $forecast['list'][$i]['main']['humidity'], 'wind' => array( 'speed' => $forecast['list'][$i]['wind']['speed'], 'desc' => $this->windDegToString($forecast['list'][$i]['wind']['deg']) diff --git a/templates/main.php b/templates/main.php index 1ef6e51..ab37da5 100644 --- a/templates/main.php +++ b/templates/main.php @@ -67,13 +67,15 @@ t('Temperature')); ?> t('Weather')); ?> t('Pressure')); ?> + t('Humidity')); ?> t('Wind')); ?> {{ forecast.date }} {{ forecast.temperature }}{{ metricRepresentation }} {{ forecast.weather }} - {{ forecast.pressure }} + {{ forecast.pressure }} hpa + {{ forecast.humidity }} % {{ forecast.wind.speed }} m/s - {{ forecast.wind.desc }}