mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
fhem.pl: AssignIoPort: check for IODev Attribute
git-svn-id: https://svn.fhem.de/fhem/trunk@5235 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f498753fba
commit
fdb28cbdf3
16
fhem/fhem.pl
16
fhem/fhem.pl
@ -1580,10 +1580,15 @@ sub
|
||||
AssignIoPort($;$)
|
||||
{
|
||||
my ($hash, $proposed) = @_;
|
||||
my $ht = $hash->{TYPE};
|
||||
my $hn = $hash->{NAME};
|
||||
my $hasIODevAttr = ($ht &&
|
||||
$modules{$ht}{AttrList} &&
|
||||
$modules{$ht}{AttrList} =~ m/IODev/);
|
||||
|
||||
if($proposed && $defs{$proposed}) {
|
||||
$hash->{IODev} = $defs{$proposed};
|
||||
$attr{$hash->{NAME}}{IODev} = $proposed;
|
||||
$attr{$hn}{IODev} = $proposed if($hasIODevAttr);
|
||||
delete($defs{$proposed}{".clientArray"});
|
||||
return;
|
||||
}
|
||||
@ -1593,7 +1598,7 @@ AssignIoPort($;$)
|
||||
my $cl = $defs{$p}{Clients};
|
||||
$cl = $modules{$defs{$p}{TYPE}}{Clients} if(!$cl);
|
||||
|
||||
if($cl && $defs{$p}{NAME} ne $hash->{NAME}) { # e.g. RFR
|
||||
if($cl && $defs{$p}{NAME} ne $hn) { # e.g. RFR
|
||||
my @fnd = grep { $hash->{TYPE} =~ m/^$_$/; } split(":", $cl);
|
||||
if(@fnd) {
|
||||
$hash->{IODev} = $defs{$p};
|
||||
@ -1603,12 +1608,13 @@ AssignIoPort($;$)
|
||||
}
|
||||
}
|
||||
if($hash->{IODev}) {
|
||||
$attr{$hash->{NAME}}{IODev} = $hash->{IODev}{NAME}
|
||||
if($hash->{TYPE} ne "CUL_WS"); # See CUL_WS_Attr() for details
|
||||
# See CUL_WS_Attr() for details
|
||||
$attr{$hn}{IODev} = $hash->{IODev}{NAME}
|
||||
if($hasIODevAttr && $hash->{TYPE} ne "CUL_WS");
|
||||
|
||||
} else {
|
||||
if($init_done) {
|
||||
Log 3, "No I/O device found for $hash->{NAME}"
|
||||
Log 3, "No I/O device found for $hn";
|
||||
} else {
|
||||
$hash->{IODevMissing} = 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user