suppress updating readings with undefined value

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@2420 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert 2013-01-03 18:22:14 +00:00
parent 8f043090fb
commit ae5cac84cf

View File

@ -167,6 +167,7 @@ OWDevice_ReadValue($$) {
my $address= $hash->{fhem}{address};
my $value= OWDevice_ReadFromServer($hash, "/$address/$reading");
#Debug "/$address/$reading => $value";
if(defined($value)) {
$value= trim($value) if(AttrVal($hash,"trimvalues",1));
my @getters= @{$hash->{fhem}{getters}};
@ -201,7 +202,7 @@ OWDevice_UpdateValues($) {
readingsBeginUpdate($hash);
foreach my $reading (@polls) {
my $value= OWDevice_ReadValue($hash,$reading);
readingsBulkUpdate($hash,$reading,$value);
readingsBulkUpdate($hash,$reading,$value) if(defined($value));
}
readingsEndUpdate($hash,1);
}