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

90_at.pm: add execNow as set command (Forum #52716)

git-svn-id: https://svn.fhem.de/fhem/trunk@11342 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-04-29 11:25:51 +00:00
parent 32fc0574ac
commit 0237abc534

View File

@ -239,7 +239,7 @@ at_Set($@)
{ {
my ($hash, @a) = @_; my ($hash, @a) = @_;
my %sets = (modifyTimeSpec=>1, inactive=>0, active=>0); my %sets = (modifyTimeSpec=>1, inactive=>0, active=>0, execNow=>0);
my $cmd = join(" ", sort keys %sets); my $cmd = join(" ", sort keys %sets);
$cmd =~ s/modifyTimeSpec/modifyTimeSpec:time/ if($at_detailFnCalled); $cmd =~ s/modifyTimeSpec/modifyTimeSpec:time/ if($at_detailFnCalled);
$at_detailFnCalled = 0; $at_detailFnCalled = 0;
@ -267,6 +267,12 @@ at_Set($@)
readingsSingleUpdate($hash,"state","Next: ".FmtTime($hash->{TRIGGERTIME}),1) readingsSingleUpdate($hash,"state","Next: ".FmtTime($hash->{TRIGGERTIME}),1)
if(!AttrVal($hash->{NAME}, "disable", undef)); if(!AttrVal($hash->{NAME}, "disable", undef));
return undef; return undef;
} elsif($a[1] eq "execNow") {
my $name = $hash->{NAME};
my $ret = AnalyzeCommandChain(undef, SemicolonEscape($hash->{COMMAND}));
Log3 $name, 3, "$name: $ret" if($ret);
} }
} }
@ -488,6 +494,9 @@ EOF
</li> </li>
<li>active<br> <li>active<br>
Activates the current device (see inactive).</li> Activates the current device (see inactive).</li>
<li>execNow<br>
Execute the command associated with the at. The execution of a relative
at is not affected by this command.</li>
</ul><br> </ul><br>
@ -659,6 +668,10 @@ EOF
<li>active<br> <li>active<br>
Aktiviert das entsprechende Ger&auml;t, siehe inactive. Aktiviert das entsprechende Ger&auml;t, siehe inactive.
</li> </li>
<li>execNow<br>
F&uuml;hrt das mit dem at spezifizierte Befehl aus. Beeinflu&szlig;t
nicht die Ausf&uuml;hrungszeiten relativer Spezifikationen.
</li>
</ul><br> </ul><br>