From 6e7e6ff449f86af7a85d663d08e4ad59155b4d69 Mon Sep 17 00:00:00 2001 From: Ellert <> Date: Sat, 9 Dec 2017 08:37:32 +0000 Subject: [PATCH] 98_DOIFtools.pm: DOIFtoolsNextTimer add indirect weekdays handling git-svn-id: https://svn.fhem.de/fhem/trunk@15576 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_DOIFtools.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/98_DOIFtools.pm b/fhem/FHEM/98_DOIFtools.pm index d94d68701..72c42d21b 100644 --- a/fhem/FHEM/98_DOIFtools.pm +++ b/fhem/FHEM/98_DOIFtools.pm @@ -778,10 +778,14 @@ sub DOIFtoolsNextTimer { my ($timer_str,$tn) = @_; $timer_str =~ /(\d\d).(\d\d).(\d\d\d\d) (\d\d):(\d\d):(\d\d)\|?(.*)/; my $tstr = "$1.$2.$3 $4:$5:$6"; - return $tstr if (length($7) == 0); + return $tstr if (!$7 && length($7) == 0); my $timer = timelocal($6,$5,$4,$1,$2-1,$3); + my $weekd = $7; + if ($weekd =~ s/\[(.*):(.*)\]//) { + $weekd .= ReadingsVal($1,length($2)>0?$2:"state","") if($1); + } my $tdays = ""; - $tdays = $tn ? DOIF_weekdays($defs{$tn},$7) : $7; + $tdays = $tn ? DOIF_weekdays($defs{$tn},$weekd) : $weekd; $tdays =~/([0-8])/; return $tstr if (length($1) == 0); my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($timer);