2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 05:16:45 +00:00

98_Heating_Control.pm - changing a Statement to get it work on older versions of Perl(Synlogy 5.8)

git-svn-id: https://svn.fhem.de/fhem/trunk@2776 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
dietmar63 2013-02-20 07:23:38 +00:00
parent b56b0e7dc7
commit d6b61795c8

View File

@ -95,13 +95,13 @@ Heating_Control_Define($$)
} }
for(my $i=0; $i<@a; $i++) { for(my $i=0; $i<@a; $i++) {
#prüfen auf Angabe eines Schaltpunktes #pruefen auf Angabe eines Schaltpunktes
my @t = split(/\|/, $a[$i]); my @t = split(/\|/, $a[$i]);
my $anzahl = @t; my $anzahl = @t;
if ( $anzahl ~~ [2,3]) { if ( $anzahl >= 2 && $anzahl <= 3) {
push(@switchingtimes, $a[$i]); push(@switchingtimes, $a[$i]);
} else { } else {
#der Rest ist das auzuführende Kommando/condition #der Rest ist das auzufuehrende Kommando/condition
$conditionOrCommand = trim(join(" ", @a[$i..@a-1])); $conditionOrCommand = trim(join(" ", @a[$i..@a-1]));
last; last;
} }
@ -145,13 +145,13 @@ Heating_Control_Define($$)
$dayNumber{$day} = $idx; $idx++; $dayNumber{$day} = $idx; $idx++;
} }
#Aufzählung 1234 ... #Aufzaehlung 1234 ...
if ( $daylist =~ m/^(\d){0,7}$/g) { if ( $daylist =~ m/^(\d){0,7}$/g) {
@days = split("", $daylist); @days = split("", $daylist);
@hdays{@days}=1; @hdays{@days}=1;
# Aufzählung Sa,So,... | Mo-Di,Do,Fr-Mo # Aufzaehlung Sa,So,... | Mo-Di,Do,Fr-Mo
} elsif ($daylist =~ m/^($daysRegExp(,|-|$)){0,7}$/g ) { } elsif ($daylist =~ m/^($daysRegExp(,|-|$)){0,7}$/g ) {
my $oldDay, my $oldDel; my $oldDay, my $oldDel;
@ -193,7 +193,7 @@ Heating_Control_Define($$)
} }
} }
#desired-temp des Zieldevices auswählen #desired-temp des Zieldevices auswaehlen
if($defs{$device}{TYPE} eq "MAX") { if($defs{$device}{TYPE} eq "MAX") {
$hash->{helper}{DESIRED_TEMP_READING} = "desiredTemperature" $hash->{helper}{DESIRED_TEMP_READING} = "desiredTemperature"
} else { } else {
@ -258,7 +258,7 @@ Heating_Control_Update($)
for (my $d=0; $d<@days; $d++) { for (my $d=0; $d<@days; $d++) {
Log $loglevel, "d------------>$d--->nextSwitch:$nextSwitch"; Log $loglevel, "d------------>$d--->nextSwitch:$nextSwitch";
#über jeden Tag #ueber jeden Tag
last if ($nextSwitch > 0); last if ($nextSwitch > 0);
Log $loglevel, "days[$d]------------>$days[$d]"; Log $loglevel, "days[$d]------------>$days[$d]";
foreach my $st (sort (keys %{ $hash->{helper}{SWITCHINGTIME}{$days[$d]} })) { foreach my $st (sort (keys %{ $hash->{helper}{SWITCHINGTIME}{$days[$d]} })) {