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

90_at.pm: do not generate events if at is disabled (Forum #34783)

git-svn-id: https://svn.fhem.de/fhem/trunk@8169 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-03-08 10:51:40 +00:00
parent 2b33df6872
commit 5c53fb7831
2 changed files with 3 additions and 2 deletions

View File

@ -113,7 +113,8 @@ at_Define($$)
my $val = IsDisabled($name) ?
(AttrVal($name, "disable", undef) ? "disabled" : "inactive") :
("Next: ".FmtTime($nt));
readingsSingleUpdate($hash, "state", $val, 1);
readingsSingleUpdate($hash, "state", $val,
!$hash->{READINGS}{state} || $hash->{READINGS}{state}{VAL} ne $val);
}
return undef;

View File

@ -2263,7 +2263,7 @@ CommandAttr($$)
}
}
if($attrName eq 'disable' and $a[2] eq 'toggle') {
if($attrName eq 'disable' and $a[2] && $a[2] eq 'toggle') {
$a[2] = IsDisabled($sdev) ? 0 : 1;
}