2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-07 12:58:13 +00:00

- Boris Sat Dec 29 16:56:00 CET 2007

- %NAME, %EVENT, %TYPE parameters in notify definition, commandref.html update


git-svn-id: https://svn.fhem.de/fhem/trunk@137 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2007-12-29 16:19:32 +00:00
parent 2d7f7e5d24
commit 443495f1d1
2 changed files with 18 additions and 4 deletions

View File

@ -63,7 +63,13 @@ notify_Exec($$)
my $exec = $log->{CMD}; my $exec = $log->{CMD};
$exec =~ s/%%/____/g; $exec =~ s/%%/____/g;
$exec =~ s/%/$s/g; my $extsyntax= 0;
$extsyntax+= ($exec =~ s/%TYPE/$t/g);
$extsyntax+= ($exec =~ s/%NAME/$n/g);
$extsyntax+= ($exec =~ s/%EVENT/$s/g);
if(!$extsyntax) {
$exec =~ s/%/$s/g;
}
$exec =~ s/____/%/g; $exec =~ s/____/%/g;
$exec =~ s/@@/____/g; $exec =~ s/@@/____/g;

View File

@ -1019,12 +1019,20 @@ split in multiple lines<br><br>
<li>The character <code>%</code> will be replaced with the received event, <li>The character <code>%</code> will be replaced with the received event,
e.g. with <code>on</code> or <code>off</code> or <code>measured-temp: 21.7 e.g. with <code>on</code> or <code>off</code> or <code>measured-temp: 21.7
(Celsius)</code><br> It is advisable to put the <code>%</code> into double (Celsius)</code><br> It is advisable to put the <code>%</code> into double
quotes, else the shell may get a syntax error.<br> quotes, else the shell may get a syntax error.</li>
To use % or @ in the text itself, use the double mode (%% or @@)</li>
<li>The character <code>@</code> will be replaced with the device <li>The character <code>@</code> will be replaced with the device
name.</li> name.</li>
<li>To use % or @ in the text itself, use the double mode (%% or @@).</li>
<li>Instead of <code>%</code> and <code>@</code>, the parameters
<code>%EVENT</code> (same as <code>%</code>), <code>%NAME</code>
(same as <code>@</code>) and <code>%TYPE</code> (contains the device
type, e.g. <code>FHT</code>) can be used. A single <code>%</code>
looses its special meaning if any of these parameters appears in the
definition.</li>
<li><code>&lt;pattern&gt;</code> may also be a compound of <li><code>&lt;pattern&gt;</code> may also be a compound of
<code>definition:event</code> to filter for events.</li> <code>definition:event</code> to filter for events.</li>