59_HCS: Do not even start the check interval timer in case HCS is switched off.

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@15764 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
hjr 2018-01-03 11:58:42 +00:00
parent 70f5863acd
commit d4aa4fa8ae

View File

@ -156,7 +156,6 @@ HCS_Notify($$) {
delete $modules{HCS}{NotifyFn}; delete $modules{HCS}{NotifyFn};
delete $hash->{NTFY_ORDER} if($hash->{NTFY_ORDER}); delete $hash->{NTFY_ORDER} if($hash->{NTFY_ORDER});
HCS_DoInit($hash); HCS_DoInit($hash);
return undef; return undef;
@ -196,9 +195,11 @@ HCS_DoInit($) {
HCS_setState($hash,$ret); HCS_setState($hash,$ret);
RemoveInternalTimer($hash); RemoveInternalTimer($hash);
my $timer = gettimeofday()+($attr{$name}{interval}*60); if(ReadingsVal($name,"state","off") ne "off") {
InternalTimer($timer, "HCS_checkState", $hash, 0); my $timer = gettimeofday()+($attr{$name}{interval}*60);
$hash->{NEXTCHECK} = FmtTime($timer); InternalTimer($timer, "HCS_checkState", $hash, 0);
$hash->{NEXTCHECK} = FmtTime($timer);
}
} }
return undef; return undef;
@ -368,7 +369,7 @@ HCS_setState($$) {
my $state; my $state;
my $stateDevice; my $stateDevice;
return if(ReadingsVal($name,"state","") eq "off"); return if(ReadingsVal($name,"state","off") eq "off");
if($heatDemand == 0) { if($heatDemand == 0) {
$state = "idle"; $state = "idle";