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:
parent
13b941fb54
commit
ac7b72af01
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user