2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

98_DOIF.pm: fixed attribute weekdays

git-svn-id: https://svn.fhem.de/fhem/trunk@18023 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Damian 2018-12-21 15:07:36 +00:00
parent 09b0b28e3f
commit a51ad0d419

View File

@ -1568,12 +1568,10 @@ ParseCommandsDoIf($$$)
sub DOIF_weekdays($$)
{
my ($hash,$weekdays)=@_;
my @days=split(',',AttrVal($hash->{NAME},"weekdays","So,Mo,Di,Mi,Do,Fr,Sa,WE,AT,MWE"));
my @edays=split(',',"Su,Mo,Tu,We,Th,Fr,Sa,WE,WD,TWE");
for (my $i=0;$i<@days;$i++)
my @days=split(',',AttrVal($hash->{NAME},"weekdays","So|Su,Mo,Di|Tu,Mi|We,Do|Th,Fr,Sa,WE,AT|WD,MWE|TWE"));
for (my $i=@days-1;$i>=0;$i--)
{
$weekdays =~ s/$days[$i]/$i/;
$weekdays =~ s/$edays[$i]/$i/;
}
return($weekdays);
}