2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 22:56:34 +00:00

fhem.pl: userReadings patch by justme1968

git-svn-id: https://svn.fhem.de/fhem/trunk@3872 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-09-07 11:58:33 +00:00
parent 13b941fb54
commit ac7b72af01

View File

@ -2713,7 +2713,7 @@ Dispatch($$$)
my $iohash = $modules{$hash->{TYPE}}; # The phyiscal device module pointer
my $name = $hash->{NAME};
Log 5, "$name dispatch $dmsg";
Log3 $hash, 5, "$name dispatch $dmsg";
my ($isdup, $idx) = CheckDuplicate($name, $dmsg, $iohash->{FingerprintFn});
return rejectDuplicate($name,$idx,$addvals) if($isdup);
@ -3336,12 +3336,12 @@ readingsEndUpdate($$)
$result= $deltav/$deltat;
}
} elsif($modifier eq "offset") {
$oldvalue= 0 if( !defined($oldvalue) );
$oldvalue = $value if( !defined($oldvalue) );
$result = ReadingsVal($name,$userReading,0);
$result += $oldvalue if( $value < $oldvalue );
} elsif($modifier eq "monotonic") {
$oldvalue= 0 if( !defined($oldvalue) );
$result = ReadingsVal($name,$userReading,0);
$oldvalue = $value if( !defined($oldvalue) );
$result = ReadingsVal($name,$userReading,$value);
$result += $value - $oldvalue if( $value > $oldvalue );
}
readingsBulkUpdate($hash,$userReading,$result,1) if(defined($result));