From 798c838204abe1ab80871d6fd55f23dd8da934e3 Mon Sep 17 00:00:00 2001 From: borisneubert <> Date: Thu, 29 Nov 2012 20:35:08 +0000 Subject: [PATCH] event-on-...-reading now accepts regular expression (patch by Matthias Gehre) git-svn-id: https://svn.fhem.de/fhem/trunk@2225 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/docs/commandref_frame.html | 4 ++-- fhem/fhem.pl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html index 635ea6d12..072b73eb1 100644 --- a/fhem/docs/commandref_frame.html +++ b/fhem/docs/commandref_frame.html @@ -328,13 +328,13 @@ A line ending with \ will be concatenated with the next one, so long lines
  • event-on-update-reading
    If not set, every update of any reading creates an event, which e.g. is handled by notify or FileLog. The attribute takes - a comma-separated list of readings. If set, only updates of the listed readings create + a comma-separated list of readings. You may use regular expressions in that list. If set, only updates of the listed readings create events.
  • event-on-change-reading
    - The attribute takes a comma-separated list of readings. If set, only changes of the listed readings create events. In other words, if a reading listed here is updated with the new value + The attribute takes a comma-separated list of readings. You may use regular expressions in that list. If set, only changes of the listed readings create events. In other words, if a reading listed here is updated with the new value identical to the old value, no event is created.

  • diff --git a/fhem/fhem.pl b/fhem/fhem.pl index c10288cc3..5c50b9249 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -2939,8 +2939,8 @@ readingsBulkUpdate($$$) { my $attreour= AttrVal($name, "event-on-update-reading", ""); # these flags determine whether the reading is listed in any of the attributes - my $eocr= $attreocr && grep($_ eq $reading, split /,/,$attreocr); - my $eour= $attreour && grep($_ eq $reading, split /,/,$attreour); + my $eocr= $attreocr && grep($reading =~ m/^$_$/, split /,/,$attreocr); + my $eour= $attreour && grep($reading =~ m/^$_$/, split /,/,$attreour); # determine if an event should be created $changed= !($attreocr || $attreour) # always create event if no attribute is set