From 53de545c0eeadf2e4fdb02b70fad28f043434f4e Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 9 Jun 2012 13:46:51 +0000 Subject: [PATCH] BugFix for Sommer values. git-svn-id: https://svn.fhem.de/fhem/trunk@1609 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/59_Twilight.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/59_Twilight.pm b/fhem/FHEM/59_Twilight.pm index e83301299..dac6b67ef 100644 --- a/fhem/FHEM/59_Twilight.pm +++ b/fhem/FHEM/59_Twilight.pm @@ -191,15 +191,20 @@ sub Twilight_GetUpdate{ for(my $i=0;$i<6;$i++){ ($sunrise_set[$i]{RISE},$sunrise_set[$i]{SET})= twilight_calc($latitude,$longitude,$sunrise_set[$i]{DEGREE},$declination,$timezone,$midseconds,$timediff); - readingsUpdate($hash,$sunrise_set[$i]{SR_NAME},strftime("%H:%M:%S",localtime($sunrise_set[$i]{RISE}))); - readingsUpdate($hash,$sunrise_set[$i]{SS_NAME},strftime("%H:%M:%S",localtime($sunrise_set[$i]{SET}))); - } + readingsUpdate($hash, $sunrise_set[$i]{SR_NAME}, + $sunrise_set[$i]{RISE} eq "nan" ? "undefined" : + strftime("%H:%M:%S",localtime($sunrise_set[$i]{RISE}))); + readingsUpdate($hash, $sunrise_set[$i]{SS_NAME}, + $sunrise_set[$i]{SET} eq "nan" ? "undefined" : + strftime("%H:%M:%S",localtime($sunrise_set[$i]{SET}))); + } my $k=0; my $half="RISE"; my $nexttime; my $licht; for(my $i=0;$i < 12;$i++){ $nexttime=$sunrise_set[6-abs($i-6)-$k]{$half}; + next if($nexttime eq "undefined"); if($nexttime > $now && $nexttime!=2000000000){ readingsUpdate($hash,"light", 6-abs($i-6)); if($i<6){