summaryrefslogtreecommitdiff
path: root/widgets/weather
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-16 15:05:20 +0100
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-11-16 15:05:20 +0100
commita43f1eeda472fc41b6f64f37f1a11749b6dac75c (patch)
tree94bf6dff8ebc1a214d642de60f8bad35cf7f6900 /widgets/weather
parentefdb12a81dd96d913651b8b2bd5bbcbd8b135cbb (diff)
downloadskin-flatplus-a43f1eeda472fc41b6f64f37f1a11749b6dac75c.tar.gz
skin-flatplus-a43f1eeda472fc41b6f64f37f1a11749b6dac75c.tar.bz2
add weather widget in displaychannel displayreplay
Diffstat (limited to 'widgets/weather')
-rw-r--r--widgets/weather/update_weather.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/widgets/weather/update_weather.php b/widgets/weather/update_weather.php
index d2d38c1e..800f3f7b 100644
--- a/widgets/weather/update_weather.php
+++ b/widgets/weather/update_weather.php
@@ -18,6 +18,17 @@ array_map('unlink', glob("weather.*"));
// forecast query
$forecast = new ForecastIO($api_key);
+$condition = $forecast->getCurrentConditions($latitude, $longitude, $units, $lang);
+if( !$handle = fopen("weather.0.temp", "w") ) {
+ print "can't create file!\n";
+ continue;
+}
+$temp = round($condition->getTemperature(), 1);
+fwrite($handle, $temp);
+fwrite($handle, $degree_sign);
+fclose($handle);
+
+
// get daily conditions for next 7 days
$conditions_week = $forecast->getForecastWeek($latitude, $longitude, $units, $lang);
@@ -40,17 +51,6 @@ foreach($conditions_week as $conditions) {
fwrite($handle, $conditions->getSummary());
fclose($handle);
-/*
- if( !$handle = fopen("weather.".$index.".temp", "w") ) {
- print "can't create file!\n";
- continue;
- }
- // we only have min & max so we must calc
- $temp = round(($conditions->getMinTemperature() + $conditions->getMaxTemperature()) / 2.0, 1);
- fwrite($handle, $temp);
- fwrite($handle, $degree_sign);
- fclose($handle);
- */
if( !$handle = fopen("weather.".$index.".tempMin", "w") ) {
print "can't create file!\n";
continue;