From 1f93f22fa4aaa9a7cd3d9dedc681db14b072cc8a Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Wed, 20 Nov 2013 13:04:27 +0000 Subject: [PATCH] fhem.pl: optional AssignIODev Parameter (proposed) git-svn-id: https://svn.fhem.de/fhem/trunk@4254 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/fhem.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fhem/fhem.pl b/fhem/fhem.pl index 1e5498f35..b89ca6f10 100755 --- a/fhem/fhem.pl +++ b/fhem/fhem.pl @@ -44,7 +44,7 @@ sub AnalyzeCommand($$); sub AnalyzeCommandChain($$); sub AnalyzeInput($); sub AnalyzePerlCommand($$); -sub AssignIoPort($); +sub AssignIoPort($;$); sub AttrVal($$$); sub CallFn(@); sub CheckDuplicate($$@); @@ -1471,10 +1471,15 @@ CommandModify($$) ############# # internal sub -AssignIoPort($) +AssignIoPort($;$) { - my ($hash) = @_; + my ($hash, $proposed) = @_; + if($proposed && $defs{$proposed}) { + $hash->{IODev} = $defs{$proposed}; + delete($defs{$proposed}{".clientArray"}); + return; + } # Set the I/O device, search for the last compatible one. for my $p (sort { $defs{$b}{NR} <=> $defs{$a}{NR} } keys %defs) {