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

git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@8169 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig
2015-03-08 10:51:40 +00:00
parent 1cd8e0c4a1
commit 169b31f474
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;
}