From 6f3cf224c9877fe2bd6650c1a865a74f19d82f8b Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Thu, 25 Apr 2013 08:26:36 +0000 Subject: [PATCH] Fixed event-on-change-reading in combination with event-change-interval git-svn-id: https://svn.fhem.de/fhem/trunk@3113 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/fhem.pl | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 7ffb79e33..bea798d15 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII - SVN + - bugfix: event-on-change-reading in combination with event-change-interval - change: HUEDevice: allow color preset buttons in webCmd - feature: SYSSTAT: allow (remote) monitoring raspberry pi on chip temperature - feature: HUEDevice: use webCmdFn for colorpicker diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 8d2295470..d69b09c28 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -3228,14 +3228,15 @@ readingsBulkUpdate($$$@) my @v = grep { my $l = $_; $l =~ s/:.*//; ($reading=~ m/^$l$/) ? $_ : undef} @{$hash->{".attrminint"}}; - if($changed && @v) { + if(@v) { my (undef, $minInt) = split(":", $v[0]); my $now = $hash->{".updateTime"}; my $le = $hash->{".lastTime$reading"}; if($le && $now-$le < $minInt) { - $changed = 0; + $changed = 0 if(!$eocr); } else { $hash->{".lastTime$reading"} = $now; + $changed = 1 if($eocr); } } }