2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

forwardReturnValue

git-svn-id: https://svn.fhem.de/fhem/trunk@1124 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2011-11-30 08:38:11 +00:00
parent ad713abbe7
commit 8ca91716a9
3 changed files with 15 additions and 6 deletions

View File

@ -21,6 +21,7 @@
- bugfix: XmlList special handling
- bugfix: CUL_WS rain sensor corr1 fix
- feature: FHEMWEB stylesheet attribute repaced with stylesheetPrefix
- feature: notify attribute forwardReturnValue
- 2011-07-08 (5.1)

View File

@ -14,7 +14,7 @@ notify_Initialize($)
$hash->{DefFn} = "notify_Define";
$hash->{NotifyFn} = "notify_Exec";
$hash->{AttrFn} = "notify_Attr";
$hash->{AttrList} = "disable:0,1";
$hash->{AttrList} = "disable:0,1 forwardReturnValue:0,1 loglevel:0,1,2,3,4,5,6";
}
@ -67,6 +67,7 @@ notify_Exec($$)
$found = ("$n:$s" =~ m/^$re$/);
}
if($found) {
Log GetLogLevel($ln, 5), "Triggering $ln";
my (undef, $exec) = split("[ \t]+", $ntfy->{DEF}, 2);
my %specials= (
@ -77,11 +78,12 @@ notify_Exec($$)
$exec= EvalSpecials($exec, %specials);
my $r = AnalyzeCommandChain(undef, $exec);
Log 3, $r if($r);
Log GetLogLevel($ln, 3), "$ln return value: $r" if($r);
$ret .= " $r" if($r);
}
}
return $ret;
return $ret if(AttrVal($ln, "forwardReturnValue", 0));
return undef;
}
sub

View File

@ -6748,10 +6748,9 @@ href="http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=29870">U
<a name="disable"></a>
<li>disable<br>
Can be applied to at/watchdog/notify/FileLog devices.<br>
Disables the corresponding at/notify or FileLog device. Note:
Disables the corresponding at/notify or FileLog device. Note:
If applied to an <a href="#at">at</a>, the command will not be executed,
but the next time will be computed.</li><br>
<a name="skip_next"></a>
<li>skip_next<br>
Used for at commands: skip the execution of the command the next
@ -7111,6 +7110,14 @@ href="http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=29870">U
<b>Attributes</b>
<ul>
<li><a href="#disable">disable</a></li>
<li><a href="#loglevel">loglevel</a></li>
<a name="forwardReturnValue"></a>
<li>forwardReturnValue<br>
Forward the return value of the executed command to the caller,
default is disabled (0). If enabled (1), then e.g. a set command which
triggers this notify will also return this value. This can cause e.g
FHEMWEB to display this value, when clicking "on" or "off", which is
often not intended.</li>
</ul>
<br>
@ -7849,7 +7856,6 @@ isday</pre>
<ul>
<li><a href="#do_not_notify">do_not_notify</a></li><br>
<li><a href="#loglevel">loglevel</a></li><br>
<a name="disable"></a>
<li>disable<br>
Disables PachLog.
Nor more Logging to www.pachube.com