2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-09 20:57:11 +00:00

fhem.pl: fix oldreadings issue with 0 value (Forum #91003)

git-svn-id: https://svn.fhem.de/fhem/trunk@17316 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2018-09-10 13:07:04 +00:00
parent 6df6d7ae43
commit 5a6b15ea82

View File

@ -4376,9 +4376,9 @@ setReadingsVal($$$$)
{
my ($hash,$rname,$val,$ts) = @_;
if( $hash->{".or"} && grep($rname =~ m/^$_$/, @{$hash->{".or"}}) ) {
if( $hash->{READINGS}{$rname} &&
$hash->{READINGS}{$rname}{VAL} &&
if($hash->{".or"} && grep($rname =~ m/^$_$/, @{$hash->{".or"}}) ) {
if(defined($hash->{READINGS}{$rname}) &&
defined($hash->{READINGS}{$rname}{VAL}) &&
$hash->{READINGS}{$rname}{VAL} ne $val ) {
$hash->{OLDREADINGS}{$rname}{VAL} = $hash->{READINGS}{$rname}{VAL};
$hash->{OLDREADINGS}{$rname}{TIME} = $hash->{READINGS}{$rname}{TIME};