From cd6d0f0c7a852b2a649937e129c012510ee2e8e8 Mon Sep 17 00:00:00 2001 From: borisneubert <> Date: Tue, 3 Apr 2012 20:44:14 +0000 Subject: [PATCH] bugfix for background selection in 02_RSS.pm git-svn-id: https://svn.fhem.de/fhem/trunk@1406 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/02_RSS.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fhem/FHEM/02_RSS.pm b/fhem/FHEM/02_RSS.pm index a7cdd1517..7bdd74970 100644 --- a/fhem/FHEM/02_RSS.pm +++ b/fhem/FHEM/02_RSS.pm @@ -321,10 +321,16 @@ RSS_returnJPEG($) { # # set the background # - my $bgdir= AttrVal($name,"bg",""); - my $bgnr= 0; # item number # check if background directory is set + my $bgdir= AttrVal($name,"bg",""); goto SKIPBG unless($bgdir ne ""); + + my $bgnr; # item number + if(defined($defs{$name}{fhem}) && defined($defs{$name}{fhem}{bgnr})) { + $bgnr= $defs{$name}{fhem}{bgnr}; + } else { + $bgnr= 0; + } # check if at least tmin seconds have passed my $t0= 0; my $tmin= AttrVal($name,"tmin",0); @@ -334,9 +340,7 @@ RSS_returnJPEG($) { my $t1= time(); if($t1-$t0>= $tmin) { $defs{$name}{fhem}{t}= $t1; - if(defined($defs{$name}{fhem}) && defined($defs{$name}{fhem}{bgnr})) { - $bgnr= $defs{$name}{fhem}{bgnr}+1; - } + $bgnr++; } # detect pictures goto SKIPBG unless(opendir(BGDIR, $bgdir));