MAX: fixed small bug

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2472 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mgehre 2013-01-10 22:57:26 +00:00
parent c1b7d82f1d
commit 5f5e45d351

View File

@ -160,7 +160,11 @@ MAX_ReadingsVal(@)
#Error: invalid value
Log 2, "MAX: Invalid value $val for READING $name. Forcing to $readingDef{$name}[2]";
$val = $readingDef{$name}[2];
readingsSingleUpdate($hash,$name,$val,0);
if(exists($hash->{".updateTimestamp"})) {
readingsBulkUpdate($hash,$name,$val);
} else {
readingsSingleUpdate($hash,$name,$val,0);
}
}
return $val;
}