11_OWDevice.pm: model attribute is only set or overwritten if model can be read from the bus.

git-svn-id: https://svn.fhem.de/fhem/trunk@7613 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
borisneubert
2015-01-18 12:16:31 +00:00
parent aba6eeb7cd
commit feab104f34

View File

@@ -694,9 +694,13 @@ OWDevice_InitValues($)
{
my ($hash) = @_;
my $name = $hash->{NAME};
my $model;
$hash->{fhem}{bus}= OWDevice_ReadFromServer($hash,"find",$hash->{fhem}{address});
$attr{$name}{model}= OWDevice_ReadValue($hash, "type");
$model= OWDevice_ReadValue($hash, "type");
if(defined($model)) {
$attr{$name}{model}= $model if($model ne "");
}
if($hash->{fhem}{interfaces} eq "id" && !defined($hash->{fhem}{interval})) {
my $dir= OWDevice_ReadFromServer($hash,"dir","/");