2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-26 17:04:59 +00:00

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
This commit is contained in:
borisneubert 2012-11-29 20:35:08 +00:00
parent 463e0831dc
commit 798c838204
2 changed files with 4 additions and 4 deletions

View File

@ -328,13 +328,13 @@ A line ending with \ will be concatenated with the next one, so long lines
<li>event-on-update-reading<br>
If not set, every update of any reading creates an event, which e.g. is handled
by <a href="#notify">notify</a> or <a href="#FileLog">FileLog</a>. 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.
</li>
<a name="event-on-change-reading"></a>
<li>event-on-change-reading<br>
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.
</li><br>

View File

@ -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