From 443495f1d16d5db4c0d74536d15ad676a4c21919 Mon Sep 17 00:00:00 2001 From: borisneubert Date: Sat, 29 Dec 2007 16:19:32 +0000 Subject: [PATCH] - 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 --- fhem/FHEM/91_notify.pm | 8 +++++++- fhem/docs/commandref.html | 14 +++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/91_notify.pm b/fhem/FHEM/91_notify.pm index 8e587c539..32e6a6537 100755 --- a/fhem/FHEM/91_notify.pm +++ b/fhem/FHEM/91_notify.pm @@ -63,7 +63,13 @@ notify_Exec($$) my $exec = $log->{CMD}; $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; diff --git a/fhem/docs/commandref.html b/fhem/docs/commandref.html index a60abd932..78864b923 100644 --- a/fhem/docs/commandref.html +++ b/fhem/docs/commandref.html @@ -1019,12 +1019,20 @@ split in multiple lines

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