mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 03:06:37 +00:00
notify/at: generate event on state:disabled change (Forum #34322)
git-svn-id: https://svn.fhem.de/fhem/trunk@8098 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
14ce64ab85
commit
5826da64a1
@ -110,8 +110,9 @@ at_Define($$)
|
|||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
InternalTimer($nt, "at_Exec", $hash, 0);
|
InternalTimer($nt, "at_Exec", $hash, 0);
|
||||||
$hash->{NTM} = $ntm if($rel eq "+" || $fn);
|
$hash->{NTM} = $ntm if($rel eq "+" || $fn);
|
||||||
$hash->{STATE} = AttrVal($name, "disable", undef) ?
|
my $val = AttrVal($name, "disable", undef) ?
|
||||||
"disabled" : ("Next: ".FmtTime($nt));
|
"disabled" : ("Next: ".FmtTime($nt));
|
||||||
|
readingsSingleUpdate($hash, "state", $val, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
@ -242,10 +243,9 @@ at_Attr(@)
|
|||||||
}
|
}
|
||||||
$do = 2 if($cmd eq "del" && (!$attrName || $attrName eq "disable"));
|
$do = 2 if($cmd eq "del" && (!$attrName || $attrName eq "disable"));
|
||||||
return if(!$do);
|
return if(!$do);
|
||||||
$hash->{STATE} = ($do == 1 ?
|
my $val = ($do == 1 ? "disabled" :
|
||||||
"disabled" :
|
"Next: " . FmtTime($hash->{TRIGGERTIME}));
|
||||||
"Next: " . FmtTime($hash->{TRIGGERTIME}));
|
readingsSingleUpdate($hash, "state", $val, 1);
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ notify_Define($$)
|
|||||||
return "Bad regexp: $@" if($@);
|
return "Bad regexp: $@" if($@);
|
||||||
$hash->{REGEXP} = $re;
|
$hash->{REGEXP} = $re;
|
||||||
$hash->{".COMMAND"} = $command;
|
$hash->{".COMMAND"} = $command;
|
||||||
$hash->{STATE} = "active";
|
readingsSingleUpdate($hash, "state", "active", 1);
|
||||||
notifyRegexpChanged($hash, $re);
|
notifyRegexpChanged($hash, $re);
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
@ -110,7 +110,7 @@ notify_Attr(@)
|
|||||||
$do = 2 if($a[0] eq "del" && (!$a[2] || $a[2] eq "disable"));
|
$do = 2 if($a[0] eq "del" && (!$a[2] || $a[2] eq "disable"));
|
||||||
return if(!$do);
|
return if(!$do);
|
||||||
|
|
||||||
$defs{$a[1]}{STATE} = ($do == 1 ? "disabled" : "active");
|
readingsSingleUpdate($defs{$a[1]}, "state", $do==1 ? "disabled":"active", 1);
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user