forwardReturnValue

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

View File

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

View File

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

View File

@@ -6751,7 +6751,6 @@ href="http://www.elv.de/output/controller.aspx?cid=74&detail=10&detail2=29870">U
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, If applied to an <a href="#at">at</a>, the command will not be executed,
but the next time will be computed.</li><br> but the next time will be computed.</li><br>
<a name="skip_next"></a> <a name="skip_next"></a>
<li>skip_next<br> <li>skip_next<br>
Used for at commands: skip the execution of the command the next 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> <b>Attributes</b>
<ul> <ul>
<li><a href="#disable">disable</a></li> <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> </ul>
<br> <br>
@@ -7849,7 +7856,6 @@ isday</pre>
<ul> <ul>
<li><a href="#do_not_notify">do_not_notify</a></li><br> <li><a href="#do_not_notify">do_not_notify</a></li><br>
<li><a href="#loglevel">loglevel</a></li><br> <li><a href="#loglevel">loglevel</a></li><br>
<a name="disable"></a>
<li>disable<br> <li>disable<br>
Disables PachLog. Disables PachLog.
Nor more Logging to www.pachube.com Nor more Logging to www.pachube.com