From dc7e01af4ea0f98935b3c477c7b68e480673f798 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/fhem@4254 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fhem.pl b/fhem.pl index 1e5498f35..b89ca6f10 100755 --- a/fhem.pl +++ b/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) {