From 11dd6d5255d5d144e006659402daefad2fffec36 Mon Sep 17 00:00:00 2001 From: tpoitzsch Date: Thu, 13 Nov 2014 22:24:34 +0000 Subject: [PATCH] openweather: wday git-svn-id: https://svn.fhem.de/fhem/trunk@6966 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/59_OPENWEATHER.pm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/fhem/FHEM/59_OPENWEATHER.pm b/fhem/FHEM/59_OPENWEATHER.pm index cbb086cb0..387959be5 100644 --- a/fhem/FHEM/59_OPENWEATHER.pm +++ b/fhem/FHEM/59_OPENWEATHER.pm @@ -57,6 +57,16 @@ our $time = ""; , post_code => "postcode" ); +sub +get_wday($) +{ + my ($date) = @_; + my @wday_txt = qw(So Mo Di Mi Do Fr Sa); + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime $date; + + return $wday_txt [$wday]; +} + sub text { my ( $self, $text ) = @_; @@ -75,6 +85,10 @@ sub text $fcReadings{"fc".$day."_".$rName.$time} = $text ; } } + elsif ($curTag eq "d" && $time eq "") + { + $fcReadings{"fc".$day."_wday"} = get_wday $text ; + } } sub start @@ -496,6 +510,7 @@ OPENWEATHER_UpdateAborted($)
  • fc0_chOfRain - chance of rain today in %
  • fc0_valHours06 - validity period in hours of the forecast values starting at 06:00 o'clock
  • fc0_weather - weather situation today
  • +
  • fc0_wday - week day of today
  • fc0_wind - wind speed today in km/h
  • fc0_windDir - wind direction today in ° (degree)
  • fc0_windDirTxt - wind direction today in text form
  • @@ -587,6 +602,7 @@ OPENWEATHER_UpdateAborted($)
  • fc0_tempMin06 - Mindesttemperatur heute um 06:00 Uhr in °C
  • fc0_valHours06 - Gültigkeitszeitraum der Prognose von heute ab 6:00 Uhr in Stunden
  • fc0_weather - Wetterzustand heute
  • +
  • fc0_wday - Wochentag von heute
  • fc0_wind - Windgeschwindigkeit heute in km/h
  • fc0_windDir - Windrichtung heute in ° (Grad)
  • fc0_windDirTxt - Windrichtung heute in Textform