mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
Heating_Control_SetAllTemps() added to force the setting of all definded Heating_Controls
git-svn-id: https://svn.fhem.de/fhem/trunk@3142 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b3457d80df
commit
6b25ebe77f
@ -41,6 +41,7 @@ Heating_Control_Initialize($)
|
||||
$hash->{DefFn} = "Heating_Control_Define";
|
||||
$hash->{UndefFn} = "Heating_Control_Undef";
|
||||
$hash->{GetFn} = "Heating_Control_Get";
|
||||
$hash->{UpdFn} = "Heating_Control_Update";
|
||||
$hash->{AttrList}= "disable:0,1 loglevel:0,1,2,3,4,5 ".
|
||||
$readingFnAttributes;
|
||||
}
|
||||
@ -71,7 +72,6 @@ Heating_Control_Define($$)
|
||||
{
|
||||
my ($hash, $def) = @_;
|
||||
|
||||
RemoveInternalTimer($hash);
|
||||
my @a = split("[ \t]+", $def);
|
||||
|
||||
return "Usage: define <name> Heating_Control <device> <switching times> <condition|command>"
|
||||
@ -224,6 +224,7 @@ Heating_Control_Define($$)
|
||||
}
|
||||
}
|
||||
|
||||
RemoveInternalTimer($hash);
|
||||
my $now = time();
|
||||
InternalTimer ($now+30, "Heating_Control_Update", $hash, 0);
|
||||
|
||||
@ -283,8 +284,8 @@ Heating_Control_Update($)
|
||||
$newDesTemperature = $hash->{helper}{SWITCHINGTIME}{$days[$d]}{$st};
|
||||
$nowSwitch = $now;
|
||||
} else {
|
||||
$nextSwitch = $next;
|
||||
$nextDesTemperature = $hash->{helper}{SWITCHINGTIME}{$days[$d]}{$st};
|
||||
$nextSwitch = $next;
|
||||
last;
|
||||
}
|
||||
}
|
||||
@ -320,6 +321,7 @@ Heating_Control_Update($)
|
||||
Log GetLogLevel($name,3), $ret if($ret);
|
||||
}
|
||||
|
||||
RemoveInternalTimer($hash);
|
||||
InternalTimer($nextSwitch, "Heating_Control_Update", $hash, 0);
|
||||
|
||||
readingsBeginUpdate($hash);
|
||||
@ -330,6 +332,18 @@ Heating_Control_Update($)
|
||||
|
||||
return 1;
|
||||
}
|
||||
#
|
||||
sub Heating_Control_SetAllTemps() { # {Heating_Control_SetAllTemps()}
|
||||
|
||||
foreach my $hc ( sort keys %{$modules{Heating_Control}{defptr}} ) {
|
||||
my $hash = $modules{Heating_Control}{defptr}{$hc};
|
||||
|
||||
if($hash->{helper}{CONDITION}) {
|
||||
next if (!(eval ($hash->{helper}{CONDITION}))) ;
|
||||
}
|
||||
Heating_Control_Update($hash);
|
||||
}
|
||||
}
|
||||
|
||||
sub SortNumber {
|
||||
if($a < $b)
|
||||
|
Loading…
Reference in New Issue
Block a user